.. _api_MetaMethod: MetaMethod ========== Inherited: None .. _api_MetaMethod_description: 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. .. _api_MetaMethod_public: Public Methods -------------- +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | | :ref:`MetaMethod` (const MetaMethod::Table * table) | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | bool | :ref:`invoke` (void * object, Variant & returnValue, int argc, const Variant * args) const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | bool | :ref:`isValid` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | const char | :ref:`name` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | int | :ref:`parameterCount` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaType` | :ref:`parameterType` (int index) const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaType` | :ref:`returnType` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | std::string | :ref:`signature` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | const :ref:`MetaMethod::Table` * | :ref:`table` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaMethod::MethodType` | :ref:`type` () const | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ .. _api_MetaMethod_enums: Public Enums ------------ .. _api_MetaMethod_MethodType: **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. | +--------------------+-------+--------------------------------------------------------------------------------------------+ .. _api_MetaMethod_static: Static Methods -------------- None .. _api_MetaMethod_methods: Methods Description ------------------- .. _api_MetaMethod_MetaMethod: **MetaMethod::MetaMethod** (:ref:`MetaMethod::Table` * *table*) Constructs MetaMethod object which will contain information provided in a *table*. ---- .. _api_MetaMethod_invoke: bool **MetaMethod::invoke** (void * *object*, :ref:`Variant` & *returnValue*, int *argc*, :ref:`Variant` * *args*) const 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. ---- .. _api_MetaMethod_isValid: bool **MetaMethod::isValid** () const Returns true if method is valid; otherwise returns false. ---- .. _api_MetaMethod_name: const char **MetaMethod::name** () const Returns a name of method. ---- .. _api_MetaMethod_parameterCount: int **MetaMethod::parameterCount** () const Returns a parameter count of method. ---- .. _api_MetaMethod_parameterType: :ref:`MetaType` **MetaMethod::parameterType** (int *index*) const Returns the type of parameter at *index* position. ---- .. _api_MetaMethod_returnType: :ref:`MetaType` **MetaMethod::returnType** () const Returns a return type of method. ---- .. _api_MetaMethod_signature: std::string **MetaMethod::signature** () const Returns method signature in text format. ---- .. _api_MetaMethod_table: const :ref:`MetaMethod::Table` * **MetaMethod::table** () const Returns method information table. ---- .. _api_MetaMethod_type: :ref:`MetaMethod::MethodType` **MetaMethod::type** () const Returns a type of method.