opspace::Parameter Class Reference

Abstract base for all (task) parameters. More...

#include <Parameter.hpp>

Inheritance diagram for opspace::Parameter:

Inheritance graph
[legend]
Collaboration diagram for opspace::Parameter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Parameter (std::string const &name, parameter_type_t type, parameter_flags_t flags, ParameterReflection const *checker)
virtual ~Parameter ()
virtual int const * getInteger () const
virtual std::string const * getString () const
virtual double const * getReal () const
virtual Vector const * getVector () const
virtual Matrix const * getMatrix () const
virtual Status set (int value)
virtual Status set (std::string const &value)
virtual Status set (double value)
virtual Status set (Vector const &value)
virtual Status set (Matrix const &value)
virtual void dump (std::ostream &os, std::string const &prefix) const

Public Attributes

std::string const name_
parameter_type_t const type_
parameter_flags_t const flags_
ParameterReflection const * checker_


Detailed Description

Abstract base for all (task) parameters.

Fairly minimal for now: parameters have a name, a type, and (optionally) an associated checker. Ideas for future extensions are e.g. documentation strings, optional bounds for automatic checks, and a more generic type interface (instead of relying on parameter_type_t).

Note:
This base class can be instantiated, but it just behaves like a PARAMETER_TYPE_VOID parameter: you cannot get or set anything.

Definition at line 73 of file Parameter.hpp.


Constructor & Destructor Documentation

opspace::Parameter::Parameter ( std::string const &  name,
parameter_type_t  type,
parameter_flags_t  flags,
ParameterReflection const *  checker 
)

Definition at line 31 of file Parameter.cpp.

References opspace::PARAMETER_TYPE_INTEGER, opspace::PARAMETER_TYPE_MATRIX, opspace::PARAMETER_TYPE_REAL, opspace::PARAMETER_TYPE_STRING, opspace::PARAMETER_TYPE_VECTOR, opspace::PARAMETER_TYPE_VOID, and type_.

opspace::Parameter::~Parameter (  )  [virtual]

Definition at line 55 of file Parameter.cpp.


Member Function Documentation

int const * opspace::Parameter::getInteger (  )  const [virtual]

Reimplemented in opspace::IntegerParameter.

Definition at line 61 of file Parameter.cpp.

std::string const * opspace::Parameter::getString (  )  const [virtual]

Reimplemented in opspace::StringParameter.

Definition at line 68 of file Parameter.cpp.

double const * opspace::Parameter::getReal (  )  const [virtual]

Reimplemented in opspace::RealParameter.

Definition at line 75 of file Parameter.cpp.

Vector const * opspace::Parameter::getVector (  )  const [virtual]

Reimplemented in opspace::VectorParameter.

Definition at line 82 of file Parameter.cpp.

Referenced by draw_cb().

Matrix const * opspace::Parameter::getMatrix (  )  const [virtual]

Reimplemented in opspace::MatrixParameter.

Definition at line 89 of file Parameter.cpp.

Status opspace::Parameter::set ( int  value  )  [virtual]

Reimplemented in opspace::IntegerParameter.

Definition at line 96 of file Parameter.cpp.

Referenced by servo_cb().

Status opspace::Parameter::set ( std::string const &  value  )  [virtual]

Reimplemented in opspace::StringParameter.

Definition at line 104 of file Parameter.cpp.

Status opspace::Parameter::set ( double  value  )  [virtual]

Reimplemented in opspace::RealParameter.

Definition at line 112 of file Parameter.cpp.

Status opspace::Parameter::set ( Vector const &  value  )  [virtual]

Reimplemented in opspace::VectorParameter.

Definition at line 120 of file Parameter.cpp.

Status opspace::Parameter::set ( Matrix const &  value  )  [virtual]

Reimplemented in opspace::MatrixParameter.

Definition at line 128 of file Parameter.cpp.

void opspace::Parameter::dump ( std::ostream &  os,
std::string const &  prefix 
) const [virtual]

Reimplemented in opspace::IntegerParameter, opspace::StringParameter, opspace::RealParameter, opspace::VectorParameter, and opspace::MatrixParameter.

Definition at line 136 of file Parameter.cpp.

References name_.

Referenced by opspace::operator>>().


Member Data Documentation

std::string const opspace::Parameter::name_

Definition at line 76 of file Parameter.hpp.

Referenced by opspace::MatrixParameter::dump(), opspace::VectorParameter::dump(), opspace::RealParameter::dump(), opspace::StringParameter::dump(), opspace::IntegerParameter::dump(), and dump().

parameter_type_t const opspace::Parameter::type_

Definition at line 77 of file Parameter.hpp.

Referenced by Parameter().

parameter_flags_t const opspace::Parameter::flags_

Definition at line 78 of file Parameter.hpp.

Referenced by opspace::MatrixParameter::set(), opspace::VectorParameter::set(), opspace::RealParameter::set(), opspace::StringParameter::set(), and opspace::IntegerParameter::set().

ParameterReflection const* opspace::Parameter::checker_

Definition at line 79 of file Parameter.hpp.

Referenced by opspace::MatrixParameter::set(), opspace::VectorParameter::set(), opspace::RealParameter::set(), opspace::StringParameter::set(), and opspace::IntegerParameter::set().


The documentation for this class was generated from the following files:
Generated on Fri Aug 26 01:33:16 2011 for Stanford Whole-Body Control Framework by  doxygen 1.5.4