InstantIO::BasicFieldAccessor Class Reference

Abstract base class of all FieldAccessor templates. More...

#include <InstantIO/BasicFieldAccessor.h>

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

List of all members.

Public Member Functions

virtual ~BasicFieldAccessor ()
 Destroys the BasicFieldAccessor object.
virtual void set (Node &node, const std::string &value) const =0
 Sets the value of the field.
virtual std::string get (const Node &node) const =0
 Returns the value of the field.
virtual bool sameValue (const Node &node, const std::string &value) const =0
 Checks if a field is set to given value.
virtual BasicFieldAccessorclone () const =0
 Creates a copy a FieldAccessor object.

Protected Member Functions

 BasicFieldAccessor ()
 Creates a new BasicFieldAccessor object.
 BasicFieldAccessor (const BasicFieldAccessor &other)
 Creates a new BasicFieldAccessor object that is an exact copy of another BasicFieldAccessor object.

Static Protected Member Functions

template<class T >
static const std::string value2String (const T &value)
 Converts a value to a string.
template<class C >
static const std::string valueContainer2String (const C &value)
 Converts a value Container to a string.
static const std::string & value2String (bool value)
 Converts a boolean value to a string.
static const std::string value2String (const std::string &value)
 Converts a string value to a string.
template<class T >
static void string2Value (const std::string &strValue, T &value)
 Converts a string to a value.
template<class T , class C >
static void string2ValueContainer (const std::string &strValue, C &value)
 Converts a string Container to a value array.
static void string2Value (const std::string &strValue, bool &value)
 Converts a string to a boolean value.
static void string2Value (const std::string &strValue, std::string &value)
 Converts a string to a string value.

Detailed Description

Abstract base class of all FieldAccessor templates.

Author:
Patrick Dähne

Constructor & Destructor Documentation

InstantIO::BasicFieldAccessor::BasicFieldAccessor ( const BasicFieldAccessor other  )  [inline, protected]

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

Parameters:
other The other BasicFieldAccessor object.

Member Function Documentation

virtual void InstantIO::BasicFieldAccessor::set ( Node node,
const std::string &  value 
) const [pure virtual]

Sets the value of the field.

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

Implemented in InstantIO::FieldAccessor< ClassType, ValueType >, and InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >.

virtual std::string InstantIO::BasicFieldAccessor::get ( const Node node  )  const [pure virtual]

Returns the value of the field.

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

Implemented in InstantIO::FieldAccessor< ClassType, ValueType >, and InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >.

virtual bool InstantIO::BasicFieldAccessor::sameValue ( const Node node,
const std::string &  value 
) const [pure 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.

Implemented in InstantIO::FieldAccessor< ClassType, ValueType >, and InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >.

virtual BasicFieldAccessor* InstantIO::BasicFieldAccessor::clone (  )  const [pure virtual]
template<class T >
static const std::string InstantIO::BasicFieldAccessor::value2String ( const T &  value  )  [inline, static, protected]

Converts a value to a string.

Parameters:
value The value.
Returns:
The resulting string.
template<class C >
static const std::string InstantIO::BasicFieldAccessor::valueContainer2String ( const C &  value  )  [inline, static, protected]

Converts a value Container to a string.

Parameters:
value The value.
Returns:
The resulting string.
static const std::string& InstantIO::BasicFieldAccessor::value2String ( bool  value  )  [static, protected]

Converts a boolean value to a string.

Parameters:
value The boolean value.
Returns:
The resulting string.
static const std::string InstantIO::BasicFieldAccessor::value2String ( const std::string &  value  )  [inline, static, protected]

Converts a string value to a string.

Parameters:
value The string value.
Returns:
The resulting string.
template<class T >
static void InstantIO::BasicFieldAccessor::string2Value ( const std::string &  strValue,
T &  value 
) [inline, static, protected]

Converts a string to a value.

When the the conversion fails, a default value gets returned.

Parameters:
strValue The string.
value Gets filled with the converted value.
template<class T , class C >
static void InstantIO::BasicFieldAccessor::string2ValueContainer ( const std::string &  strValue,
C &  value 
) [inline, static, protected]

Converts a string Container to a value array.

When the the conversion fails, a default value gets returned.

Parameters:
strValue The string.
value Gets filled with the converted value.
static void InstantIO::BasicFieldAccessor::string2Value ( const std::string &  strValue,
bool &  value 
) [static, protected]

Converts a string to a boolean value.

When the the conversion fails, a default value gets returned.

Parameters:
strValue The string.
value Gets filled with the converted boolean value.
static void InstantIO::BasicFieldAccessor::string2Value ( const std::string &  strValue,
std::string &  value 
) [inline, static, protected]

Converts a string to a string value.

Parameters:
strValue The string.
value Gets filled with the string value.

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