Clarisse 4.0 SP9 SDK  4.0.0.0.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Friends | List of all members
ComponentImplementation Class Referenceabstract

This class defines an generic implementation for a generic interface (with or without schema). More...

Inheritance diagram for ComponentImplementation:
CoreBaseObject CoreBaseType ComponentDebugImplementation

Public Member Functions

 ComponentImplementation (ComponentFactory *factory=0)
 
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.
 
virtual bool get_components (const CoreBaseObject &instance, const CoreBasicArray< unsigned int > &indices, ComponentCollection &components) const =0
 Method used to retrieve internal data of the callee organized in a ComponentCollection.
 
virtual bool set_components (CoreBaseObject &instance, const CoreBasicArray< unsigned int > &indices, const ComponentCollection &components) const
 Method used to set internal data of the callee.
 
virtual unsigned int get_component_count (const CoreBaseObject &instance) const
 Return the number of component available for the specified interface/schema.
 
virtual bool get_modified_components (const CoreBaseObject &instance, CoreVector< unsigned int > &modified_component_indices) const
 Return an array of the components that have been modified.
 
- 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 an generic implementation for a generic interface (with or without schema).

Note
The implementation destruction is handled by the ComponentFactory and ComponentInterface. Do not use the same implementation pointer for multiple interfaces or schemas.

Member Function Documentation

unsigned int ComponentImplementation::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).
virtual unsigned int ComponentImplementation::get_component_count ( const CoreBaseObject instance) const
inlinevirtual

Return the number of component available for the specified interface/schema.

Parameters
[in]instanceinstance to the object so it can access to its internal data

Reimplemented in ComponentDebugImplementation.

virtual bool ComponentImplementation::get_components ( const CoreBaseObject instance,
const CoreBasicArray< unsigned int > &  indices,
ComponentCollection components 
) const
pure virtual

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

Parameters
[in]instanceinstance to the object so it can access to its internal data
[in]indicesindices of requested components. Indices are assumed valid.
[out]componentscomponents that will be properly filled. Components are assumed to match the requested size.
Returns
false is not implemented

Implemented in ComponentDebugImplementation.

const ComponentInterface* ComponentImplementation::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
virtual bool ComponentImplementation::get_modified_components ( const CoreBaseObject instance,
CoreVector< unsigned int > &  modified_component_indices 
) const
inlinevirtual

Return an array of the components that have been modified.

Parameters
[in]instanceinstance to the object so it can access to its internal data
[out]modified_component_indicesindices of components that have been modified
Note
This optionnal method is useful in order to automatically serialize modified components (to be reset after deserialization)
Returns
false if not implemented.
const ComponentSchema* ComponentImplementation::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
virtual bool ComponentImplementation::set_components ( CoreBaseObject instance,
const CoreBasicArray< unsigned int > &  indices,
const ComponentCollection components 
) const
inlinevirtual

Method used to set internal data of the callee.

Parameters
[in]instanceinstance to the object so it can access to its internal data
[in]indicescomponent indices that are modified. Indices are assumed valid.
[in]componentscomponents that have been modified. Components are assumed to match input indices size.
Returns
false is not implemented

Reimplemented in ComponentDebugImplementation.