"ScL Feature"/
ScL Feature 0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Loading...
Searching...
No Matches
operator.h File Reference

Compile-time operator reflection macros for wrapper types. More...

Go to the source code of this file.

Macros

#define SCL_REFLECT_BINARY_OPERATOR(op, name)
 Generates proxy binary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_FRIEND_BINARY_OPERATOR(op, name)
 Generates hidden-friend proxy binary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_FRIEND_POSTFIX_UNARY_OPERATOR(op, name)
 Generates hidden-friend proxy postfix-unary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_FRIEND_PREFIX_UNARY_OPERATOR(op, name)
 Generates hidden-friend proxy prefix-unary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_MEMBER_BINARY_OPERATOR(op, name)
 Generates member-only proxy binary operators (no hidden-friend variants).
#define SCL_REFLECT_MEMBER_POSTFIX_UNARY_OPERATOR(op, name)
 Generates member-only proxy postfix-unary operators (no hidden-friend variants).
#define SCL_REFLECT_MEMBER_PREFIX_UNARY_OPERATOR(op, name)
 Generates member-only proxy prefix-unary operators (no hidden-friend variants).
#define SCL_REFLECT_OPERATOR_WITH_ARGUMENTS(op, name)
 Generates proxy call/subscript operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_POSTFIX_UNARY_OPERATOR(op, name)
 Generates proxy postfix-unary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.
#define SCL_REFLECT_PREFIX_UNARY_OPERATOR(op, name)
 Generates proxy prefix-unary operators that reflect op from the wrapped object through the executor, for all 8 cv-ref qualifier combinations.

Detailed Description

Compile-time operator reflection macros for wrapper types.

Provides macros to automatically generate proxy operators that forward calls from a wrapper class to the held object through an executor, preserving cv-ref qualifiers exactly.

Every generated overload dispatches through Executor::execute so that executor strategies (e.g. locking executors) can intercept every call.

The executor is located at runtime via scl::feature::executor_trait, which must be specialized for each wrapper type.

Requirements on the enclosing class
  1. Declare the wrapper type with SCL_REFLECT_TYPE(Type,Member) (after the executor member declaration).
  2. Specialize scl::feature::executor_trait for the wrapper type.
  3. The executor type must provide:
    • a static access(exec) method that returns a reference to the wrapped object; and
    • a static execute(exec, callable, args...) method that invokes callable(args...) in the executor's context and returns its result.