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

This class defines a proxy to a generic implementation for an interface. More...

Inheritance diagram for ComponentProxy:
CoreBaseObject CoreBaseType

Public Member Functions

 ComponentProxy (CoreBaseObject *instance, const ComponentImplementation *impl, ComponentFactoryHandler *handler)
 
unsigned int find_property (const CoreString &name, const unsigned int &idx=0) const
 Return the index of the property.
 
const ComponentInterfaceget_interface () const
 Return the interface this class implements.
 
const ComponentSchemaget_schema () const
 Return the schema this class implements.
 
bool set_components (const CoreBasicArray< unsigned int > &indices, const ComponentCollection &components) const
 Method used to set the components of the callee.
 
bool set_components (const ComponentCollection &components)
 Set all components with the specified ones.
 
bool set_component (const unsigned int &component_idx, const ComponentCollection &component)
 Set the component at the specified index.
 
bool get_components (const CoreBasicArray< unsigned int > &indices, ComponentCollection &components) const
 Method used to retrieve internal data of the callee organized in a ComponentCollection.
 
bool get_components (ComponentCollection &components, Monitorable &monitorable) const
 Retrieve all components and register a monitor to notify user from dirtiness.
 
bool get_components (ComponentCollection &components) const
 Retrieve all components.
 
bool get_component (const unsigned int &component_idx, ComponentCollection &component) const
 Retrieve the specified component.
 
unsigned int get_component_count () const
 Return the number of component available for the specified interface/schema.
 
const ComponentImplementationget_implementation () const
 Return the ComponentImplementation.
 
CoreBaseObjectget_instance ()
 Return a pointer to the instance.
 
const CoreBaseObjectget_instance () const
 
bool is_null () const
 Return true if the implementation is null.
 
- 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 ComponentFactoryHandler
 

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 proxy to a generic implementation for an interface.

Note
This class is a fail safe proxy to ComponentImplementation.

Member Function Documentation

unsigned int ComponentProxy::find_property ( const CoreString name,
const unsigned int &  idx = 0 
) const
inline

Return the index of the property.

Parameters
[in]namename of the property
[in]idxstarting index (useful if you need to iterate over properties sharing the same name).
Returns
The index of the property if found, otherwise return -1 (0xFFFFFFFF).
bool ComponentProxy::get_component ( const unsigned int &  component_idx,
ComponentCollection component 
) const
inline

Retrieve the specified component.

Parameters
[in]component_idxindex of the component (indices must be valid [0, get_component_count()]).
[out]componentcomponent collection that will be properly filled with the required component.
Returns
false if it is not implemented or if an error has occurred.
bool ComponentProxy::get_components ( const CoreBasicArray< unsigned int > &  indices,
ComponentCollection components 
) const
inline

Method used to retrieve internal data of the callee organized in a ComponentCollection.

Parameters
[in]indicesindices of requested components (indices must be valid [0, get_component_count()]).
[out]componentscomponents that will be properly filled.
Returns
false if it is not implemented or if an error has occurred.
bool ComponentProxy::get_components ( ComponentCollection components,
Monitorable monitorable 
) const
inline

Retrieve all components and register a monitor to notify user from dirtiness.

Parameters
[out]componentscomponents that will be properly filled.
[in]componentsmonitor object.
Returns
false if it is not implemented or if an error has occurred.
bool ComponentProxy::get_components ( ComponentCollection components) const
inline

Retrieve all components.

Parameters
[out]componentscomponents that will be properly filled.
Returns
false if it is not implemented or if an error has occurred.
const ComponentImplementation* ComponentProxy::get_implementation ( ) const
inline

Return the ComponentImplementation.

Note
This can be useful if you want to bypass fail safe check overhead.
const ComponentInterface* ComponentProxy::get_interface ( ) const
inline

Return the interface this class implements.

Note
Make sure to never share the pointer to another interface/schema.
Returns
the interface it implements. Return null if the implementation is not bound to any schema or interface
const ComponentSchema* ComponentProxy::get_schema ( ) const
inline

Return the schema this class implements.

Note
Make sure to never share the pointer to another interface/schema.
Returns
the schema it implements. Return null if the implementation is not bound to any schema or interface
bool ComponentProxy::set_component ( const unsigned int &  component_idx,
const ComponentCollection component 
)
inline

Set the component at the specified index.

Parameters
[in]component_idxindex of the component (indices must be valid [0, get_component_count()]).
[in]componentcomponent that will be copied.
Returns
false if it is not implemented or if an error has occurred.
bool ComponentProxy::set_components ( const CoreBasicArray< unsigned int > &  indices,
const ComponentCollection components 
) const
inline

Method used to set the components of the callee.

Parameters
[in]indicescomponent indices that are modified (indices must be valid [0, get_component_count()]).
[in]componentscomponents that will be copied.
Returns
false if it is not implemented or if an error has occurred.
bool ComponentProxy::set_components ( const ComponentCollection components)
inline

Set all components with the specified ones.

Parameters
[in]componentscomponents that will be copied
Returns
false if it is not implemented or if an error has occurred.