This builder works similarly to the qi::ObjectTypeBuilder
, but does not
register types to the type system (there is no type in a C++ sense). It can
only create type-erased objects from what has been advertised.
Global Classes
class qi::DynamicObjectBuilder
Functions (class qi::DynamicObjectBuilder)
qi::DynamicObjectBuilder::advertiseFactory
qi::DynamicObjectBuilder::object
qi::DynamicObjectBuilder::xAdvertiseSignal
qi::DynamicObjectBuilder::xAdvertiseMethod
qi::DynamicObjectBuilder::setThreadingModel
qi::DynamicObjectBuilder::xAdvertiseProperty
qi::DynamicObjectBuilder::advertiseSignalF
qi::DynamicObjectBuilder::setDescription
qi::DynamicObjectBuilder::advertiseSignal
qi::DynamicObjectBuilder::advertiseProperty
qi::DynamicObjectBuilder::markProperty
To build a dynamic object, advertise all its members in the builder and call
object()
to make an object of this type.
#include <qi/type/dynamicobjectbuilder.hpp>
void myfunc()
{
std::cout << "Hello world\n";
}
// initialize the builder
qi::DynamicObjectBuilder builder;
builder.advertiseMethod("myMethod", &myfunc);
builder.advertiseSignal<int>("signal");
// build objects
qi::AnyObject obj = builder.object();
obj.call<void>("myMethod");
obj.connect("signal", &myhandler);
obj.post("signal", 12);
DynamicObjectBuilder
()DynamicObjectBuilder
(DynamicObject* dynobject, bool deleteOnDestroy)~DynamicObjectBuilder
()advertiseMethod
(const std::string& name, OBJECT_TYPE object, METHOD_TYPE method, const std::string& desc, MetaCallType threadingModel)advertiseMethod
(const std::string& name, FUNCTION_TYPE function, const std::string& desc, MetaCallType threadingModel)advertiseMethod
(MetaMethodBuilder& builder, OBJECT_TYPE object, METHOD_TYPE method, MetaCallType threadingModel)advertiseMethod
(MetaMethodBuilder& builder, FUNCTION_TYPE function, MetaCallType threadingModel)advertiseFactory
(const std::string& name)advertiseSignal
(const std::string& name)advertiseSignalF
(const std::string& name)advertiseSignal
(const std::string& name, qi::SignalBase* signal)advertiseProperty
(const std::string& name)advertiseProperty
(const std::string& name, qi::PropertyBase* sig)setThreadingModel
(ObjectThreadingModel model)xAdvertiseMethod
(const Signature& sigret, const std::string& name, const Signature& signature, AnyFunction func, const std::string& desc, MetaCallType threadingModel)xAdvertiseMethod
(MetaMethodBuilder& builder, AnyFunction func, MetaCallType threadingModel)xAdvertiseSignal
(const std::string& name, const Signature& signature)xAdvertiseProperty
(const std::string& name, const Signature& sig, int id)setDescription
(const std::string& desc)object
(boost::function<void(GenericObject*)> onDelete)object
(boost::shared_ptr<T> other)markProperty
(unsigned int ev, unsigned int getter, unsigned int setter)qi::DynamicObjectBuilder::
DynamicObjectBuilder
()¶qi::DynamicObjectBuilder::
DynamicObjectBuilder
(DynamicObject* dynobject, bool deleteOnDestroy = true)¶qi::DynamicObjectBuilder::
~DynamicObjectBuilder
()¶qi::DynamicObjectBuilder::
advertiseMethod
(const std::string& name, OBJECT_TYPE object, METHOD_TYPE method, const std::string& desc = "", MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
advertiseMethod
(const std::string& name, FUNCTION_TYPE function, const std::string& desc = "", MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
advertiseMethod
(MetaMethodBuilder& builder, OBJECT_TYPE object, METHOD_TYPE method, MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
advertiseMethod
(MetaMethodBuilder& builder, FUNCTION_TYPE function, MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
advertiseFactory
(const std::string& name)¶create a T, wrap in a AnyObject All template parameters are given to the T constructor except the first one
qi::DynamicObjectBuilder::
advertiseSignal
(const std::string& name)¶qi::DynamicObjectBuilder::
advertiseSignalF
(const std::string& name)¶Advertise a signal using a function signature.
qi::DynamicObjectBuilder::
advertiseSignal
(const std::string& name, qi::SignalBase* signal)¶qi::DynamicObjectBuilder::
advertiseProperty
(const std::string& name)¶qi::DynamicObjectBuilder::
advertiseProperty
(const std::string& name, qi::PropertyBase* sig)¶Ownership is transferred to the object.
qi::DynamicObjectBuilder::
setThreadingModel
(ObjectThreadingModel model)¶qi::DynamicObjectBuilder::
xAdvertiseMethod
(const Signature& sigret, const std::string& name, const Signature& signature, AnyFunction func, const std::string& desc = "", MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
xAdvertiseMethod
(MetaMethodBuilder& builder, AnyFunction func, MetaCallType threadingModel = MetaCallType_Auto)¶qi::DynamicObjectBuilder::
xAdvertiseSignal
(const std::string& name, const Signature& signature)¶qi::DynamicObjectBuilder::
xAdvertiseProperty
(const std::string& name, const Signature& sig, int id = -1)¶qi::DynamicObjectBuilder::
setDescription
(const std::string& desc)¶qi::DynamicObjectBuilder::
object
(boost::function<void(GenericObject*)> onDelete = boost::function< void(GenericObject *)¶Return an AnyObject that shares life type with other.
qi::DynamicObjectBuilder::
markProperty
(unsigned int ev, unsigned int getter, unsigned int setter)¶