MT::Parameter< type > Class Template Reference
#include <std.h>
List of all members.
Detailed Description
template<class type>
class MT::Parameter< type >
A parameter that initializes itself from the command line (use
MT::init
), parameter file, or a default value (priority in this order). Initialization is done on the fly the _first_ time its value is queried (i.e., referenced by the cast operators).
Definition at line 368 of file std.h.
Public Member Functions
|
-
Parameter (char *_tag)
- Determines the tag to search for in parameter file/command line.
-
Parameter (char *_tag, const type &_default)
- specifies also a default value -- parameter does not have to but can be specified in the parameter file/command line
-
~Parameter ()
|
-
operator type ()
- standard type conversion: returns a const of the parameter value
-
type & operator() ()
- ()-operator: returns an lvalue of the parameter value
|
-
type & operator= (const type v)
- assigs a value to the parameter -- no further initialization needed
-
void setTag (char *_tag)
- set the tag (replacing the one from the constructor)
-
void reInitialize ()
- enforces that the parameter is reinitialized from the parameter file/command line, the next time it is referenced -- even if it has been initialized before
|
-
bool grabFromCmdLine ()
- Search for a command line option
-tag
and, if found, pipe the next command line option into value
by the operator>>(istream&,type&)
. Returns false on failure.
-
bool grabFromCfgFile ()
- Search the first occurence of a sequence '
tag:'
in the config file (opened automatically) and, if found, pipes it in value
. Returns false if parameter is not found.
Public Attributes
The documentation for this class was generated from the following file:
[]