MetaMethod
Inherited: None
Description
This class is a part of Object-Introspection-Mechanism. MetaMethod provides information about one particular class method. Developers are able to retrieve information about method arguments, return types and etc.
To make methods visible in introspection mechanism, developers must declare those under A_METHODS() macro.
Public Methods
MetaMethod (const MetaMethod::Table * table) |
|
bool |
invoke (void * object, Variant & returnValue, int argc, const Variant * args) const |
bool |
isValid () const |
const char |
name () const |
int |
parameterCount () const |
parameterType (int index) const |
|
returnType () const |
|
std::string |
signature () const |
const MetaMethod::Table * |
table () const |
MetaMethod::MethodType |
type () const |
Public Enums
enum MetaMethod::MethodType
This enum defines base method types.
Constant |
Value |
Description |
MetaMethod::Method |
0 |
Standard method can be invoked. Used for general porposes. |
MetaMethod::Signal |
1 |
Method without impelementation can’t be invoked. Used for Signals and Slots mechanism. |
MetaMethod::Slot |
2 |
Very similar to A_METHOD but with special flag to be used for Signals and Slots mechanism. |
MetaMethod::Static |
3 |
This is a static method and doesn’t requires an object to call. |
Static Methods
None
Methods Description
MetaMethod::MetaMethod (MetaMethod::Table * table)
Constructs MetaMethod object which will contain information provided in a table.
Calls current method for object. Function recieves an argument count in argc parameter and args array. Function is able to return the result of method invocation in returnValue.
Return true on succssed; otherwise returns false.
Note: Function checks if current method can be invoked.
bool MetaMethod::isValid () const
Returns true if method is valid; otherwise returns false.
const char MetaMethod::name () const
Returns a name of method.
int MetaMethod::parameterCount () const
Returns a parameter count of method.
MetaType MetaMethod::parameterType (int index) const
Returns the type of parameter at index position.
MetaType MetaMethod::returnType () const
Returns a return type of method.
std::string MetaMethod::signature () const
Returns method signature in text format.
const MetaMethod::Table * MetaMethod::table () const
Returns method information table.
MetaMethod::MethodType MetaMethod::type () const
Returns a type of method.