Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Friends | List of all members
ComponentSchema Class Reference

This class defines a component schema which defines how a component is described. More...

Inheritance diagram for ComponentSchema:
CoreBaseObject CoreBaseType

Public Types

enum  { INVALID_INDEX = 0xFFFFFFFF }
 

Public Member Functions

const unsigned int & get_id () const
 Return the id of the schema.
 
const CoreStringget_name () const
 Return the name of the schema.
 
const CoreStringget_doc () const
 Return the documentation/description of the schema.
 
const ComponentInterfaceget_interface () const
 Return the interface of the schema.
 
unsigned int find_child (const CoreString &name, const unsigned int &idx=0) const
 Return the index of the first sub-schema matching the specified name.
 
const ComponentSchemaget_child (const CoreString &name) const
 Return the sub-schema with the specified name.
 
ComponentSchemaget_child (const CoreString &name)
 Return the sub-schema with the specified name.
 
const ComponentSchemaget_child (const unsigned int &idx) const
 Return the sub-schema at the specified index.
 
ComponentSchemaget_child (const unsigned int &idx)
 Return the sub-schema at the specified index.
 
const unsigned int & get_child_count (const unsigned int &idx)
 Return the direct number of sub-schema.
 
const ComponentSchemaget_parent () const
 Return the parent of the schema.
 
bool has_child () const
 Return true if the schema has at least a child (sub-schema).
 
bool has_parent () const
 Return false if the schema has no parent.
 
bool is_root () const
 Return true if the schema is root (has no parent).
 
ComponentSchemaadd_schema (const ComponentInterface &iface, const CoreString &name, const CoreString &doc="")
 Add a new sub-schema.
 
bool set_implementation (const CoreClassInfo &class_info, ComponentImplementation *impl)
 Set the implementation for a specific class to the interface of this schema.
 
ComponentProxy get_proxy (CoreBaseObject &instance) const
 Get the implementation for a specific class to this schema.
 
ComponentProxy get_proxy (CoreBaseObject &instance, const CoreClassInfo &class_info) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Friends

class ComponentFactory
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 

Detailed Description

This class defines a component schema which defines how a component is described.

Member Function Documentation

ComponentSchema* ComponentSchema::add_schema ( const ComponentInterface iface,
const CoreString name,
const CoreString doc = "" 
)
inline

Add a new sub-schema.

Returns
The newly created sub-schema.
unsigned int ComponentSchema::find_child ( const CoreString name,
const unsigned int &  idx = 0 
) const

Return the index of the first sub-schema matching the specified name.

Parameters
[in]namevalid name of the sub-schema.
[in]idxstarting index (useful when you want to iterate over sub-schemas sharing the same name).
Returns
The requested sub-schema index or INVALID_INDEX (-1) if not found.
const ComponentSchema& ComponentSchema::get_child ( const CoreString name) const
inline

Return the sub-schema with the specified name.

Parameters
[in]nameexisting name of a sub-schema.
Returns
The requested sub-schema.
ComponentSchema* ComponentSchema::get_child ( const CoreString name)
inline

Return the sub-schema with the specified name.

Parameters
[in]nameexisting name of a sub-schema.
Returns
The requested sub-schema.
const ComponentSchema* ComponentSchema::get_child ( const unsigned int &  idx) const
inline

Return the sub-schema at the specified index.

Parameters
[in]idxvalid index of the sub-schema.
Returns
The requested sub-schema.
ComponentSchema* ComponentSchema::get_child ( const unsigned int &  idx)
inline

Return the sub-schema at the specified index.

Parameters
[in]idxvalid index of the sub-schema.
Returns
The requested sub-schema.
const ComponentSchema* ComponentSchema::get_parent ( ) const
inline

Return the parent of the schema.

Returns
The parent or null if the schema is root.
ComponentProxy ComponentSchema::get_proxy ( CoreBaseObject instance) const

Get the implementation for a specific class to this schema.

Parameters
[in]instanceinstance of a class for which an implementation of the schema is defined.
Returns
The implementation if successful, null otherwise.
The implementation proxy if successful, null otherwise. Check ComponentProxy::get_implementation to check if the implementation exists.
bool ComponentSchema::set_implementation ( const CoreClassInfo class_info,
ComponentImplementation impl 
)

Set the implementation for a specific class to the interface of this schema.

Parameters
[in]class_infoCoreClassInfo for which the implementation of the schema will be defined.
[in]implPointer to a new instance providing an implementation to the interface for the specific class to get data in and out.
Returns
true if successful. If the method returns false then an implementation have been already defined for the specified class_info.