OMK::AttributeAnimatorFctT< PrmType, ObjectType > Class Template Reference
[Attribute feature]

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

#include <OMKAttributeAnimator.h>

Inheritance diagram for OMK::AttributeAnimatorFctT< PrmType, ObjectType >:

Inheritance graph
[legend]
Collaboration diagram for OMK::AttributeAnimatorFctT< PrmType, ObjectType >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename PrmType, typename ObjectType>
class OMK::AttributeAnimatorFctT< PrmType, ObjectType >

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.
ObjectType The type of the asscociated object which gives the accessor methods.
This class is usefull to create functionality instead of real attribute. The following example shows an attribute which cannot be really be read but which is used as a functoin parameter.
class MyObject : public ExtensibleSimulatedObject
{
protected:
  AttributeAnimatorFctT< int, MyObject > _functor ;
  void theFunction( const int& value )
  {
    // Do something with the value, for example a switch
    switch( value )
    {
      //...
    }
  }
  int _dummyValue ;
  const int& getDummy() const { return _dummyValue ; }
  MyObject( Controller& ctrl, const ObjectDescriptor& objectDescriptor ) 
  : ExtensibleSimulatedObject( ctrl, objectDescriptor ),
  _functor( "theFunctor", this, &MyObject::theFunction, &MyObject::getDummy )
  {
  }
} ;

The value is reached through the methods of the associated object.

The PrmType is cast with SimpleTypeT.

Definition at line 379 of file OMKAttributeAnimator.h.


Constructor & Destructor Documentation

template<typename PrmType, typename ObjectType>
OMK::AttributeAnimatorFctT< PrmType, ObjectType >::AttributeAnimatorFctT ( const Name id,
ObjectType *  object,
typename AccessorFctT< PrmType, ObjectType >::SetMethod  setMethod,
typename AccessorFctT< PrmType, ObjectType >::GetMethod  getMethod 
) [inline]

Constructor.

Parameters:
[in] id See _id.

Definition at line 386 of file OMKAttributeAnimator.h.

00389     : IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, AccessorFctT< PrmType, ObjectType > >
00390     ( id, AccessorAccT< PrmType, ObjectType >( object, setMethod, getMethod ) ) {}

template<typename PrmType, typename ObjectType>
virtual OMK::AttributeAnimatorFctT< PrmType, ObjectType >::~AttributeAnimatorFctT (  )  [inline, virtual]

Destructor.

Definition at line 392 of file OMKAttributeAnimator.h.

00392 {}

template<typename PrmType, typename ObjectType>
OMK::AttributeAnimatorFctT< PrmType, ObjectType >::AttributeAnimatorFctT ( const Name id,
ObjectType *  object,
typename AccessorFctT< PrmType, ObjectType >::SetMethod  setMethod,
typename AccessorFctT< PrmType, ObjectType >::GetMethod  getMethod 
) [inline]

Constructor.

Parameters:
[in] id See _id.

Definition at line 386 of file OMKAttributeAnimator.h.

00389     : IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, AccessorFctT< PrmType, ObjectType > >
00390     ( id, AccessorAccT< PrmType, ObjectType >( object, setMethod, getMethod ) ) {}

template<typename PrmType, typename ObjectType>
virtual OMK::AttributeAnimatorFctT< PrmType, ObjectType >::~AttributeAnimatorFctT (  )  [inline, virtual]

Destructor.

Definition at line 392 of file OMKAttributeAnimator.h.

00392 {}


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007