MetaObject

Inherited: None

Description

This class is a part of Object-Introspection-Mechanism. MetaObject provides information about one particular class inherited from base Object class. Developers are able to retrieve information about properties, methods and inheritance chains.

This class is actively used in Signal-Slot mechanism.

Public Methods

MetaObject (const char * name, const MetaObject * super, const MetaObject::Constructor constructor, const MetaMethod::Table * methods, const MetaProperty::Table * props, const MetaEnum::Table * enums)

bool

canCastTo (const char * type) const

Object *

createInstance () const

MetaEnum

enumerator (int index) const

int

enumeratorCount () const

int

enumeratorOffset () const

int

indexOfEnumerator (const char * name) const

int

indexOfMethod (const char * signature) const

int

indexOfProperty (const char * name) const

int

indexOfSignal (const char * signature) const

int

indexOfSlot (const char * signature) const

MetaMethod

method (int index) const

int

methodCount () const

int

methodOffset () const

const char

name () const

MetaProperty

property (int index) const

int

propertyCount () const

int

propertyOffset () const

const MetaObject *

super () const

Public Enums

enum MetaObject::Constructor

Callback which contain address to method to construct new Object with represented type.

Static Methods

None

Methods Description

MetaObject::MetaObject (char * name, MetaObject * super, MetaObject::Constructor constructor, MetaMethod::Table * methods, MetaProperty::Table * props, MetaEnum::Table * enums)

Constructs MetaObject object for Object with type name, inherited from super class and provided constructor, methods, props and enums.


bool MetaObject::canCastTo (char * type) const

Checks the abillity to cast the current object to type.

Note: This method tries to go through inheritance to find a common parent class.

Returns true if object can be cast to type; otherwise returns false.


:ref:`Object<api_Object>`* MetaObject::createInstance () const

Constructs and return a new instance of associated class.


MetaEnum MetaObject::enumerator (int index) const

Returns MetaEnum object by provided index of enumerator.

Note: This method looks through class hierarchy.


int MetaObject::enumeratorCount () const

Returns the sum of enumerators for the current class and parent classes.


int MetaObject::enumeratorOffset () const

Returns the first index of enumerator for current class. The offset is the sum of all enumerator in parent classes.


int MetaObject::indexOfEnumerator (char * name) const

Returns index of class enumerator by provided name; otherwise returns -1.

Note: This method looks through class hierarchy.


int MetaObject::indexOfMethod (char * signature) const

Returns index of class method by provided signature; otherwise returns -1.

Note: This method looks through class hierarchy.


int MetaObject::indexOfProperty (char * name) const

Returns index of class property by provided name; otherwise returns -1.

Note: This method looks through class hierarchy.


int MetaObject::indexOfSignal (char * signature) const

Returns index of class signal by provided signature; otherwise returns -1.

Note: This method looks through class hierarchy.


int MetaObject::indexOfSlot (char * signature) const

Returns index of class slot by provided signature; otherwise returns -1.

Note: This method looks through class hierarchy.


MetaMethod MetaObject::method (int index) const

Returns MetaMethod object by provided index of method.

Note: This method looks through class hierarchy.


int MetaObject::methodCount () const

Returns the sum of methods for the current class and parent classes. It’s includes signals and slots.


int MetaObject::methodOffset () const

Returns the first index of method for current class. The offset is the sum of all methods in parent classes.


const char MetaObject::name () const

Returns the name of the object type.


MetaProperty MetaObject::property (int index) const

Returns MetaProperty object by provided index of property.

Note: This method looks through class hierarchy.


int MetaObject::propertyCount () const

Returns the sum of properties for the current class and parent classes.


int MetaObject::propertyOffset () const

Returns the first index of property for current class. The offset is the sum of all properties in parent classes.


const :ref:`MetaObject<api_MetaObject>`* MetaObject::super () const

Returns an introspection object for parent class.