47 #ifndef _MIRA_SPLITREFLECT_H_ 48 #define _MIRA_SPLITREFLECT_H_ 55 template <
typename Derived>
56 class ReflectorInterface;
62 template<
typename DerivedReflector,
typename T>
71 static_assert(
sizeof(T)==0,
"You must implement reflectRead() " 72 "if you use the MIRA_SPLIT_REFLECT macro");
75 template<
typename DerivedReflector,
typename T>
84 static_assert(
sizeof(T)==0,
"You must implement reflectWrite() " 85 "if you use the MIRA_SPLIT_REFLECT macro");
88 struct GlobalReflectRead {
89 template<
typename Reflector,
typename T>
91 auto& reflector =
static_cast<Reflector&
>(r);
96 struct GlobalReflectWrite {
97 template<
typename Reflector,
typename T>
98 static void invoke(Reflector& r, T& value) {
103 template<
typename GlobalReflectReadOrWrite,
typename Reflector,
typename T>
104 inline void splitReflectInvoke(Reflector& r, T& value)
106 GlobalReflectReadOrWrite::invoke(r, value);
120 template<
typename Reflector,
typename T>
123 auto& reflector =
static_cast<Reflector&
>(r);
127 static const std::string context = typeName<T>() +
" splitReflect";
129 if constexpr (Reflector::isReadOnly::value) {
131 (splitReflectInvoke<GlobalReflectRead>(reflector, value)));
135 (splitReflectInvoke<GlobalReflectWrite>(reflector, value)));
150 #define MIRA_SPLIT_REFLECT(Type) \ 151 template<typename Reflector> \ 152 void reflect(mira::ReflectorInterface<Reflector>& r, Type& value) \ 154 splitReflect(r, value); \ 157 template<
typename Reflector,
typename Class>
160 if constexpr (Reflector::isReadOnly::value) {
182 template<
typename Reflector,
typename Class>
185 auto& reflector =
static_cast<Reflector&
>(r);
191 static const std::string context = typeName<Class>() +
" splitReflectMember";
209 #define MIRA_SPLIT_REFLECT_MEMBER \ 210 template<typename Reflector> \ 211 void reflect(mira::ReflectorInterface<Reflector>& r) \ 213 Reflector& reflector = static_cast<Reflector&>(r); \ 219 typedef typename std::remove_reference<decltype(*this)>::type splitType; \ 221 static const std::string context = typeName<splitType>() + " MIRA_SPLIT_REFLECT_MEMBER"; \ 223 MIRA_REFLECT_CALL(Reflector, reflector, context.c_str(), \ 224 (splitReflectMemberInvoke(reflector, this))); \ void reflectWrite(Reflector &r, Buffer< T, Allocator > &c)
Specialization of the non-intrusive reflect for Buffer.
Definition: Buffer.h:581
void reflectWrite(Reflector &r)
Implementation of class member reflection.
Definition: Class.h:762
Macros for use with reflectors.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Class object which supports some kind of class reflection.
Definition: Class.h:97
void splitReflectMemberInvoke(Reflector &r, Class *This)
Definition: SplitReflect.h:158
Get compiler and platform independent typenames.
void splitReflectMember(mira::ReflectorInterface< Reflector > &r, Class *This)
This method is used to split reflection into a reflectRead() and reflectWrite() method.
Definition: SplitReflect.h:183
This is the public interface of all reflectors that are able to visit a class' reflect() method...
Definition: ReflectorInterface.h:111
MIRA_SPLIT_REFLECT_MEMBER void reflectRead(Reflector &r)
Implementation of class member reflection.
#define MIRA_REFLECT_CALL(ReflectorType, reflector, context, COMMAND)
Whenever a reflection function calls another function that is independently maintained, the call should be marked to the reflector.
Definition: ReflectorMacros.h:109
void reflectRead(Reflector &r, Buffer< T, Allocator > &c)
Specialization of the non-intrusive reflect for Buffer.
Definition: Buffer.h:565