Collaboration diagram for Attribute feature:
Classes | |
class | OMK::IAttributeBaseT< PrmType > |
Attribute interface. More... | |
class | OMK::IAttributeT< PrmType, ModelType, AccessorType > |
Attribute interface. More... | |
class | OMK::AttributeT< PrmType > |
Attribute with encapsulated value for types that are not sons of OMKType. More... | |
class | OMK::AttributeTypeT< PrmType > |
Attribute with encapsulated value for types that are sons of OMKType. More... | |
class | OMK::AttributeAccT< PrmType, PrmAccType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::AttributeAccTypeT< PrmType, PrmAccType > |
Attribute with indirect access to value for types that are sons of OMKType. More... | |
class | OMK::AttributeFctT< PrmType, ObjectType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::AttributeFctTypeT< PrmType, ObjectType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::IAccessorT< T > |
The interface class for accessor to a simple value. More... | |
class | OMK::AccessorT< T > |
The implementation class for accessor to encapsuled value. More... | |
class | OMK::AccessorFctT< T, ObjectT > |
The implementation class for accessor through accessors method of an associated object. More... | |
class | OMK::AccessorAccT< T, T2 > |
The implementation class for accessor through accessors method of an associated object. More... | |
class | OMK::IAttribute |
Attribute interface. More... | |
class | OMK::ExtensibleSimulatedObject |
Ancestor of every extensible objects. More... | |
class | OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType > |
Attribute for animator interface. More... | |
class | OMK::AttributeAnimatorT< PrmType > |
Attribute with encapsulated value for types that are not sons of OMKType. More... | |
class | OMK::AttributeAnimatorTypeT< PrmType > |
Attribute with encapsulated value for types that are sons of OMKType. More... | |
class | OMK::AttributeAnimatorAccT< PrmType, PrmAccType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::AttributeAnimatorAccTypeT< PrmType, PrmAccType > |
Attribute with indirect access to value for types that are sons of OMKType. More... | |
class | OMK::AttributeAnimatorFctT< PrmType, ObjectType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::AttributeAnimatorFctTypeT< PrmType, ObjectType > |
Attribute with indirect access to value for types that are not sons of OMKType. More... | |
class | OMK::Iii::IConvertorT< TypeOut, TypeIn > |
The interface class for convertor. More... |
An attribute is defined by:
Accessors
Class name | Access | PrmType must be a son of PsType | Notes | ||
---|---|---|---|---|---|
to a value AccessorT | by accessor AccessorAccT | by methods AccessorFctT | |||
AttributeT | no | (1) | |||
AttributeTypeT | yes | ||||
AttributeAccT | no | (2) | |||
AttributeAccTypeT | yes | ||||
AttributeFctT | no | (3) | |||
AttributeFctTypeT | yes |
Class name | IAttributeT arguments | Template parameters | |
---|---|---|---|
AttributeT | PrmType | PrmType : type of the attribute | |
ModelType | SimpleTypeT< PrmType > | ||
AccessorType | AccessorT< PrmType > | ||
AttributeTypeT | PrmType | ||
ModelType | PrmType | ||
AccessorType | AccessorT< PrmType > | ||
AttributeAccT | PrmType | PrmType : type of the attribute PrmAccType : type of the associated attribute | |
ModelType | SimpleTypeT< PrmType > | ||
AccessorType | AccessorAccT< PrmType, PrmAccType > | ||
AttributeAccTypeT | PrmType | ||
ModelType | PrmType | ||
AccessorType | AccessorAccT< PrmType, PrmAccType > | ||
AttributeFctT | PrmType | PrmType : type of the attribute ObjectType : type of the associated object of which one uses the methods | |
ModelType | SimpleTypeT< PrmType > | ||
AccessorType | AccessorFctT< PrmType, ObjectType > | ||
AttributeFctTypeT | PrmType | ||
ModelType | PrmType | ||
AccessorType | AccessorFctT< PrmType, ObjectType > |
Class name | Access to the value | Constructor arguments |
---|---|---|
AttributeT | directly to the encapsulated value (AccessorT) | id : PsName value : PrmType |
AttributeTypeT | ||
AttributeAccT | through an other accessor (AccessorAccT) | id : PsName accessor : IAccessorT< PrmAccType >* |
AttributeAccTypeT | ||
AttributeFctT | by methods of an object (AccessorFctT) | id : PsName object : ObjectType* setMethod : AccessorFctT< PrmType >::SetMethod getMethod : AccessorFctT< PrmType >::GetMethod |
AttributeFctTypeT |
The extensible object manages its attributes in a map which is indexed by the attributes id. The object offers the following methods to manage the attribute :
AttributeT< Type >
instead of Type
. class MyObject : public ExtensibleSimulatedObject { protected: AttributeT< int > _myParam ; ...
MyObject::MyObject( PsController& ctrl, const PsObjectDescriptor& objectDescriptor ) : ExtensibleSimulatedObject( ctrl, objectDescriptor ), _myParam( "theIdOfTheParam", 0 ) // Initialise to 0 { addAttribute( _myParam ) ; // To add an input _myParam.creatInput() ; // To add an output _myParam.creatOutput() ; }
After you can use all the features which come with this attribute.
Be carefull the output, must be created in the object constructor or in its postConstruction method.
In this example the extension declares an attribute and an accessor to an attribute.
class MyExtension: public OMK::ExtensionT< ExtensibleSimulatedObject > { DECLARE_EXTENSION_FACTORY( MyExtension ) ; // The attribute AttributeT< int > _myParam ; // The accessor IAccessorT< int >* _attributeAccessor ; };
MyExtension::MyExtension( ExtensibleSimulatedObject* owner, const PsName& id ) : OMK::ExtensionT< ExtensibleSimulatedObject >( owner, id ), _myParam( id, 0 ), _attributeAccessor( 0 ) { // add the attribute to the object _owner->addAttribute( _offset ) ; }
bool MyExtension::loadExtensionParameters( const PsConfigurationParameterDescriptor * node ) { bool ok = true ; // Attribute to offset PsName attributeName ; ok = ok && PsParametersAccessor::get( node, "Attribute", attributeName, _owner ) ; if( ok ) { _attributeAccessor = _owner->getBaseAttribute< int >( attributeName ) ; ok = _attributeAccessor != 0 ; } return ok ; }
Only the extensions dynamically created or created in the object constructor or in its postConstruction method can create attributes with an associated output in their own constructor.
Documentation generated on Mon Jun 9 11:45:59 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |