OptionManager Class Reference

Abstract interface for the option-managing part of ModelManager. More...

#include <Component/OptionManager.H>

Inheritance diagram for OptionManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 OptionManager ()
 Default constructor.
virtual ~OptionManager ()
 Virtual destructor for proper base class destruction.
Command-line options

virtual void requestOption (OptionedModelParam &p, const bool useMyVal=false)=0
 ModelComponent objects may request a command-line option here.
virtual void unRequestOption (OptionedModelParam &p)=0
 Request the removal of a param from the command-line options.
virtual void requestOptionAlias (const ModelOptionDef *def)=0
 Users may request model option aliases.
virtual void setOptionValString (const ModelOptionDef *def, const std::string &val)=0
 Set an option value.
virtual std::string getOptionValString (const ModelOptionDef *def)=0
 Get an option value.
virtual bool isOptionRequested (const ModelOptionDef *def) const =0
 Check if anybody has requested the given option.
Alternative access to internal options

These functions may be useful for alternative methods of displaying the help for command-line options (e.g. in the Qt ModelManagerWizard).

virtual uint numOptionDefs () const =0
 Get the number of ModelOptionDef objects in our list.
virtual uint getOptionDefs (const ModelOptionDef **arr, uint narr)=0
 Get ModelOptionDef objects from our list, up to the size of the given array.
virtual const ModelOptionDeffindOptionDef (const char *name) const =0
 Get the ModelOptionDef for the given name.
virtual bool isOptionDefUsed (const ModelOptionDef *def) const =0
 Query if the given ModelOptionDef is used in this program.

Detailed Description

Abstract interface for the option-managing part of ModelManager.

Definition at line 50 of file OptionManager.H.


Constructor & Destructor Documentation

OptionManager::OptionManager (  ) 

Default constructor.

Definition at line 43 of file OptionManager.C.

OptionManager::~OptionManager (  )  [virtual]

Virtual destructor for proper base class destruction.

Definition at line 44 of file OptionManager.C.


Member Function Documentation

virtual const ModelOptionDef* OptionManager::findOptionDef ( const char *  name  )  const [pure virtual]

Get the ModelOptionDef for the given name.

Aborts if there is no such ModelOptionDef.

Implemented in CmdlineOptionManager, and ModelManager.

virtual uint OptionManager::getOptionDefs ( const ModelOptionDef **  arr,
uint  narr 
) [pure virtual]

Get ModelOptionDef objects from our list, up to the size of the given array.

Returns the number of array entries that were actually filled with valid ModelOptionDef pointers.

Implemented in CmdlineOptionManager, and ModelManager.

virtual std::string OptionManager::getOptionValString ( const ModelOptionDef def  )  [pure virtual]

Get an option value.

The value returned here is the value currently held by the ModelManager. This value is updated in three cases: 1) when a new component requests the option using requestOption() with useMyVal true; 2) when setOptionValString() is called, and 3) when the command-line arguments are parsed by ParseCommandLine, if a value for this option has been specified in the command line. If ModelComponent objects modify their local ModelParam values for their local parameter with this name, the value returned here will not be affected.

Implemented in CmdlineOptionManager, and ModelManager.

Referenced by featureClusterVision< FLOAT >::fCVsetUpfCV(), and SpatialMetrics::paramChanged().

virtual bool OptionManager::isOptionDefUsed ( const ModelOptionDef def  )  const [pure virtual]

Query if the given ModelOptionDef is used in this program.

Implemented in CmdlineOptionManager, and ModelManager.

virtual bool OptionManager::isOptionRequested ( const ModelOptionDef def  )  const [pure virtual]

Check if anybody has requested the given option.

Implemented in CmdlineOptionManager, and ModelManager.

virtual uint OptionManager::numOptionDefs (  )  const [pure virtual]

Get the number of ModelOptionDef objects in our list.

Implemented in CmdlineOptionManager, and ModelManager.

virtual void OptionManager::requestOption ( OptionedModelParam p,
const bool  useMyVal = false 
) [pure virtual]

ModelComponent objects may request a command-line option here.

Parameters:
p the ModelParam data member of c corresponding to the option
useMyVal if true, we will do a setOptionValString() using the current value of the parameter, so that this value will be propagated to all OptionedModelParam objects that have requested this option and will become the new command-line default value. If false, the ModelParam p will be updated to the current value of the option. So, use useMyVal=true if your component wishes to push its current parameter value as the default for everyone using this option, and use false if your component wishes to use the current default instead.

Implemented in CmdlineOptionManager, and ModelManager.

Referenced by ModelComponent::doRequestOption(), and ModelComponent::exportOptions().

virtual void OptionManager::requestOptionAlias ( const ModelOptionDef def  )  [pure virtual]

Users may request model option aliases.

Parameters:
name the name of the option alias, from ModelOptionDefs.C

Implemented in CmdlineOptionManager, and ModelManager.

Referenced by IEEE1394grabber::IEEE1394grabber(), REQUEST_OPTIONALIAS_CHANNEL(), REQUEST_OPTIONALIAS_NEURO(), SoxChannel::SoxChannel(), V4L2grabber::V4L2grabber(), and V4Lgrabber::V4Lgrabber().

virtual void OptionManager::setOptionValString ( const ModelOptionDef def,
const std::string val 
) [pure virtual]
virtual void OptionManager::unRequestOption ( OptionedModelParam p  )  [pure virtual]

Request the removal of a param from the command-line options.

Parameters:
p the ModelParam data member of c corresponding to the option

Implemented in CmdlineOptionManager, and ModelManager.

Referenced by ModelComponent::unregisterParam().


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