InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType > Class Template Reference

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

#include <InstantIO/FieldArrayAccessor.h>

Inheritance diagram for InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >:
InstantIO::BasicFieldAccessor

List of all members.

Public Types

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

Public Member Functions

 FieldArrayAccessor (SetMethod setMethod, GetMethod getMethod)
 Creates a new FieldArrayAccessor object.
 FieldArrayAccessor (const FieldArrayAccessor< ClassType, ValueType, ContainerType > &other)
 Creates a new FieldArrayAccessor object that is an exact copy of another FieldArrayAccessor object.
virtual ~FieldArrayAccessor ()
 Destroys the FieldArrayAccessor 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 FieldArrayAccessor object.

Detailed Description

template<class ClassType, class ValueType, class ContainerType = std::vector<ValueType>>
class InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >

Helper class used to access contents of array.

Author:
Patrick Dähne

Constructor & Destructor Documentation

template<class ClassType, class ValueType, class ContainerType = std::vector<ValueType>>
InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::FieldArrayAccessor ( SetMethod  setMethod,
GetMethod  getMethod 
) [inline]

Creates a new FieldArrayAccessor 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, class ContainerType = std::vector<ValueType>>
InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::FieldArrayAccessor ( const FieldArrayAccessor< ClassType, ValueType, ContainerType > &  other  )  [inline]

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

Parameters:
other The other FieldArrayAccessor object.

Member Function Documentation

template<class ClassType, class ValueType, class ContainerType = std::vector<ValueType>>
virtual void InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::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, class ContainerType = std::vector<ValueType>>
virtual std::string InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::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, class ContainerType = std::vector<ValueType>>
virtual bool InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::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, class ContainerType = std::vector<ValueType>>
virtual BasicFieldAccessor* InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >::clone (  )  const [inline, virtual]

Creates a copy a FieldArrayAccessor 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