"ScL Feature"/
ScL Feature 0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Loading...
Searching...
No Matches
reflect.h
Go to the documentation of this file.
1#pragma once
2
47
50
51namespace scl::feature
52{
74 template <typename Wrapper, typename Executor, typename Type>
75 class reflect
76 {};
77
86 // NOLINTBEGIN(readability-function-cognitive-complexity, readability-inconsistent-ifelse-braces, cppcoreguidelines-missing-std-forward, cppcoreguidelines-rvalue-reference-param-not-moved)
87 template <typename Wrapper, typename Executor>
89 {
90 public:
91 SCL_REFLECT_TYPE(Wrapper, Executor)
92
95 SCL_REFLECT_OPERATOR_WITH_ARGUMENTS(->*, arrow_to_pointer)
97
98 SCL_REFLECT_BINARY_OPERATOR(SCL_FORWARD(, ), comma)
101
104 SCL_REFLECT_PREFIX_UNARY_OPERATOR(++, prefix_increment)
105 SCL_REFLECT_PREFIX_UNARY_OPERATOR(--, prefix_decrement)
108
109 SCL_REFLECT_POSTFIX_UNARY_OPERATOR(++, postfix_increment)
110 SCL_REFLECT_POSTFIX_UNARY_OPERATOR(--, postfix_decrement)
111
112 SCL_REFLECT_BINARY_OPERATOR(==, equal_to)
113 SCL_REFLECT_BINARY_OPERATOR(!=, not_equal_to)
115 SCL_REFLECT_BINARY_OPERATOR(<=, less_equal)
117 SCL_REFLECT_BINARY_OPERATOR(>=, greater_equal)
118
119 SCL_REFLECT_BINARY_OPERATOR(*, multiply)
124
125 SCL_REFLECT_BINARY_OPERATOR(<<, left_shift)
126 SCL_REFLECT_BINARY_OPERATOR(>>, right_shift)
127
128 SCL_REFLECT_BINARY_OPERATOR(&, bitwise_and)
129 SCL_REFLECT_BINARY_OPERATOR(|, bitwise_or)
130 SCL_REFLECT_BINARY_OPERATOR(^, bitwise_xor)
131
132 SCL_REFLECT_BINARY_OPERATOR(&&, logical_and)
133 SCL_REFLECT_BINARY_OPERATOR(||, logical_or)
134
135 SCL_REFLECT_MEMBER_BINARY_OPERATOR(=, assign) // NOLINT(cppcoreguidelines-c-copy-assignment-signature)
136 SCL_REFLECT_MEMBER_BINARY_OPERATOR(*=, multiply_assign)
137 SCL_REFLECT_MEMBER_BINARY_OPERATOR(/=, divide_assign)
138 SCL_REFLECT_MEMBER_BINARY_OPERATOR(%=, modulo_assign)
140 SCL_REFLECT_MEMBER_BINARY_OPERATOR(-=, minus_assign)
141 SCL_REFLECT_MEMBER_BINARY_OPERATOR(<<=, left_shift_assign)
142 SCL_REFLECT_MEMBER_BINARY_OPERATOR(>>=, right_shift_assign)
143 SCL_REFLECT_MEMBER_BINARY_OPERATOR(&=, bitwise_and_assign)
144 SCL_REFLECT_MEMBER_BINARY_OPERATOR(|=, bitwise_or_assign)
145 SCL_REFLECT_MEMBER_BINARY_OPERATOR(^=, bitwise_xor_assign)
146 };
147 // NOLINTEND(readability-function-cognitive-complexity, readability-inconsistent-ifelse-braces, cppcoreguidelines-missing-std-forward, cppcoreguidelines-rvalue-reference-param-not-moved)
148
149} // namespace scl::feature
CRTP mixin that reflects all standard C++ operators through the executor.
Definition reflect.h:89
Primary (terminal) template for the reflection mixin chain.
Definition reflect.h:76
#define SCL_REFLECT_TYPE(type, executor)
Declares the wrapper and executor types for use by SCL_REFLECT_METHOD.
Definition type.h:27
#define SCL_REFLECT_PREFIX_UNARY_OPERATOR(op, name)
Generates proxy prefix-unary operators that reflect op from the wrapped object through the executor,...
Definition operator.h:359
#define SCL_REFLECT_OPERATOR_WITH_ARGUMENTS(op, name)
Generates proxy call/subscript operators that reflect op from the wrapped object through the executor...
Definition operator.h:567
#define SCL_REFLECT_BINARY_OPERATOR(op, name)
Generates proxy binary operators that reflect op from the wrapped object through the executor,...
Definition operator.h:526
#define SCL_REFLECT_POSTFIX_UNARY_OPERATOR(op, name)
Generates proxy postfix-unary operators that reflect op from the wrapped object through the executor,...
Definition operator.h:418
#define SCL_REFLECT_MEMBER_PREFIX_UNARY_OPERATOR(op, name)
Generates member-only proxy prefix-unary operators (no hidden-friend variants).
Definition operator.h:385
#define SCL_REFLECT_MEMBER_BINARY_OPERATOR(op, name)
Generates member-only proxy binary operators (no hidden-friend variants).
Definition operator.h:548
Compile-time method reflection macros for wrapper types.
Namespace of the ScL Feature module.
Compile-time operator reflection macros for wrapper types.