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");
99 template<
typename Reflector,
typename T>
102 auto& reflector =
static_cast<Reflector&
>(r);
106 static const std::string context = typeName<T>() +
" splitReflect";
108 if constexpr (Reflector::isReadOnly::value) {
109 auto& reflector =
static_cast<Reflector&
>(r);
130 #define MIRA_SPLIT_REFLECT(Type) \ 131 template<typename Reflector> \ 132 void reflect(mira::ReflectorInterface<Reflector>& r, Type& value) \ 134 splitReflect(r, value); \ 139 template<
typename Reflector,
typename Class>
142 if constexpr (Reflector::isReadOnly::value) {
162 template<
typename Reflector,
typename Class>
165 auto& reflector =
static_cast<Reflector&
>(r);
171 static const std::string context = typeName<Class>() +
" splitReflectMember";
189 #define MIRA_SPLIT_REFLECT_MEMBER \ 190 template<typename Reflector> \ 191 void reflect(mira::ReflectorInterface<Reflector>& r) \ 193 Reflector& reflector = static_cast<Reflector&>(r); \ 199 typedef typename std::remove_reference<decltype(*this)>::type splitType; \ 201 static const std::string context = typeName<splitType>() + " MIRA_SPLIT_REFLECT_MEMBER"; \ 203 MIRA_REFLECT_CALL(Reflector, reflector, context.c_str(), \ 204 (splitReflectMemberInvoke(reflector, this))); \ void reflectWrite(Reflector &r, Buffer< T, Allocator > &c)
Specialization of the non-intrusive reflect for Buffer.
Definition: Buffer.h:577
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:140
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:163
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:561