Abstract base class of all FieldAccessor templates. More...
#include <InstantIO/BasicFieldAccessor.h>
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 BasicFieldAccessor * | clone () 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. |
Abstract base class of all FieldAccessor templates.
InstantIO::BasicFieldAccessor::BasicFieldAccessor | ( | const BasicFieldAccessor & | other | ) | [inline, protected] |
Creates a new BasicFieldAccessor object that is an exact copy of another BasicFieldAccessor object.
other | The other BasicFieldAccessor object. |
virtual void InstantIO::BasicFieldAccessor::set | ( | Node & | node, | |
const std::string & | value | |||
) | const [pure virtual] |
Sets the value of the field.
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.
node | The Node that contains 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.
node | The Node that contains the field. | |
value | The value we compare the field with. |
Implemented in InstantIO::FieldAccessor< ClassType, ValueType >, and InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >.
virtual BasicFieldAccessor* InstantIO::BasicFieldAccessor::clone | ( | ) | const [pure virtual] |
Creates a copy a FieldAccessor object.
Implemented in InstantIO::FieldAccessor< ClassType, ValueType >, and InstantIO::FieldArrayAccessor< ClassType, ValueType, ContainerType >.
static const std::string InstantIO::BasicFieldAccessor::value2String | ( | const T & | value | ) | [inline, static, protected] |
Converts a value to a string.
value | The value. |
static const std::string InstantIO::BasicFieldAccessor::valueContainer2String | ( | const C & | value | ) | [inline, static, protected] |
Converts a value Container to a string.
value | The value. |
static const std::string& InstantIO::BasicFieldAccessor::value2String | ( | bool | value | ) | [static, protected] |
Converts a boolean value to a string.
value | The boolean value. |
static const std::string InstantIO::BasicFieldAccessor::value2String | ( | const std::string & | value | ) | [inline, static, protected] |
Converts a string value to a string.
value | The string value. |
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.
strValue | The string. | |
value | Gets filled with the converted value. |
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.
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.
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.
strValue | The string. | |
value | Gets filled with the string value. |