47 #ifndef _MIRA_OBJECT_H_ 48 #define _MIRA_OBJECT_H_ 55 class ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR1__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________
57 virtual int FOR_CLASS();
58 virtual ~________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR1__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________() {}
63 class ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR2__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________
65 virtual int FOR_CLASS();
66 virtual ~________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR2__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________() {}
71 class ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR3__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________
73 virtual int FOR_CLASS();
74 virtual ~________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR3__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________() {}
79 class ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR4__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________
81 virtual int FOR_CLASS();
82 virtual ~________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR4__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________() {}
108 static std::string tIdent(
"mira::Object");
126 template <
class CLASS>
127 CLASS*
newInstance( std::string
const& childIdentifier )
const;
148 template<
typename Class,
typename Base>
180 #define MIRA_OBJECT_CONSTRUCTOR1(T, A0) \ 182 ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR1__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________ \ 183 <T>::FOR_CLASS() { return 0; } \ 186 T* mira::ClassFactoryDefaultConstClassBuilder::invoke<1,T>( std::va_list ap) { \ 187 A0 a0 = va_arg(ap, A0); \ 192 #define MIRA_OBJECT_CONSTRUCTOR2(T, A0, A1) \ 194 ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR2__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________ \ 195 <T>::FOR_CLASS() { return 0; } \ 198 T* mira::ClassFactoryDefaultConstClassBuilder::invoke<2,T>( std::va_list ap) { \ 199 A0 a0 = va_arg(ap, A0); \ 200 A1 a1 = va_arg(ap, A1); \ 201 return new T( a0, a1 ); \ 205 #define MIRA_OBJECT_CONSTRUCTOR3(T, A0, A1, A2) \ 207 ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR3__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________ \ 208 <T>::FOR_CLASS() { return 0; } \ 211 T* mira::ClassFactoryDefaultConstClassBuilder::invoke<3,T>( std::va_list ap) { \ 212 A0 a0 = va_arg(ap, A0); \ 213 A1 a1 = va_arg(ap, A1); \ 214 A2 a2 = va_arg(ap, A2); \ 215 return new T( a0, a1, a2 ); \ 219 #define MIRA_OBJECT_CONSTRUCTOR4(T, A0, A1, A2, A3) \ 221 ________________________________PLEASE_USE_THE__MIRA_OBJECT_CONSTRUCTOR4__MACRO_IN_GLOBAL_NAMESPACE_ONLY________________________________ \ 222 <T>::FOR_CLASS() { return 0; } \ 225 T* mira::ClassFactoryDefaultConstClassBuilder::invoke<4,T>( std::va_list ap) { \ 226 A0 a0 = va_arg(ap, A0); \ 227 A1 a1 = va_arg(ap, A1); \ 228 A2 a2 = va_arg(ap, A2); \ 229 A3 a3 = va_arg(ap, A3); \ 230 return new T( a0, a1, a2, a3 ); \ What should i say, the class factory.
Definition: Factory.h:88
virtual Class const & internalGetClass() const =0
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
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
friend struct FactoryRegisterClassHelper
Definition: Object.h:149
json_spirit::mObject Object
A representation of an object (class, struct) in JSON.
Definition: JSON.h:183
Class const & getClass() const
call the virtual internalGetClass().
Definition: Object.h:159
virtual ~Object()
Definition: Object.h:152
This is an auxiliary to enable more verbose exception messages.
Definition: Object.h:103
std::string const & getIdentifier() const
Definition: Object.h:106
static PseudoClass const & CLASS()
Definition: Object.h:163
Object * newInstance(std::string const &childIdentifier) const
Return a new instance of the class with the given identifier.
Definition: Factory.h:332