qi::ObjectTypeBuilder¶
This builder is used to register C++ objects to the type system.
Summary¶
class qi::ObjectTypeBuilder
Global Classes
Detailed Description¶
To use it, instanciate it, register all the members of your class and call
registerType
.
qi::ObjectTypeBuilder<MyClass> builder;
builder.advertise("doSomething", &MyClass::doSomething);
builder.advertise("signal", &MyClass::signal);
builder.advertise("property", &MyClass::property);
builder.registerType();
Look at the type registering guide for a more complete example, and support for overloaded functions.
Reference¶
qi::ObjectTypeBuilder Class Reference¶
Public Functions¶
-
(bool autoRegister)ObjectTypeBuilder
- template<typename U>
-
void
()inherits
- template<typename FUNCTION_TYPE>
-
unsigned int
(const std::string& name, FUNCTION_TYPE function, MetaCallType threadingModel, int id)advertiseMethod
- template<typename FUNCTION_TYPE>
-
unsigned int
(MetaMethodBuilder& name, FUNCTION_TYPE function, MetaCallType threadingModel, int id)advertiseMethod
-
void
()registerType
-
AnyObject
(T* ptr, boost::function<void(GenericObject*)> onDestroy)object
Detailed Description¶
Function Documentation¶
- template<typename FUNCTION_TYPE>
-
unsigned int
qi::ObjectTypeBuilder<T>::
advertiseMethod
(const std::string& name, FUNCTION_TYPE function, MetaCallType threadingModel = MetaCallType_Auto, int id = -1)¶
- template<typename FUNCTION_TYPE>
-
unsigned int
qi::ObjectTypeBuilder<T>::
advertiseMethod
(MetaMethodBuilder& name, FUNCTION_TYPE function, MetaCallType threadingModel = MetaCallType_Auto, int id = -1)¶
-
void
qi::ObjectTypeBuilder<T>::
registerType
()¶ Register type to typeOf<T>, to avoid both TypeImpl<T> and type() being present.
-
AnyObject
qi::ObjectTypeBuilder<T>::
object
(T* ptr, boost::function<void(GenericObject*)> onDestroy = boost::function< void(GenericObject *)¶