ModelParamBatch Class Reference

A helper class for batch setting and restoring groups of parameter values. More...

#include <Component/ModelParamBatch.H>

Collaboration diagram for ModelParamBatch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

template<class T >
void addParamValue (const std::string &paramname, const T &val)
 Add a new parameter name and associated value to our list of managed parameters.
void installValues (ModelComponent *comp)
 Install our stored parameter values in the given component.
void restoreValues (ModelComponent *comp)
 Restore parameter values saved during a previous installValues() call.
void addParamValueAux (const std::string &paramname, const rutz::shared_ptr< RefHolder > &valref)
 Auxiliary implementation function for addParamValue().

Detailed Description

A helper class for batch setting and restoring groups of parameter values.

Typical usage would be like this:

    ModelParamBatch params;
    params.addParamValue("SomeParam", int(1));
    params.addParamValue("SomeFlag", true);
    params.addParamValue("SomeString", "hello");

    ModelManager manager;

    params.installValues(&manager); // params are now 1,true,"hello"
    // ... do some work

    // ... later:
    params.restoreValues(&manager); // params are now back to their original values

Definition at line 69 of file ModelParamBatch.H.


Member Function Documentation

template<class T >
void ModelParamBatch::addParamValue ( const std::string paramname,
const T &  val 
) [inline]

Add a new parameter name and associated value to our list of managed parameters.

Definition at line 78 of file ModelParamBatch.H.

References addParamValueAux().

void ModelParamBatch::addParamValueAux ( const std::string paramname,
const rutz::shared_ptr< RefHolder > &  valref 
)

Auxiliary implementation function for addParamValue().

Definition at line 91 of file ModelParamBatch.C.

Referenced by addParamValue().

void ModelParamBatch::installValues ( ModelComponent comp  ) 

Install our stored parameter values in the given component.

The component's current values for those parameters will be remembered so that they can later be restored with restoreValue().

Definition at line 59 of file ModelParamBatch.C.

References ModelComponent::getModelParamString(), MC_RECURSE, and ModelComponent::setModelParamValAux().

void ModelParamBatch::restoreValues ( ModelComponent comp  ) 

Restore parameter values saved during a previous installValues() call.

Definition at line 75 of file ModelParamBatch.C.

References MC_RECURSE, and ModelComponent::setModelParamString().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:37 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3