opspace::ParameterReflection Class Reference

Base for classes that reflect (some of) their parameters. More...

#include <Parameter.hpp>

Inheritance diagram for opspace::ParameterReflection:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ParameterReflection (std::string const &type_name, std::string const &instance_name)
virtual ~ParameterReflection ()
virtual Status check (int const *param, int value) const
 Default implementation always returns succes.
virtual Status check (std::string const *param, std::string const &value) const
 Default implementation always returns succes.
virtual Status check (double const *param, double value) const
 Default implementation always returns succes.
virtual Status check (Vector const *param, Vector const &value) const
 Default implementation always returns succes.
virtual Status check (Matrix const *param, Matrix const &value) const
 Default implementation always returns succes.
std::string const & getName () const
std::string const & getTypeName () const
ParameterlookupParameter (std::string const &name)
 
Returns:
A pointer to the Parameter subclass instance which represents a certain named parameter, or zero if the name does not match.

Parameter const * lookupParameter (std::string const &name) const
 
Returns:
A const pointer to the Parameter subclass instance which represents a certain named parameter, or zero if the name does not match.

ParameterlookupParameter (std::string const &name, parameter_type_t type)
 
Returns:
A pointer to the Parameter subclass instance which represents a certain named parameter AND matches the given type, or zero if the name or the type does not match.

Parameter const * lookupParameter (std::string const &name, parameter_type_t type) const
 
Returns:
A const pointer to the Parameter subclass instance which represents a certain named parameter AND matches the given type, or zero if the name or the type does not match.

parameter_lookup_t const & getParameterTable () const
virtual void dump (std::ostream &os, std::string const &title, std::string const &prefix) const

Protected Member Functions

IntegerParameterdeclareParameter (std::string const &name, int *integer, parameter_flags_t flags=PARAMETER_FLAG_DEFAULT)
 Used by subclasse to make one of their fields accessible to the outside.
StringParameterdeclareParameter (std::string const &name, std::string *instance, parameter_flags_t flags=PARAMETER_FLAG_DEFAULT)
 See also declareParameter(std::string const &, int *).
RealParameterdeclareParameter (std::string const &name, double *real, parameter_flags_t flags=PARAMETER_FLAG_DEFAULT)
 See also declareParameter(std::string const &, int *).
VectorParameterdeclareParameter (std::string const &name, Vector *vector, parameter_flags_t flags=PARAMETER_FLAG_DEFAULT)
 See also declareParameter(std::string const &, int *).
MatrixParameterdeclareParameter (std::string const &name, Matrix *matrix, parameter_flags_t flags=PARAMETER_FLAG_DEFAULT)
 See also declareParameter(std::string const &, int *).

Protected Attributes

std::string const type_name_
std::string const instance_name_


Detailed Description

Base for classes that reflect (some of) their parameters.

Manages a table of Parameter instances and provides default implementations for parameter checker methods.

Definition at line 187 of file Parameter.hpp.


Constructor & Destructor Documentation

opspace::ParameterReflection::ParameterReflection ( std::string const &  type_name,
std::string const &  instance_name 
)

Definition at line 335 of file Parameter.cpp.

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

Definition at line 344 of file Parameter.cpp.


Member Function Documentation

Status opspace::ParameterReflection::check ( int const *  param,
int  value 
) const [virtual]

Default implementation always returns succes.

Definition at line 404 of file Parameter.cpp.

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

Status opspace::ParameterReflection::check ( std::string const *  param,
std::string const &  value 
) const [virtual]

Default implementation always returns succes.

Reimplemented in opspace::CartPosTask.

Definition at line 412 of file Parameter.cpp.

Status opspace::ParameterReflection::check ( double const *  param,
double  value 
) const [virtual]

Default implementation always returns succes.

Reimplemented in opspace::DraftPIDTask, opspace::SelectedJointPostureTask, and opspace::TrajectoryTask.

Definition at line 420 of file Parameter.cpp.

Status opspace::ParameterReflection::check ( Vector const *  param,
Vector const &  value 
) const [virtual]

Default implementation always returns succes.

Reimplemented in opspace::PDTask, opspace::DraftPIDTask, opspace::SelectedJointPostureTask, opspace::TrajectoryTask, and opspace::JointLimitTask.

Definition at line 428 of file Parameter.cpp.

Status opspace::ParameterReflection::check ( Matrix const *  param,
Matrix const &  value 
) const [virtual]

Default implementation always returns succes.

Definition at line 436 of file Parameter.cpp.

std::string const& opspace::ParameterReflection::getName (  )  const [inline]

Reimplemented in opspace::Skill.

Definition at line 210 of file Parameter.hpp.

References instance_name_.

std::string const& opspace::ParameterReflection::getTypeName (  )  const [inline]

