libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
qi::MetaObject Class Reference

Description of the signals and methods accessible on an ObjectTypeInterface. More...

#include <metaobject.hpp>

Public Types

using MethodMap = std::map< unsigned int, MetaMethod >
 
using SignalMap = std::map< unsigned int, MetaSignal >
 
using PropertyMap = std::map< unsigned int, MetaProperty >
 
using CompatibleMethod = std::pair< MetaMethod, float >
 

Public Member Functions

 MetaObject ()
 
 MetaObject (const MetaObject &other)
 
MetaObjectoperator= (const MetaObject &other)
 
 ~MetaObject ()
 
int methodId (const std::string &nameWithSignature) const
 
int signalId (const std::string &name) const
 
int propertyId (const std::string &name) const
 
MethodMap methodMap () const
 
SignalMap signalMap () const
 
PropertyMap propertyMap () const
 
MetaMethodmethod (unsigned int id)
 
const MetaMethodmethod (unsigned int id) const
 
MetaSignalsignal (unsigned int id)
 
const MetaSignalsignal (unsigned int id) const
 
const MetaSignalsignal (const std::string &name) const
 
MetaPropertyproperty (unsigned int id)
 
const MetaPropertyproperty (unsigned int id) const
 
int findMethod (const std::string &nameWithOptionalSignature, const GenericFunctionParameters &args, bool *canCache=0) const
 
std::vector< MetaMethodfindMethod (const std::string &name) const
 
std::vector< CompatibleMethodfindCompatibleMethod (const std::string &nameOrSignature) const
 
std::string description () const
 
 MetaObject (const MethodMap &methodMap, const SignalMap &signalMap, const PropertyMap &propertyMap, const std::string &description)
 

Static Public Member Functions

static bool isPrivateMember (const std::string &name, unsigned int uid)
 
static qi::MetaObject merge (const qi::MetaObject &source, const qi::MetaObject &dest)
 

Public Attributes

MetaObjectPrivate * _p
 

Detailed Description

Description of the signals and methods accessible on an ObjectTypeInterface.

Definition at line 25 of file metaobject.hpp.

Member Typedef Documentation

using qi::MetaObject::CompatibleMethod = std::pair<MetaMethod, float>

Definition at line 112 of file metaobject.hpp.

using qi::MetaObject::MethodMap = std::map<unsigned int, MetaMethod>

Definition at line 48 of file metaobject.hpp.

using qi::MetaObject::PropertyMap = std::map<unsigned int, MetaProperty>

Definition at line 61 of file metaobject.hpp.

using qi::MetaObject::SignalMap = std::map<unsigned int, MetaSignal>

Definition at line 55 of file metaobject.hpp.

Constructor & Destructor Documentation

qi::MetaObject::MetaObject ( )
qi::MetaObject::MetaObject ( const MetaObject other)
qi::MetaObject::~MetaObject ( )
qi::MetaObject::MetaObject ( const MethodMap methodMap,
const SignalMap signalMap,
const PropertyMap propertyMap,
const std::string &  description 
)

Member Function Documentation

std::string qi::MetaObject::description ( ) const
Returns
The object's description.
std::vector<CompatibleMethod> qi::MetaObject::findCompatibleMethod ( const std::string &  nameOrSignature) const

Find all the methods compatible with nameOrSignature. If no signature is specified, the method relies on findMethod.

Parameters
nameOrSignatureEither the name or the signature of the method.
Returns
A vector containing all the compatible method and their associated compatibility's score.
int qi::MetaObject::findMethod ( const std::string &  nameWithOptionalSignature,
const GenericFunctionParameters args,
bool *  canCache = 0 
) const

Find a method matching nameWithOptionalSignature that can be called with arguments args.

Returns
The mathing method id, or -1 if none or an ambiguous set was found.
Warning
This method optimises for speed at the expense of possible false positive: It returns a match as soon as there is only one possible candidate remaining, even though this candidate can prove later on to be incompatible with the arguments.
Parameters
nameWithOptionalSignatureThe method's name or its full signature.
argsThe parameters' type of the method.
canCacheIf set, will be filled with true if the returned method can be cached regardless of the arguments types (but not argument count), and false otherwise.
std::vector<MetaMethod> qi::MetaObject::findMethod ( const std::string &  name) const
Parameters
nameThe exact method's name.
Returns
A vector containing all the overloaded version of the method.
static bool qi::MetaObject::isPrivateMember ( const std::string &  name,
unsigned int  uid 
)
static
Parameters
nameThe member's name.
uidThe uid's name.
Returns
True if the member is considered internal, and should not be listed.
static qi::MetaObject qi::MetaObject::merge ( const qi::MetaObject source,
const qi::MetaObject dest 
)
static

Merge two MetaObject. Dest method and signal ids will be incremented by offset.

Parameters
sourceThe source object.
destThe destination object.
Returns
The merge's result of the two objects.
MetaMethod* qi::MetaObject::method ( unsigned int  id)
Parameters
idThe method's id.
Returns
The desired method or null if the id is invalid.
const MetaMethod* qi::MetaObject::method ( unsigned int  id) const
int qi::MetaObject::methodId ( const std::string &  nameWithSignature) const
Parameters
nameWithSignatureThe complete full signature (name::signature) for example myMethod::(s).
Returns
The method's id or -1 if the method wasn't found.
MethodMap qi::MetaObject::methodMap ( ) const
Returns
The map of all the methods.
MetaObject& qi::MetaObject::operator= ( const MetaObject other)
MetaProperty* qi::MetaObject::property ( unsigned int  id)
Parameters
idThe property's id.
Returns
The desired property of null if the id is invalid.
const MetaProperty* qi::MetaObject::property ( unsigned int  id) const
int qi::MetaObject::propertyId ( const std::string &  name) const
Parameters
nameThe property's name.
Returns
The property's id or -1 if the property wasn't found.
PropertyMap qi::MetaObject::propertyMap ( ) const
Returns
The map of all the properties.
MetaSignal* qi::MetaObject::signal ( unsigned int  id)
Parameters
idThe signal's id.
Returns
The desired signal or null if the id is invalid.
const MetaSignal* qi::MetaObject::signal ( unsigned int  id) const
const MetaSignal* qi::MetaObject::signal ( const std::string &  name) const
Parameters
nameThe name of the signal or its full signature.
Returns
The desired signal or null if the signal wasn't found.
int qi::MetaObject::signalId ( const std::string &  name) const
Parameters
nameThe name of the signal or its full signature.
Returns
The signal's id or -1 if the signal wasn't found.
SignalMap qi::MetaObject::signalMap ( ) const
Returns
The map of all the signals.

Member Data Documentation

MetaObjectPrivate* qi::MetaObject::_p

Definition at line 141 of file metaobject.hpp.


The documentation for this class was generated from the following file: