OMK::AttributeAccT< PrmType, PrmAccType > Class Template Reference
[Attribute feature]

Attribute with indirect access to value for types that are not sons of OMKType. More...

#include <OMKAttribute.h>

Inheritance diagram for OMK::AttributeAccT< PrmType, PrmAccType >:

Inheritance graph
[legend]
Collaboration diagram for OMK::AttributeAccT< PrmType, PrmAccType >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void setAccessor (IAccessorT< PrmAccType > *accessor)
 Set the new accessor.

Detailed Description

template<typename PrmType, typename PrmAccType>
class OMK::AttributeAccT< PrmType, PrmAccType >

Attribute with indirect access to value for types that are not sons of OMKType.

Date:
2007-05-01
Author:
BenoƮt Chanclou
Parameters:
PrmType The type of the attribute.
PrmAccType The type of the asscociated accessor.
This class is usefull to see an attribute with an other type,
class MyObject : public ExtensibleSimulatedObject
{
  ...
  AttributeT< int > myIntegerAttribute ;
  AttributeT< float, int > myIntegerAttributeSeeAsAFloat ;
  MyObject( Controller& ctrl, const ObjectDescriptor& objectDescriptor ) 
  : ExtensibleSimulatedObject( ctrl, objectDescriptor ),
    myIntegerAttribute( "theInteger", 0 ),
    myIntegerAttributeSeeAsFloat( "theFloat", &myIntegerAttribute ) 
  {
    ...
  }
  ...
} ;
or to switch between behavior, see AccessorAccT for more details.

The value is reached through the associated accessor.

The PrmType is cast with SimpleTypeT.

Definition at line 479 of file OMKAttribute.h.


Constructor & Destructor Documentation

template<typename PrmType, typename PrmAccType>
OMK::AttributeAccT< PrmType, PrmAccType >::AttributeAccT ( const Name id,
IAccessorT< PrmAccType > *  accessor 
) [inline]

Constructor.

Parameters:
[in] id See _id.

Definition at line 486 of file OMKAttribute.h.

00487     : IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, AccessorAccT< PrmType,  PrmAccType > >( id, AccessorAccT< PrmType,  PrmAccType >( accessor ) ) {}

template<typename PrmType, typename PrmAccType>
virtual OMK::AttributeAccT< PrmType, PrmAccType >::~AttributeAccT (  )  [inline, virtual]

Destructor.

Definition at line 489 of file OMKAttribute.h.

00489 {}

template<typename PrmType, typename PrmAccType>
OMK::AttributeAccT< PrmType, PrmAccType >::AttributeAccT ( const Name id,
IAccessorT< PrmAccType > *  accessor 
) [inline]

Constructor.

Parameters:
[in] id See _id.

Definition at line 486 of file OMKAttribute.h.

00487     : IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, AccessorAccT< PrmType,  PrmAccType > >( id, AccessorAccT< PrmType,  PrmAccType >( accessor ) ) {}

template<typename PrmType, typename PrmAccType>
virtual OMK::AttributeAccT< PrmType, PrmAccType >::~AttributeAccT (  )  [inline, virtual]

Destructor.

Definition at line 489 of file OMKAttribute.h.

00489 {}


Member Function Documentation

template<typename PrmType, typename PrmAccType>
void OMK::AttributeAccT< PrmType, PrmAccType >::setAccessor ( IAccessorT< PrmAccType > *  accessor  )  [inline]

Set the new accessor.

Parameters:
[in] accessor The new accessor to the value.
Use this method to change the current accessor. See example in the class description.

see AccessorAccT for example.

Definition at line 498 of file OMKAttribute.h.

00499   {
00500     this->_accessor.setAccessor( accessor ) ;
00501   }


logo OpenMask

Documentation generated on Mon Jun 9 11:46:01 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007