Robot Simulator of the Robotics Group for Self-Organization of Control: TemplateValue Class Template Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# TemplateValue Class Template Reference

template class for a IValue standard data type needs the data type and a methode for string converting as template argument More...

`#include <TemplateValue.h>`

Inherits IValue.

Inheritance diagram for TemplateValue:

[legend]
Collaboration diagram for TemplateValue:

[legend]
List of all members.

## Public Member Functions
| TemplateValue (Typ value, std::string name="templateValue")
| constructor needs the value and a name (for IValue -> is default implemented as "templateValue")
virtual | ~TemplateValue ()
| default destructor
Typ | getValue (void) const
| this function can be used to read the standard data type.
void | setValue (Typ value)
| this function is to change the value.
virtual IValue * | operator * (const IValue &value) const
| the implementation of the mul operator, what is part of the interface.
virtual IValue * | operator+ (const IValue &value) const
| the implementation of the add operator what is part of the interface.
virtual | operator std::string (void) const
| cast operatot to string use the convert methode.
virtual bool | store (FILE *f) const
| store the value in a file
virtual bool | restore (FILE *f)
| restore the value from a file
## Protected Attributes
Typ | m_value
| the real value

## Detailed Description

### template<class Typ, std::string toString = doubleToString>
class TemplateValue< Typ, toString >

template class for a IValue standard data type needs the data type and a methode for string converting as template argument

All parts are declared and defined in the header because the needed template implementations are needed to the compiling time of the lib. To create new classes in an using program it must be in the header.

## Constructor & Destructor Documentation

TemplateValue | ( | Typ | value,
|  | std::string | name = `"templateValue"` |
| ) |  |  | `[inline]`

constructor needs the value and a name (for IValue -> is default implemented as "templateValue")

Parameters:

  | value | (Typ) the value of this IValue
  | name | (string) the name

virtual ~TemplateValue | ( |  | ) | `[inline, virtual]`

default destructor

## Member Function Documentation

Typ getValue | ( | void |  | ) | const`[inline]`

this function can be used to read the standard data type.

Returns:
  (Typ) the value

virtual IValue* operator * | ( | const IValue & | value | ) | const`[inline, virtual]`

the implementation of the mul operator, what is part of the interface.

This function only accept TemplateValues or the same type like "Typ"

Parameters:

  | value | (const IValue&) the other part of the operation

Returns:
  (IValue*) the result

Implements IValue.

virtual operator std::string | ( | void |  | ) | const`[inline, virtual]`

cast operatot to string use the convert methode.

Returns:
  (string) the cast result

Reimplemented from IValue.

virtual IValue* operator+ | ( | const IValue & | value | ) | const`[inline, virtual]`

the implementation of the add operator what is part of the interface.

This function only accept TemplateValues or the same type like "Typ"

Parameters:

  | value | (const IValue&) the other part of the operation

Returns:
  (IValue*) the result

Implements IValue.

virtual bool restore | ( | FILE * | f | ) | `[inline, virtual]`

restore the value from a file

Parameters:

  | f | (FILE*) the file where the value inside

Returns:
  (bool) true if all ok.

Reimplemented from IValue.

void setValue | ( | Typ | value | ) | `[inline]`

this function is to change the value.

Parameters:

  | value |

virtual bool store | ( | FILE * | f | ) | const`[inline, virtual]`

store the value in a file

Parameters:

  | f | (FILE*) the file to store

Returns:
  (bool) true if all ok.

Reimplemented from IValue.

## Member Data Documentation

Typ m_value`[protected]`

the real value

The documentation for this class was generated from the following file:

- TemplateValue.h