InstantIO::FieldAccessor< ClassType, ValueType > Class Template Reference

Helper class used to access contents of fields. More...

#include <InstantIO/FieldAccessor.h>

Inheritance diagram for InstantIO::FieldAccessor< ClassType, ValueType >:
InstantIO::BasicFieldAccessor

List of all members.

Public Types

typedef void(ClassType::* SetMethod )(const ValueType &)
 Defines the method that sets the field value.
typedef ValueType(ClassType::* GetMethod )() const
 Defines the method that returns the field value.

Public Member Functions

 FieldAccessor (SetMethod setMethod, GetMethod getMethod)
 Creates a new FieldAccessor object.
 FieldAccessor (const FieldAccessor< ClassType, ValueType > &other)
 Creates a new FieldAccessor object that is an exact copy of another FieldAccessor object.
virtual ~FieldAccessor ()
 Destroys the FieldAccessor object.
virtual void set (Node &node, const std::string &value) const
 Sets the value of the field.
virtual std::string get (const Node &node) const
 Returns the value of the field.
virtual bool sameValue (const Node &node, const std::string &value) const
 Checks if a field is set to given value.
virtual BasicFieldAccessorclone () const
 Creates a copy a FieldAccessor object.

Detailed Description

template<class ClassType, class ValueType>
class InstantIO::FieldAccessor< ClassType, ValueType >

Helper class used to access contents of fields.

Author:
Patrick Dähne

Constructor & Destructor Documentation

template<class ClassType, class ValueType>
InstantIO::FieldAccessor< ClassType, ValueType >::FieldAccessor ( SetMethod  setMethod,
GetMethod  getMethod 
) [inline]

Creates a new FieldAccessor object.

Parameters:
setMethod Pointer to the method that sets the field value.
getMethod Pointer to the method that returns the field value.
template<class ClassType, class ValueType>
InstantIO::FieldAccessor< ClassType, ValueType >::FieldAccessor ( const FieldAccessor< ClassType, ValueType > &  other  )  [inline]

Creates a new FieldAccessor object that is an exact copy of another FieldAccessor object.

Parameters:
other The other FieldAccessor object.

Member Function Documentation

template<class ClassType, class ValueType>
virtual void InstantIO::FieldAccessor< ClassType, ValueType >::set ( Node node,
const std::string &  value 
) const [inline, virtual]

Sets the value of the field.

Parameters:
node The Node that contains the field.
value The new value of the field.

Implements InstantIO::BasicFieldAccessor.

template<class ClassType, class ValueType>
virtual std::string InstantIO::FieldAccessor< ClassType, ValueType >::get ( const Node node  )  const [inline, virtual]

Returns the value of the field.

Parameters:
node The Node that contains the field.
Returns:
The value of the field.

Implements InstantIO::BasicFieldAccessor.

template<class ClassType, class ValueType>
virtual bool InstantIO::FieldAccessor< ClassType, ValueType >::sameValue ( const Node node,
const std::string &  value 
) const [inline, virtual]

Checks if a field is set to given value.

Parameters:
node The Node that contains the field.
value The value we compare the field with.
Returns:
true when the field has the given value, false otherwise.

Implements InstantIO::BasicFieldAccessor.

template<class ClassType, class ValueType>
virtual BasicFieldAccessor* InstantIO::FieldAccessor< ClassType, ValueType >::clone (  )  const [inline, virtual]

Creates a copy a FieldAccessor object.

Returns:
The new copy

Implements InstantIO::BasicFieldAccessor.


The documentation for this class was generated from the following file:
Generated on Thu Jul 31 17:17:32 2014 by  doxygen 1.6.3