SoftBank Robotics documentation What's new in NAOqi 2.5?

qi::ObjectTypeBuilder

This builder is used to register C++ objects to the type system.

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

Introduction

More...

  • Inherits: qi::ObjectTypeBuilderBase

Public Functions

ObjectTypeBuilder(bool autoRegister)
template<typename U>
void inherits()
template<typename FUNCTION_TYPE>
unsigned int advertiseMethod(const std::string& name, FUNCTION_TYPE function, MetaCallType threadingModel, int id)
template<typename FUNCTION_TYPE>
unsigned int advertiseMethod(MetaMethodBuilder& name, FUNCTION_TYPE function, MetaCallType threadingModel, int id)
void registerType()
AnyObject object(T* ptr, boost::function<void(GenericObject*)> onDestroy)

Detailed Description

Function Documentation

qi::ObjectTypeBuilder<T>::ObjectTypeBuilder(bool autoRegister = true)
template<typename U>
void qi::ObjectTypeBuilder<T>::inherits()

Declare that T inherits from U.

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 *)