Definition at line 211 of file Parameter.hpp.

References type_name_.

Parameter * opspace::ParameterReflection::lookupParameter ( std::string const &  name  ) 

Returns:
A pointer to the Parameter subclass instance which represents a certain named parameter, or zero if the name does not match.

You can use getParameterTable() to inspect the list of parameters.

Definition at line 354 of file Parameter.cpp.

Referenced by main().

Parameter const * opspace::ParameterReflection::lookupParameter ( std::string const &  name  )  const

Returns:
A const pointer to the Parameter subclass instance which represents a certain named parameter, or zero if the name does not match.

You can use getParameterTable() to inspect the list of parameters.

Definition at line 365 of file Parameter.cpp.

Parameter * opspace::ParameterReflection::lookupParameter ( std::string const &  name,
parameter_type_t  type 
)

Returns:
A pointer to the Parameter subclass instance which represents a certain named parameter AND matches the given type, or zero if the name or the type does not match.

You can use getParameterTable() to inspect the list of parameters.

Definition at line 376 of file Parameter.cpp.

Parameter const * opspace::ParameterReflection::lookupParameter ( std::string const &  name,
parameter_type_t  type 
) const

Returns:
A const pointer to the Parameter subclass instance which represents a certain named parameter AND matches the given type, or zero if the name or the type does not match.

You can use getParameterTable() to inspect the list of parameters.

Definition at line 390 of file Parameter.cpp.

parameter_lookup_t const& opspace::ParameterReflection::getParameterTable (  )  const [inline]

Definition at line 245 of file Parameter.hpp.

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

Reimplemented in opspace::Skill, and opspace::Task.

Definition at line 443 of file Parameter.cpp.

Referenced by opspace::Skill::dbg(), opspace::Task::dump(), and opspace::Skill::dump().

IntegerParameter * opspace::ParameterReflection::declareParameter ( std::string const &  name,
int *  integer,
parameter_flags_t  flags = PARAMETER_FLAG_DEFAULT 
) [protected]

Used by subclasse to make one of their fields accessible to the outside.

The parameter then becomes available through the lookupParameter() and getParameterTable() methods.

Note:
Everyone is granted read access to the parameter. Write access is protected in two ways: the caller needs to have a non-const handle on the Task instance, and the Parameter::set() method will call Task::check() before actually writing a new value into the pointer provided here at declaration time.

Definition at line 456 of file Parameter.cpp.

Referenced by opspace::CartPosTask::CartPosTask(), opspace::CartPosTrjTask::CartPosTrjTask(), opspace::ClassicTaskPostureController::ClassicTaskPostureController(), opspace::DraftPIDTask::DraftPIDTask(), opspace::JointLimitTask::JointLimitTask(), opspace::OrientationTask::OrientationTask(), opspace::PDTask::PDTask(), tut05::PTask::PTask(), opspace::SelectedJointPostureTask::SelectedJointPostureTask(), opspace::Task::Task(), and opspace::TrajectoryTask::TrajectoryTask().

StringParameter * opspace::ParameterReflection::declareParameter ( std::string const &  name,
std::string *  instance,
parameter_flags_t  flags = PARAMETER_FLAG_DEFAULT 
) [protected]

See also declareParameter(std::string const &, int *).

..

Definition at line 465 of file Parameter.cpp.

RealParameter * opspace::ParameterReflection::declareParameter ( std::string const &  name,
double *  real,
parameter_flags_t  flags = PARAMETER_FLAG_DEFAULT 
) [protected]

See also declareParameter(std::string const &, int *).

..

Definition at line 474 of file Parameter.cpp.

VectorParameter * opspace::ParameterReflection::declareParameter ( std::string const &  name,
Vector *  vector,
parameter_flags_t  flags = PARAMETER_FLAG_DEFAULT 
) [protected]

See also declareParameter(std::string const &, int *).

..

Definition at line 483 of file Parameter.cpp.

MatrixParameter * opspace::ParameterReflection::declareParameter ( std::string const &  name,
Matrix *  matrix,
parameter_flags_t  flags = PARAMETER_FLAG_DEFAULT 
) [protected]

See also declareParameter(std::string const &, int *).

..

Definition at line 492 of file Parameter.cpp.


Member Data Documentation

std::string const opspace::ParameterReflection::type_name_ [protected]

Definition at line 252 of file Parameter.hpp.

Referenced by getTypeName().

std::string const opspace::ParameterReflection::instance_name_ [protected]

Definition at line 253 of file Parameter.hpp.

Referenced by opspace::OrientationTask::dbg(), opspace::JointLimitTask::dbg(), opspace::TrajectoryTask::dbg(), opspace::DraftPIDTask::dbg(), opspace::Skill::dbg(), opspace::Task::dump(), opspace::Skill::dump(), and getName().


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