OMK::AccessorFctT< T, ObjectT > Class Template Reference
[Attribute feature]

The implementation class for accessor through accessors method of an associated object. More...

#include <OMKIAccessor.h>

Inheritance diagram for OMK::AccessorFctT< T, ObjectT >:

Inheritance graph
[legend]
Collaboration diagram for OMK::AccessorFctT< T, ObjectT >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef const T &(ObjectT::*) GetMethod () const
 Method prototype to get a value.
typedef void(ObjectT::*) SetMethod (const T &value)
 Method prototype to set a value.

Public Member Functions

 AccessorFctT (ObjectT *object, SetMethod setMethod, GetMethod getMethod)
 Constructor.
virtual ~AccessorFctT ()
 Destructor.
virtual const T & get () const
 Get the value.
virtual void set (const T &value)
 Set the value.

Protected Attributes

ObjectT * _object
 The associated object, which is the owner of the accessor methods.
SetMethod _setMethod
 The set accessor to the value.
GetMethod _getMethod
 The get accessor to the value.

Detailed Description

template<typename T, typename ObjectT>
class OMK::AccessorFctT< T, ObjectT >

The implementation class for accessor through accessors method of an associated object.

Date:
2007-01-19
Author:
Benoît Chanclou
This class defines a class which accesses to a value through accessor methods of an associated object.

This accessor class is a template one, the parameters are:

Definition at line 119 of file OMKIAccessor.h.


Member Typedef Documentation

template<typename T, typename ObjectT>
typedef const T&(ObjectT::*) OMK::AccessorFctT< T, ObjectT >::GetMethod() const

Method prototype to get a value.

The call back is a member method of the simulated object, which is the owner of the accessor methods.

Definition at line 130 of file OMKIAccessor.h.

template<typename T, typename ObjectT>
typedef void(ObjectT::*) OMK::AccessorFctT< T, ObjectT >::SetMethod(const T &value)

Method prototype to set a value.

The call back is a member method of the associated object, which is the owner of the accessor methods.

Definition at line 139 of file OMKIAccessor.h.


Constructor & Destructor Documentation

template<typename T, typename ObjectT>
OMK::AccessorFctT< T, ObjectT >::AccessorFctT ( ObjectT *  object,
SetMethod  setMethod,
GetMethod  getMethod 
) [inline]

Constructor.

Stores the pointers on the object to get and set the value.

Definition at line 142 of file OMKIAccessor.h.

00143     : _object( object ), _setMethod( setMethod ), _getMethod( getMethod ) {}

template<typename T, typename ObjectT>
virtual OMK::AccessorFctT< T, ObjectT >::~AccessorFctT (  )  [inline, virtual]

Destructor.

Definition at line 145 of file OMKIAccessor.h.

00145 {}


Member Function Documentation

template<typename T, typename ObjectT>
virtual const T& OMK::AccessorFctT< T, ObjectT >::get (  )  const [inline, virtual]

Get the value.

Returns:
The current value.

Implements OMK::IAccessorT< T >.

Definition at line 149 of file OMKIAccessor.h.

00149 { return (_object->*_getMethod)() ; }

template<typename T, typename ObjectT>
virtual void OMK::AccessorFctT< T, ObjectT >::set ( const T &  value  )  [inline, virtual]

Set the value.

Parameters:
[in] value The new value of the value.

Implements OMK::IAccessorT< T >.

Definition at line 152 of file OMKIAccessor.h.

00152 { (_object->*_setMethod)( value ) ; }


Member Data Documentation

template<typename T, typename ObjectT>
ObjectT* OMK::AccessorFctT< T, ObjectT >::_object [protected]

The associated object, which is the owner of the accessor methods.

Definition at line 155 of file OMKIAccessor.h.

Referenced by OMK::AccessorFctT< PrmType, ObjectType >::get(), and OMK::AccessorFctT< PrmType, ObjectType >::set().

template<typename T, typename ObjectT>
SetMethod OMK::AccessorFctT< T, ObjectT >::_setMethod [protected]

The set accessor to the value.

Definition at line 157 of file OMKIAccessor.h.

Referenced by OMK::AccessorFctT< PrmType, ObjectType >::set().

template<typename T, typename ObjectT>
GetMethod OMK::AccessorFctT< T, ObjectT >::_getMethod [protected]

The get accessor to the value.

Definition at line 159 of file OMKIAccessor.h.

Referenced by OMK::AccessorFctT< PrmType, ObjectType >::get().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007