Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TemplateValue< Typ, toString > 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>

Inheritance diagram for TemplateValue< Typ, toString >:
Collaboration diagram for TemplateValue< Typ, toString >:

Public Member Functions

 TemplateValue (Typ value, std::string name="templateValue")
 constructor needs the value and a name (for IValue -> is default implemented as "templateValue") More...
 
virtual ~TemplateValue ()
 default destructor More...
 
Typ getValue (void) const
 this function can be used to read the standard data type. More...
 
void setValue (Typ value)
 this function is to change the value. More...
 
virtual IValueoperator* (const IValue &value) const
 the implementation of the mul operator, what is part of the interface. More...
 
virtual IValueoperator+ (const IValue &value) const
 the implementation of the add operator what is part of the interface. More...
 
virtual operator std::string (void) const
 cast operatot to string use the convert methode. More...
 
virtual bool store (FILE *f) const
 store the value in a file More...
 
virtual bool restore (FILE *f)
 restore the value from a file More...
 
- Public Member Functions inherited from IValue
 IValue (std::string name)
 constructor Needs a string for the name of the value. More...
 
virtual ~IValue ()
 default destructor More...
 
- Public Member Functions inherited from Inspectable
 Inspectable (const iparamkey &name="")
 TYPEDEFS END. More...
 
virtual ~Inspectable ()
 
virtual iparamkeylist getInternalParamNames () const
 The list of the names of all internal parameters given by getInternalParams(). More...
 
virtual iparamvallist getInternalParams () const
 
virtual iparamvalptrlist getInternalParamsPtr () const
 be careful: matrices will be ignored More...
 
virtual ilayerlist getStructuralLayers () const
 Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important. More...
 
virtual iconnectionlist getStructuralConnections () const
 Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important. More...
 
virtual void addInspectableValue (const iparamkey &key, iparamval const *val, const std::string &descr=std::string())
 This is the new style for adding inspectable values. More...
 
virtual void addInspectableMatrix (const iparamkey &key, const matrix::Matrix *m, bool only4x4AndDiag=true, const std::string &descr=std::string())
 This is the new style for adding inspectable values. More...
 
virtual void addInspectableDescription (const iparamkey &key, const std::string &descr)
 adds a description for the given parameter using info-lines The line will start (appart from the #I) with a D for description followed by the key end then followed by the string. More...
 
virtual void addInfoLine (std::string infoLine)
 Adds an info line to this inspectable instance. More...
 
virtual void addInfoLines (std::list< std::string > infoLineList)
 Adds a bunch of infolines with addInfoLine to this inspectable instance. More...
 
virtual void removeInfoLines ()
 Removes all infolines from this inspectable instance. More...
 
virtual const infoLinesListgetInfoLines () const
 Returns all infolines added to this inspectable instance. More...
 
virtual void addInspectable (Inspectable *insp)
 Adds an inspectable as a child object. More...
 
virtual void removeInspectable (Inspectable *insp)
 Removes an inspectable as a child object. More...
 
virtual void setNameOfInspectable (const iparamkey &name)
 set the name of the inspectable More...
 
virtual const iparamkey getNameOfInspectable () const
 return the name of the inspectable, getName() would conflict with Configurable::getName() too often More...
 
virtual const inspectableListgetInspectables () const
 Returns the list containing all inspectable children. More...
 

Protected Attributes

Typ m_value
 the real value More...
 
- Protected Attributes inherited from IValue
std::string m_name
 the name of this class. More...
 
- Protected Attributes inherited from Inspectable
iparamkey name
 
iparampairlist mapOfValues
 
imatrixpairlist mapOfMatrices
 
infoLinesList infoLineStringList
 

Additional Inherited Members

- Public Types inherited from Inspectable
typedef std::string iparamkey
 
typedef double iparamval
 
typedef std::pair< iparamkey,
iparamval const * > 
iparampair
 
typedef std::pair< iparamkey,
std::pair< const
matrix::Matrix *, bool > > 
imatrixpair
 
typedef std::list< iparamkeyiparamkeylist
 
typedef std::list< std::string > infoLinesList
 
typedef std::list< iparamvaliparamvallist
 
typedef std::list< iparamval
const * > 
iparamvalptrlist
 
typedef std::list< iparampairiparampairlist
 
typedef std::list< imatrixpairimatrixpairlist
 
typedef struct Inspectable::ILayer ILayer
 
typedef struct
Inspectable::IConnection 
IConnection
 
typedef std::list< ILayerilayerlist
 
typedef std::list< IConnectioniconnectionlist
 
typedef std::list< const
Inspectable * > 
inspectableList
 

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 ( )
inlinevirtual

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 operator std::string ( void  ) const
inlinevirtual

cast operatot to string use the convert methode.

Returns
(string) the cast result

Reimplemented from IValue.

virtual IValue* operator* ( const IValue value) const
inlinevirtual

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 IValue* operator+ ( const IValue value) const
inlinevirtual

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)
inlinevirtual

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
inlinevirtual

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: