Graphite  Version 3
An experimental 3D geometry processing program
OGF::Meta Class Reference

Stores all the meta information of the system, used by the reflection API. More...

#include <OGF/gom/reflection/meta.h>

Public Member Functions

 ~Meta ()
 destructor fo the Meta database.
 
bool meta_type_is_bound (const std::string &name) const
 Tests whether a MetaType exists in the system by type name. More...
 
bool typeid_name_is_bound (const std::string &typeid_name) const
 Tests whether a MetaType exists in the system by typeid name. More...
 
bool bind_meta_type (MetaType *meta_type)
 Declares a MetaType to the system. More...
 
bool bind_meta_type (MetaType *meta_type, const std::string &typeid_name)
 Declares a MetaType to the system. More...
 
MetaTyperesolve_meta_type (const std::string &type_name) const
 Finds a MetaType by type name. More...
 
MetaClassresolve_meta_class (const std::string &type_name) const
 Finds a MetaClass by type name. More...
 
MetaTyperesolve_meta_type_by_typeid_name (const std::string &typeid_name) const
 Finds a MetaType by typeid name. More...
 
bool unbind_meta_type (const std::string &name)
 Removes a MetaType from the system. More...
 
void list_types (std::vector< MetaType * > &types)
 Gets the list of all MetaType objects declared to the system. More...
 
void list_type_names (std::vector< std::string > &type_names)
 Gets the list of all type names declared to the system. More...
 

Static Public Member Functions

static Metainstance ()
 Gets the instance. More...
 
static void initialize ()
 Initializes the Meta database. More...
 
static void terminate ()
 Terminates the Meta database. More...
 

Detailed Description

Stores all the meta information of the system, used by the reflection API.

The meta information associates to each C++ type a MetaType object, that implements different services, such as serialization, introspection and dynamic method invokation, used to couple Graphite with interpreted languages (python) and to generate the GUI. The meta information is automatically generated by the GOMGEN tool. The meta information can be accessed either from a string with the type name (as written in C++ sources, and scoped with OGF::), or with the typeid name (as obtained with typeid<T>.name).

Definition at line 73 of file meta.h.

Member Function Documentation

◆ bind_meta_type() [1/2]

bool OGF::Meta::bind_meta_type ( MetaType meta_type)

Declares a MetaType to the system.

Parameters
[in]meta_typea pointer to the MetaType. Ownership is transfered to Meta.

◆ bind_meta_type() [2/2]

bool OGF::Meta::bind_meta_type ( MetaType meta_type,
const std::string &  typeid_name 
)

Declares a MetaType to the system.

Parameters
[in]meta_typea pointer to the MetaType. Ownership is transfered to Meta.
[in]typeid_namethe C++ RTTI name of the system, as obtained by typeid<T>.name()

◆ initialize()

static void OGF::Meta::initialize ( )
static

Initializes the Meta database.

Note
Does not need to be called by client code, called at Graphite initialization.

◆ instance()

static Meta* OGF::Meta::instance ( )
static

Gets the instance.

Returns
a pointer to the instance of the Meta database.

◆ list_type_names()

void OGF::Meta::list_type_names ( std::vector< std::string > &  type_names)

Gets the list of all type names declared to the system.

Parameters
[out]type_namesa vector of all type names, including aliases.

◆ list_types()

void OGF::Meta::list_types ( std::vector< MetaType * > &  types)

Gets the list of all MetaType objects declared to the system.

Parameters
[out]typesa vector of pointers to all the MetaType objects

◆ meta_type_is_bound()

bool OGF::Meta::meta_type_is_bound ( const std::string &  name) const

Tests whether a MetaType exists in the system by type name.

Parameters
[in]nametype name
Return values
trueif a type with name name exists in the system
falseotherwise

◆ resolve_meta_class()

MetaClass* OGF::Meta::resolve_meta_class ( const std::string &  type_name) const
inline

Finds a MetaClass by type name.

Parameters
[in]type_nametype name
Returns
the MetaClass associated with type_name if it exists or nullptr otherwise

Definition at line 139 of file meta.h.

◆ resolve_meta_type()

MetaType* OGF::Meta::resolve_meta_type ( const std::string &  type_name) const

Finds a MetaType by type name.

Parameters
[in]type_nametype name
Returns
the MetaType associated with type_name if it exists or nullptr otherwise

◆ resolve_meta_type_by_typeid_name()

MetaType* OGF::Meta::resolve_meta_type_by_typeid_name ( const std::string &  typeid_name) const

Finds a MetaType by typeid name.

Parameters
[in]typeid_namethe C++ RTTI name of the system, as obtained by typeid<T>.name()
Returns
the MetaType associated with type_name if it exists or nullptr otherwise

◆ terminate()

static void OGF::Meta::terminate ( )
static

Terminates the Meta database.

Note
Does not need to be called by client code, called at Graphite termination.

◆ typeid_name_is_bound()

bool OGF::Meta::typeid_name_is_bound ( const std::string &  typeid_name) const

Tests whether a MetaType exists in the system by typeid name.

Parameters
[in]typeid_namethe C++ RTTI name of the system, as obtained by typeid<T>.name()
Return values
trueif a type with name name exists in the system
falseotherwise

◆ unbind_meta_type()

bool OGF::Meta::unbind_meta_type ( const std::string &  name)

Removes a MetaType from the system.

Parameters
[in]nametype name
Return values
trueif the meta type could be sucessfully removed
falseotherwise

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