MIRA
ReflectorInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Contact: info@mira-project.org
9  *
10  * Commercial Usage:
11  * Licensees holding valid commercial licenses may use this file in
12  * accordance with the commercial license agreement provided with the
13  * software or, alternatively, in accordance with the terms contained in
14  * a written agreement between you and MLAB or NICR.
15  *
16  * GNU General Public License Usage:
17  * Alternatively, this file may be used under the terms of the GNU
18  * General Public License version 3.0 as published by the Free Software
19  * Foundation and appearing in the file LICENSE.GPL3 included in the
20  * packaging of this file. Please review the following information to
21  * ensure the GNU General Public License version 3.0 requirements will be
22  * met: http://www.gnu.org/copyleft/gpl.html.
23  * Alternatively you may (at your option) use any later version of the GNU
24  * General Public License if such license has been publicly approved by
25  * MLAB and NICR (or its successors, if any).
26  *
27  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
28  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
29  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
30  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
35  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
36  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
37  */
38 
47 #ifndef _MIRA_REFLECTORINTERFACE_H_
48 #define _MIRA_REFLECTORINTERFACE_H_
49 
50 #include <string>
51 #include <unordered_map>
52 
53 #ifndef Q_MOC_RUN
54 #include <boost/preprocessor/repetition.hpp>
55 #include <boost/mpl/bool.hpp>
56 #include <boost/type_traits/integral_constant.hpp>
57 #endif
58 
59 #include <platform/Environment.h>
60 #include <platform/Typename.h>
61 
62 #include <rpc/RPCPatternCheck.h>
66 
67 namespace mira {
68 
70 
71 namespace serialization {
72  typedef uint8 VersionType;
73  typedef std::unordered_map<Typename, VersionType> ClassVersionMap;
74 
81 }
82 
110 template <typename Derived>
112 {
113 public:
114  struct Tag {};
115 
121  typedef boost::mpl::bool_<true> isReadOnly;
122 
128  typedef boost::mpl::bool_<true> useHumanReadableIDs;
129 
148  typedef boost::mpl::bool_<false> requireReflectBarriers;
149 
179  struct ReflectState {};
180 
181 public:
193 
195 
241  template <typename T>
242  VersionType version(VersionType version, const T* caller = NULL)
243  {
244  return version;
245  }
246 
248  MIRA_DEPRECATED("Please call as version<MyType>(v) or version(v, this)",
250 
275  template <typename T>
277  VersionType minVersion, const T* caller = NULL) { return version; }
278 
280  MIRA_DEPRECATED("Please call as requireVersion<MyType>(v, minV) or requireVersion(v, minV, this)",
282 
287  template <typename T>
288  void requireVersion(VersionType version, const T* caller = NULL) {}
289 
291  MIRA_DEPRECATED("Please call as requireVersion<MyType>(v) or requireVersion(v, this)",
293 
295 
328  void desireClassVersions(const ClassVersionMap& versions) {}
329 
331 
336  template <typename T>
338  {
339  return version;
340  }
341 
346  template <typename T>
348  AcceptDesiredVersion, const T* caller = NULL) { return version; }
349 
354  template <typename T>
355  void requireVersion(VersionType version, AcceptDesiredVersion, const T* caller = NULL) {}
356 
358 
364 
374  template<typename T>
375  void member(const char* name, T& member, const char* comment,
377 
383  template<typename T>
384  void member(const char* name, const std::string& id, T& member,
385  const char* comment, ReflectCtrlFlags flags = REFLECT_CTRLFLAG_NONE) {}
386 
391  template<typename T>
392  void member(const char* name, const T& member, Setter<T> setter,
393  const char* comment, ReflectCtrlFlags flags = REFLECT_CTRLFLAG_NONE) {}
394 
401  template<typename T>
402  void member(const char* name, Getter<T> getter, Setter<T> setter,
403  const char* comment, ReflectCtrlFlags flags = REFLECT_CTRLFLAG_NONE) {}
404 
405 
406  // with default value
407 
413  template<typename T, typename U>
414  void member(const char* name, T& member, const char* comment,
415  const U& defaultValue, ReflectCtrlFlags flags = REFLECT_CTRLFLAG_NONE) {}
416 
422  template<typename T, typename U>
423  void member(const char* name, const T& member, Setter<T> setter,
424  const char* comment, const U& defaultValue,
426 
432  template<typename T, typename U>
433  void member(const char* name, Getter<T> getter, Setter<T> setter,
434  const char* comment, const U& defaultValue,
436 
437  // Properties
438 
444  template<typename T>
445  void property(const char* name, T& member, const char* comment,
446  PropertyHint&& hint = PropertyHint(),
448 
454  template<typename T>
455  void property(const char* name, const std::string& id, T& member,
456  const char* comment, PropertyHint&& hint = PropertyHint(),
458 
463  template<typename T>
464  void property(const char* name, const T& member, Setter<T> setter,
465  const char* comment, PropertyHint&& hint = PropertyHint(),
467 
472  template<typename T>
473  void property(const char* name, Getter<T> getter, Setter<T> setter,
474  const char* comment, PropertyHint&& hint = PropertyHint(),
476 
477  // default values
478 
483  template<typename T, typename U>
484  void property(const char* name, T& member, const char* comment,
485  const U& defaultValue, PropertyHint&& hint = PropertyHint(),
487 
492  template<typename T, typename U>
493  void property(const char* name, const T& member, Setter<T> setter,
494  const char* comment, const U& defaultValue,
495  PropertyHint&& hint = PropertyHint(),
497 
502  template<typename T, typename U>
503  void property(const char* name, Getter<T> getter, Setter<T> setter,
504  const char* comment, const U& defaultValue,
505  PropertyHint&& hint = PropertyHint(),
507 
508 
513  template<typename T>
514  void roproperty(const char* name, const T& member,
515  const char* comment, PropertyHint&& hint = PropertyHint(),
517 
522  template<typename T>
523  void roproperty(const char* name, const std::string& id, const T& member,
524  const char* comment, PropertyHint&& hint = PropertyHint(),
526 
531  template<typename T>
532  void roproperty(const char* name, Getter<T> getter, const char* comment,
533  PropertyHint&& hint = PropertyHint(),
535 
541  void itemName(const std::string& name) {}
542 
548  template<typename T>
549  void delegate(T& member,
551 
557  template<typename T>
558  void delegate(const T& member, Setter<T> setter,
560 
566  template<typename T>
569 
571 
574 
581  void interface(const char* name) {}
582 
583  // invalid method signatures
584  template<typename R, typename... Args, typename F, typename... Description>
585  InvalidRPCDescription<R(Args...), Description...>
586  method(const char*, F&&, Description&&...)
587  {
588  Private::rpc::invalidAssertion<R(Args...), Description...>();
589  }
590 
591  template<typename F, typename... Description>
592  InvalidRPCDescription<F, Description...>
593  method(const char*, F&&, Description&&...)
594  {
595  Private::rpc::invalidAssertion<F, Description...>();
596  }
597 
598  template<typename R, typename Class, typename... Args, typename... Description>
599  InvalidRPCDescription<R (Class::*)(Args...), Description...>
600  method(const char*, R (Class::*)(Args...), Class*, Description&&...)
601  {
602  Private::rpc::invalidAssertion<R (Class::*)(Args...), Description...>();
603  }
604 
605  template<typename R, typename Class, typename... Args, typename... Description>
606  InvalidRPCDescription<R (Class::*)(Args...) const, Description...>
607  method(const char*, R (Class::*)(Args...) const, Class*, Description&&...)
608  {
609  Private::rpc::invalidAssertion<R (Class::*)(Args...) const, Description...>();
610  }
611 
612  // valid method signatures
613  template<typename R, typename... Args, typename F, typename... Description>
614  ValidRPCDescription<R(Args...), Description...>
615  method(const char*, F&&, Description&&...)
616  {}
617 
618  template<typename F, typename... Description>
619  ValidRPCDescription<F, Description...>
620  method(const char*, F&&, Description&&...)
621  {}
622 
623  template<typename R, typename Class, typename... Args, typename... Description>
624  ValidRPCDescription<R (Class::*)(Args...), Description...>
625  method(const char*, R (Class::*)(Args...), Class*, Description&&...)
626  {}
627 
628  template<typename R, typename Class, typename... Args, typename... Description>
629  ValidRPCDescription<R (Class::*)(Args...) const, Description...>
630  method(const char*, R (Class::*)(Args...) const, Class*, Description&&...)
631  {}
632 
633  // provide a method that causes an error at compile time if instantiated. Derived classes overriding
634  // method() should call this in their implementation for wrong argument number
635  template<typename R, typename ...Args>
637  { /* force this to fail whenever it is instantiated - but only then! */
638  static_assert(
639  sizeof(R*) == 0,
640  "_____________NUMBER OR TYPES OF NAMES/DESCRIPTIONS/SAMPLEVALUES FOR PARAMETERS "
641  "IN CALL TO Reflector::method() DO NOT MATCH THE PROVIDED FUNCTION'S SIGNATURE. "
642  "PLEASE PROVIDE const char* NAME AND DESCRIPTION FOR EACH RPC METHOD PARAMETER, "
643  "OR NAME, DESCRIPTION AND A CORRECTLY TYPED SAMPLE VALUE FOR EACH PARAMETER._____________");
644  }
645 
646 #ifdef DOXYGEN
647  // this is a fake method to generate a doxygen documentation for the
648  // methods created above
649 
681  void method(const char* name, Method method, const char* comment,
682  const char* paramName, const char* paramDescription, P paramSampleValue, ...);
683 
707  void method(const char* name, Method method, Class* object, const char* comment,
708  const char* paramName, const char* paramDescription, P paramSampleValue, ...);
709 
733  void method(const char* name, Method method, const char* comment,
734  const char* paramName, const char* paramDescription, P paramSampleValue, ...);
735 
736 #endif
737 
739 
744 
747 
750 
752 
791  template <typename Base>
792  void reflectBase(Base& base) {}
793 
794 
801  static bool usesHumanReadableIDs() {
802  return Derived::useHumanReadableIDs::value;
803  }
804 
822  ReflectState preReflect(const char* context = "")
823  {
824  MIRA_THROW(XNotImplemented,
825  typeName<Derived>() << "::requireReflectBarriers == true, but " <<
826  typeName<Derived>() << "::preReflect() not implemented!");
827 
828  return ReflectState();
829  }
830 
832  void postReflect(const ReflectState&)
833  {
834  MIRA_THROW(XNotImplemented,
835  typeName<Derived>() << "::requireReflectBarriers == true, but " <<
836  typeName<Derived>() << "::postReflect() not implemented!");
837  }
838 
839 protected:
840 
841  static int checkForcedVersion(const std::string& variable)
842  {
843  try {
844  std::stringstream ss;
845  ss.str(resolveEnvironmentVariable(variable));
846  int i;
847  ss >> i;
848  return i;
849  }
850  catch(XInvalidConfig&) {}
851 
852  return -1;
853  }
854 };
855 
856 
874 #define MIRA_REFLECT_VERSION(reflector, versionNumber) reflector.version(versionNumber, this)
875 
893 #define MIRA_REFLECT_REQUIRE_VERSION(reflector, versionNumber) reflector.requireVersion(versionNumber, this)
894 
912 #define MIRA_REFLECT_BASE(reflector, BaseClass) reflector.template reflectBase<BaseClass>(*this)
913 
931 #define MIRA_REFLECT_BASE_NONINTRUSIVE(reflector, BaseClass, object) reflector.template reflectBase<BaseClass>(object)
932 
970 #define MIRA_REFLECT_BASE_IF_VERSION_ATLEAST(reflector, BaseClass, versionvar, minversion) \
971  if (versionvar < minversion) \
972  BaseClass::reflect(reflector); \
973  else \
974  reflector.template reflectBase<BaseClass>(*this); \
975 
976 
985 #define MIRA_REFLECT_BASE_NONINTRUSIVE_IF_VERSION_ATLEAST(reflector, BaseClass, object, versionvar, minversion) \
986  if (versionvar < minversion) \
987  reflect(reflector, (BaseClass&)object); \
988  else \
989  reflector.template reflectBase<BaseClass>(object); \
990 
991 
1003 #define MIRA_MEMBER_WITH_ID(reflector, name, id, var, ...) \
1004  if(reflector.usesHumanReadableIDs()) \
1005  reflector.member(name, id, var, __VA_ARGS__); \
1006  else \
1007  reflector.member(name, var, __VA_ARGS__);
1008 
1009 #define MIRA_PROPERTY_WITH_ID(reflector, name, id, var, ...) \
1010  if(reflector.usesHumanReadableIDs()) \
1011  reflector.property(name, id, var, __VA_ARGS__); \
1012  else \
1013  reflector.property(name, var, __VA_ARGS__);
1014 
1016 
1017 } // namespace
1018 
1019 #endif
static int checkForcedVersion(const std::string &variable)
Definition: ReflectorInterface.h:841
std::unordered_map< Typename, VersionType > ClassVersionMap
Definition: ReflectorInterface.h:73
void popObjectTrackingStore()
Pop the current object tracking memory from internal stack (restore).
Definition: ReflectorInterface.h:749
void property(const char *name, T &member, const char *comment, const U &defaultValue, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:484
VersionType version(VersionType version, const T *caller=NULL)
Specifies the current class version and returns the version found in the data stream.
Definition: ReflectorInterface.h:242
void member(const char *name, const T &member, Setter< T > setter, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with a special setter method for reading the member.
Definition: ReflectorInterface.h:392
serialization::ClassVersionMap ClassVersionMap
Definition: ReflectorInterface.h:294
void delegate(Getter< T > getter, Setter< T > setter, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Delegates the serialization/reflection of a member directly to the member.
Definition: ReflectorInterface.h:567
void member(const char *name, const std::string &id, T &member, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with an extra parameter for specifying the id explicitly if it differs from name...
Definition: ReflectorInterface.h:384
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
void itemName(const std::string &name)
If the currently reflected object is an item within a collection, this allows to specify an explicit ...
Definition: ReflectorInterface.h:541
If &#39;reflect barriers&#39; are used, each separated reflection block within an object has a separate state...
Definition: ReflectorInterface.h:179
boost::mpl::bool_< false > requireReflectBarriers
Specifies whether the Reflector uses so-called &#39;reflect barriers&#39; to allow maintaining separate state...
Definition: ReflectorInterface.h:148
Provides property hints and attributes.
InvalidRPCDescription< R(Class::*)(Args...) const, Description... > method(const char *, R(Class::*)(Args...) const, Class *, Description &&...)
Definition: ReflectorInterface.h:607
Class object which supports some kind of class reflection.
Definition: Class.h:97
Setter< T > setter(void(*f)(const T &))
Creates a Setter for global or static class methods taking the argument by const reference.
Definition: GetterSetter.h:443
void member(const char *name, Getter< T > getter, Setter< T > setter, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with a special getter and setter accessing the member.
Definition: ReflectorInterface.h:402
Holds a boost::function object to a special setter function that must meet the signature "void method...
Definition: GetterSetter.h:395
InvalidRPCDescription< R(Class::*)(Args...), Description... > method(const char *, R(Class::*)(Args...), Class *, Description &&...)
Definition: ReflectorInterface.h:600
VersionType requireVersion(VersionType version, VersionType minVersion, const T *caller=NULL)
Same as above, but allows to specify a minimum supported version, and throws XIO if the minimum versi...
Definition: ReflectorInterface.h:276
Get compiler and platform independent typenames.
void desireClassVersions(const ClassVersionMap &versions)
Historically, classes have just been defining their current version themselves during serialization (...
Definition: ReflectorInterface.h:328
uint8 VersionType
Definition: ReflectorInterface.h:72
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:81
void roproperty(const char *name, const T &member, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
A property that just reflects a runtime state of the object and can be displayed but not altered...
Definition: ReflectorInterface.h:514
This is the public interface of all reflectors that are able to visit a class&#39; reflect() method...
Definition: ReflectorInterface.h:111
ValidRPCDescription< R(Args...), Description... > method(const char *, F &&, Description &&...)
Definition: ReflectorInterface.h:615
A property hint gives optional instructions to the property editor, i.e.
Definition: PropertyHint.h:82
void roproperty(const char *name, Getter< T > getter, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with a special getter method for reading the member.
Definition: ReflectorInterface.h:532
Flags controlling reflector behaviour.
boost::mpl::bool_< true > isReadOnly
Specifies, if the Reflector is read-only (true) or write-only (false).
Definition: ReflectorInterface.h:121
static bool usesHumanReadableIDs()
Returns true, if the concrete derived Reflector supports human readable IDs.
Definition: ReflectorInterface.h:801
Provides RPC SFINAE helper to check whether a provided description parameter pack is valid...
InvalidRPCDescription< F, Description... > method(const char *, F &&, Description &&...)
Definition: ReflectorInterface.h:593
MIRA_DEPRECATED("Please call as requireVersion<MyType>(v) or requireVersion(v, this)", VersionType requireVersion(VersionType version))
Deprecated &#39;anonymous&#39; (no type) requireVersion().
Definition: ReflectorInterface.h:291
void pushObjectTrackingStore()
Push the current object tracking memory to an internal stack (backup).
Definition: ReflectorInterface.h:746
void reflectBase(Base &base)
Method that can be called to reflect the base class easily.
Definition: ReflectorInterface.h:792
MIRA_BASE_EXPORT std::string resolveEnvironmentVariable(const std::string &envVar)
Resolves an environmental variable.
No flags.
Definition: ReflectControlFlags.h:65
void member(const char *name, Getter< T > getter, Setter< T > setter, const char *comment, const U &defaultValue, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, where a default value can be specified that is used, if the value is not available in ...
Definition: ReflectorInterface.h:433
void property(const char *name, Getter< T > getter, Setter< T > setter, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:473
MIRA_DEPRECATED("Please call as version<MyType>(v) or version(v, this)", VersionType version(VersionType version))
Deprecated &#39;anonymous&#39; (no type) version().
Definition: ReflectorInterface.h:248
ValidRPCDescription< R(Class::*)(Args...) const, Description... > method(const char *, R(Class::*)(Args...) const, Class *, Description &&...)
Definition: ReflectorInterface.h:630
ValidRPCDescription< F, Description... > method(const char *, F &&, Description &&...)
Definition: ReflectorInterface.h:620
void invalid_method()
Definition: ReflectorInterface.h:636
Tag class used as parameter to ReflectorInterface::version() etc.
Definition: ReflectorInterface.h:80
ValidRPCDescription< R(Class::*)(Args...), Description... > method(const char *, R(Class::*)(Args...), Class *, Description &&...)
Definition: ReflectorInterface.h:625
VersionType version(VersionType version, AcceptDesiredVersion, const T *caller=NULL)
Extension of version() (see above), that additionally signals the reflector that the caller will prop...
Definition: ReflectorInterface.h:337
void property(const char *name, const T &member, Setter< T > setter, const char *comment, const U &defaultValue, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:493
Getter< T > getter(T(*f)())
Creates a Getter for global or static class methods returning the result by value.
Definition: GetterSetter.h:136
InvalidRPCDescription< R(Args...), Description... > method(const char *, F &&, Description &&...)
Definition: ReflectorInterface.h:586
void delegate(const T &member, Setter< T > setter, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Delegates the serialization/reflection of a member directly to the member.
Definition: ReflectorInterface.h:558
void property(const char *name, Getter< T > getter, Setter< T > setter, const char *comment, const U &defaultValue, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:503
void delegate(T &member, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Delegates the serialization/reflection of a member directly to the member.
Definition: ReflectorInterface.h:549
typename std::enable_if< Private::rpc::isValid< F, Description... >()>::type ValidRPCDescription
Definition: RPCPatternCheck.h:307
typename std::enable_if<!Private::rpc::isValid< F, Description... >()>::type InvalidRPCDescription
Definition: RPCPatternCheck.h:310
void member(const char *name, T &member, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Specifies a class member for reflection/serialization.
Definition: ReflectorInterface.h:375
void member(const char *name, T &member, const char *comment, const U &defaultValue, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, where a default value can be specified that is used, if the value is not available in ...
Definition: ReflectorInterface.h:414
void roproperty(const char *name, const std::string &id, const T &member, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with an extra parameter for specifying the id explicitly if it differs from name...
Definition: ReflectorInterface.h:523
void property(const char *name, T &member, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:445
serialization::VersionType VersionType
Definition: ReflectorInterface.h:194
Holds a boost::function object to a special getter function that must meet the signature "T method()"...
Definition: GetterSetter.h:87
void property(const char *name, const std::string &id, T &member, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, with an extra parameter for specifying the id explicitly if it differs from name...
Definition: ReflectorInterface.h:455
Functions for platform independent resolving of environment variables.
VersionType requireVersion(VersionType version, VersionType minVersion, AcceptDesiredVersion, const T *caller=NULL)
Extension of requireVersion() (see above), that additionally signals the reflector that the caller wi...
Definition: ReflectorInterface.h:347
ReflectCtrlFlags
Control Flags that can modify the behavior of certain reflectors.
Definition: ReflectControlFlags.h:63
serialization::AcceptDesiredVersion AcceptDesiredVersion
Definition: ReflectorInterface.h:330
void requireVersion(VersionType version, AcceptDesiredVersion, const T *caller=NULL)
Extension of requireVersion() (see above), that additionally signals the reflector that the caller wi...
Definition: ReflectorInterface.h:355
void property(const char *name, const T &member, Setter< T > setter, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as the corresponding member-method, to indicate that the member is a property and can be altered...
Definition: ReflectorInterface.h:464
ReflectState preReflect(const char *context="")
If a reflector requires reflection barriers, preReflect() and postReflect() should be called before/a...
Definition: ReflectorInterface.h:822
boost::mpl::bool_< true > useHumanReadableIDs
Specifies, if the Reflector supports human readable IDs.
Definition: ReflectorInterface.h:128
MIRA_DEPRECATED("Please call as requireVersion<MyType>(v, minV) or requireVersion(v, minV, this)", VersionType requireVersion(VersionType version, VersionType minVersion))
Deprecated &#39;anonymous&#39; (no type) requireVersion().
Definition: ReflectorInterface.h:280
Provides definition for getters and setters that are used with the serialization framework.
void member(const char *name, const T &member, Setter< T > setter, const char *comment, const U &defaultValue, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Same as above, where a default value can be specified that is used, if the value is not available in ...
Definition: ReflectorInterface.h:423
Definition: ReflectorInterface.h:114
void requireVersion(VersionType version, const T *caller=NULL)
Specifies the current class version, which is also the minimum (and therefore only) version accepted ...
Definition: ReflectorInterface.h:288
void interface(const char *name)
Indicates that the class implements the specified RPC interface.
Definition: ReflectorInterface.h:581
constexpr std::enable_if<!FunctionTraits< F >::isFunction >::type invalidAssertion()
Definition: RPCPatternCheck.h:282
void postReflect(const ReflectState &)
See preReflect for documentation.
Definition: ReflectorInterface.h:832