libqi-api
2.8.7.4
|
#include <genericobject.hpp>
Public Member Functions | |
GenericObject (ObjectTypeInterface *type, void *value, const boost::optional< ObjectUid > &maybeUid=boost::none) | |
~GenericObject () | |
const MetaObject & | metaObject () |
template<typename R , typename... Args> | |
R | call (const std::string &methodName, Args &&...args) |
template<typename R , typename... Args> | |
qi::Future< R > | async (const std::string &methodName, Args &&...args) |
int | findMethod (const std::string &name, const GenericFunctionParameters ¶meters) |
Find method named name callable with arguments parameters. More... | |
void | post (const std::string &eventName, qi::AutoAnyReference p1=qi::AutoAnyReference(), qi::AutoAnyReference p2=qi::AutoAnyReference(), qi::AutoAnyReference p3=qi::AutoAnyReference(), qi::AutoAnyReference p4=qi::AutoAnyReference(), qi::AutoAnyReference p5=qi::AutoAnyReference(), qi::AutoAnyReference p6=qi::AutoAnyReference(), qi::AutoAnyReference p7=qi::AutoAnyReference(), qi::AutoAnyReference p8=qi::AutoAnyReference()) |
void | metaPost (unsigned int event, const GenericFunctionParameters ¶ms) |
void | metaPost (const std::string &nameWithOptionalSignature, const GenericFunctionParameters &in) |
template<typename FUNCTOR_TYPE > | |
qi::FutureSync< SignalLink > | connect (const std::string &eventName, FUNCTOR_TYPE callback, MetaCallType threadingModel=MetaCallType_Direct) |
qi::FutureSync< SignalLink > | connect (const std::string &name, const SignalSubscriber &functor) |
qi::FutureSync< SignalLink > | connect (unsigned int signal, const SignalSubscriber &subscriber) |
Calls given functor when event is fired. Takes ownership of functor. More... | |
qi::FutureSync< SignalLink > | connect (unsigned int signal, AnyObject target, unsigned int slot) |
qi::FutureSync< void > | disconnect (SignalLink linkId) |
Disconnect an event link. Returns if disconnection was successful. More... | |
template<typename T > | |
qi::FutureSync< T > | property (const std::string &name) |
template<typename T > | |
qi::FutureSync< void > | setProperty (const std::string &name, const T &val) |
qi::FutureSync< AnyValue > | property (unsigned int id) |
qi::FutureSync< void > | setProperty (unsigned int id, const AnyValue &val) |
bool | isValid () |
template<typename FUNCTION_TYPE > | |
qi::FutureSync< SignalLink > | connect (const std::string &eventName, FUNCTION_TYPE callback, MetaCallType model) |
qi::Future< AnyReference > | metaCall (const std::string &nameWithOptionalSignature, const GenericFunctionParameters ¶ms, MetaCallType callType=MetaCallType_Auto, Signature returnSignature=Signature()) |
qi::Future< AnyReference > | metaCall (unsigned int method, const GenericFunctionParameters ¶ms, MetaCallType callType=MetaCallType_Auto, Signature returnSignature=Signature()) |
![]() | |
virtual | ~Manageable () |
boost::mutex & | initMutex () |
void | forceExecutionContext (boost::shared_ptr< ExecutionContext > eventLoop) |
Override all ThreadingModel and force dispatch to given event loop. More... | |
boost::shared_ptr < ExecutionContext > | executionContext () const |
int | _nextTraceId () |
bool | isStatsEnabled () const |
void | enableStats (bool enable) |
Set statistics gathering status. More... | |
void | pushStats (int slotId, float wallTime, float userTime, float systemTime) |
Push statistics information about slotId . More... | |
ObjectStatistics | stats () const |
void | clearStats () |
Reset all statistical data. More... | |
bool | isTraceEnabled () const |
void | enableTrace (bool enable) |
Public Attributes | |
ObjectTypeInterface * | type |
void * | value |
ObjectUid | uid |
Uid of "value". More... | |
![]() | |
Signal< EventTrace > | traceObject |
Emitted each time a call starts and finishes, and for each signal trigger. More... | |
Additional Inherited Members | |
![]() | |
using | MethodMap = std::map< unsigned int, std::pair< AnyFunction, MetaCallType >> |
using | SignalGetter = boost::function< SignalBase *(void *)> |
using | SignalMap = std::map< unsigned int, SignalGetter > |
![]() | |
static MethodMap & | manageableMmethodMap () |
static SignalMap & | manageableSignalMap () |
static MetaObject & | manageableMetaObject () |
static void | _build () |
![]() | |
static const uint32_t | startId = 80 |
Starting id of features handled by Manageable. More... | |
static const uint32_t | endId = 99 |
Stop id of features handled by Manageable. More... | |
![]() | |
Manageable () | |
Manageable (const Manageable &b) | |
Manageable & | operator= (const Manageable &b) |
Definition at line 41 of file genericobject.hpp.
qi::GenericObject::GenericObject | ( | ObjectTypeInterface * | type, |
void * | value, | ||
const boost::optional< ObjectUid > & | maybeUid = boost::none |
||
) |
qi::GenericObject::~GenericObject | ( | ) |
qi::Future< R > qi::GenericObject::async | ( | const std::string & | methodName, |
Args &&... | args | ||
) |
Calls a method of the generic object asynchronously.
Definition at line 209 of file genericobject.hpp.
R qi::GenericObject::call | ( | const std::string & | methodName, |
Args &&... | args | ||
) |
Definition at line 195 of file genericobject.hpp.
qi::FutureSync<SignalLink> qi::GenericObject::connect | ( | const std::string & | eventName, |
FUNCTOR_TYPE | callback, | ||
MetaCallType | threadingModel = MetaCallType_Direct |
||
) |
Connect an event to an arbitrary callback.
If you are within a service, it is recommended that you connect the event to one of your Slots instead of using this method.
qi::FutureSync<SignalLink> qi::GenericObject::connect | ( | const std::string & | name, |
const SignalSubscriber & | functor | ||
) |
qi::FutureSync<SignalLink> qi::GenericObject::connect | ( | unsigned int | signal, |
const SignalSubscriber & | subscriber | ||
) |
Calls given functor when event is fired. Takes ownership of functor.
qi::FutureSync<SignalLink> qi::GenericObject::connect | ( | unsigned int | signal, |
AnyObject | target, | ||
unsigned int | slot | ||
) |
Connect an event to a method. Recommended use is when target is not a proxy. If target is a proxy and this is server-side, the event will be registered localy and the call will be forwarded. If target and this are proxies, the message will be routed through the current process.
qi::FutureSync<SignalLink> qi::GenericObject::connect | ( | const std::string & | eventName, |
FUNCTION_TYPE | callback, | ||
MetaCallType | model | ||
) |
Definition at line 168 of file genericobject.hpp.
qi::FutureSync<void> qi::GenericObject::disconnect | ( | SignalLink | linkId | ) |
Disconnect an event link. Returns if disconnection was successful.
int qi::GenericObject::findMethod | ( | const std::string & | name, |
const GenericFunctionParameters & | parameters | ||
) |
Find method named name callable with arguments parameters.
|
inline |
Definition at line 138 of file genericobject.hpp.
qi::Future<AnyReference> qi::GenericObject::metaCall | ( | const std::string & | nameWithOptionalSignature, |
const GenericFunctionParameters & | params, | ||
MetaCallType | callType = MetaCallType_Auto , |
||
Signature | returnSignature = Signature() |
||
) |
Call a method dynamically, using an extensible list of arguments and specific call policies. Since the underlying call may be asynchronous, these functions always return a future, which would match the underlying future result. In other words, it is already unwrapped. Call a method by its name or signature to deduce the method ID.
nameWithOptionalSignature | method name or method signature 'name::(args)' if signature is given, an exact match is required. |
params | arguments to pass to the call. |
callType | type of the call. |
returnSignature | forces the return type if set. |
qi::Future<AnyReference> qi::GenericObject::metaCall | ( | unsigned int | method, |
const GenericFunctionParameters & | params, | ||
MetaCallType | callType = MetaCallType_Auto , |
||
Signature | returnSignature = Signature() |
||
) |
Call a method dynamically, by method ID.
method | method ID. |
params | arguments to pass to the call. |
callType | type of the call. |
returnSignature | forces the return type if set. |
const MetaObject& qi::GenericObject::metaObject | ( | ) |
void qi::GenericObject::metaPost | ( | unsigned int | event, |
const GenericFunctionParameters & | params | ||
) |
void qi::GenericObject::metaPost | ( | const std::string & | nameWithOptionalSignature, |
const GenericFunctionParameters & | in | ||
) |
void qi::GenericObject::post | ( | const std::string & | eventName, |
qi::AutoAnyReference | p1 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p2 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p3 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p4 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p5 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p6 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p7 = qi::AutoAnyReference() , |
||
qi::AutoAnyReference | p8 = qi::AutoAnyReference() |
||
) |
qi::FutureSync< T > qi::GenericObject::property | ( | const std::string & | name | ) |
Definition at line 222 of file genericobject.hpp.
qi::FutureSync<AnyValue> qi::GenericObject::property | ( | unsigned int | id | ) |
qi::FutureSync< void > qi::GenericObject::setProperty | ( | const std::string & | name, |
const T & | val | ||
) |
Definition at line 239 of file genericobject.hpp.
qi::FutureSync<void> qi::GenericObject::setProperty | ( | unsigned int | id, |
const AnyValue & | val | ||
) |
ObjectTypeInterface* qi::GenericObject::type |
Definition at line 139 of file genericobject.hpp.
ObjectUid qi::GenericObject::uid |
Uid of "value".
Definition at line 141 of file genericobject.hpp.
void* qi::GenericObject::value |
Definition at line 140 of file genericobject.hpp.