stores triple (paramater name, value, comment) and print order information order_m. It is also possible to mark used parameters with markUsed(). An application is for example detecting typing errors in input parameters. More...
#include <Parameterlist.h>
Public Member Functions | |
Parameter (const string &name, const string &value, const string &comment, bool fromDefault=false) | |
data access | |
std::string | getName () |
void | setName (const string &value) |
std::string & | getValue () |
std::string & | getValueAsString () |
void | setValue (const string &value) |
unsigned short | getPrintOrder () const |
void | setPrintOrder (unsigned short order) |
bool | isUsed () const |
bool | isDefaultValue () const |
void | markUsed () |
IO | |
ostream & | printParameter (ostream &os) const |
print format is <name> = ;<newline> | |
ostream & | printParameterWithComment (ostream &os) const |
print format is <name> = ; --<comment><newline> | |
ostream & | printParameterDetailed (ostream &os) const |
print format is <name> = ; --<comment><newline> --'order' (<name>)=<print order>=""><newline> | |
Static Public Member Functions | |
print ordering | |
static bool | compareParameterOrder (Parameter *const &par1, Parameter *const &par2) |
Public Attributes | |
data | |
string | name_m |
string | value_m |
string | comment_m |
bool | bUsed_m |
bool | bDefaultValue_m |
unsigned short | order_m |
Friends | |
class | Parameterlist |
Definition at line 25 of file Parameterlist.h.
Parameter::Parameter | ( | const string & | name, | |
const string & | value, | |||
const string & | comment, | |||
bool | fromDefault = false | |||
) |
Definition at line 10 of file Parameterlist.cc.
static bool Parameter::compareParameterOrder | ( | Parameter *const & | par1, | |
Parameter *const & | par2 | |||
) | [inline, static] |
Definition at line 71 of file Parameterlist.h.
References order_m.
Referenced by Parameterlist::printUsedParameters().
std::string Parameter::getName | ( | ) |
Definition at line 80 of file Parameterlist.cc.
References name_m.
unsigned short Parameter::getPrintOrder | ( | ) | const |
Definition at line 46 of file Parameterlist.cc.
References order_m.
string & Parameter::getValue | ( | ) |
Definition at line 61 of file Parameterlist.cc.
References value_m.
std::string & Parameter::getValueAsString | ( | ) |
Definition at line 73 of file Parameterlist.cc.
References value_m.
Referenced by nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::convertStringParamsToOptions(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initBoolParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initExperimentTag(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initFieldCharacteristic(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initHamiltonianComponentSwitch(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initNonNegativeIntParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initPointFilter(), and nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initRandomSeed().
bool Parameter::isDefaultValue | ( | ) | const |
Definition at line 91 of file Parameterlist.cc.
References bDefaultValue_m.
bool Parameter::isUsed | ( | ) | const |
Definition at line 86 of file Parameterlist.cc.
References bUsed_m.
void Parameter::markUsed | ( | ) |
Definition at line 51 of file Parameterlist.cc.
References bUsed_m.
Referenced by Parameterlist::addDefaultParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::convertStringParamsToOptions(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initBoolParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initExperimentTag(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initFieldCharacteristic(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initHamiltonianComponentSwitch(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initNonNegativeIntParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initPointFilter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initRandomSeed(), and nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::loadParamList().
ostream & Parameter::printParameter | ( | ostream & | os | ) | const |
Definition at line 22 of file Parameterlist.cc.
References name_m, and value_m.
Referenced by operator<<().
ostream & Parameter::printParameterDetailed | ( | ostream & | os | ) | const |
ostream & Parameter::printParameterWithComment | ( | ostream & | os | ) | const |
Definition at line 28 of file Parameterlist.cc.
void Parameter::setName | ( | const string & | value | ) |
void Parameter::setPrintOrder | ( | unsigned short | order | ) |
Definition at line 41 of file Parameterlist.cc.
References order_m.
Referenced by nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::convertStringParamsToOptions(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initBoolParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initExperimentTag(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initFieldCharacteristic(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initHamiltonianComponentSwitch(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initNonNegativeIntParameter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initPointFilter(), nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initRandomSeed(), and nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::loadParamList().
void Parameter::setValue | ( | const string & | value | ) |
Definition at line 56 of file Parameterlist.cc.
References value_m.
Referenced by nCenterFocus::CenterfocusParams< TPolynomXY, TRing >::initRandomSeed().
friend class Parameterlist [friend] |
Definition at line 27 of file Parameterlist.h.
Definition at line 37 of file Parameterlist.h.
Referenced by isDefaultValue().
bool Parameter::bUsed_m |
Definition at line 36 of file Parameterlist.h.
Referenced by isUsed(), and markUsed().
string Parameter::comment_m |
Definition at line 35 of file Parameterlist.h.
Referenced by printParameterDetailed(), and printParameterWithComment().
string Parameter::name_m |
Definition at line 33 of file Parameterlist.h.
Referenced by getName(), printParameter(), printParameterDetailed(), and printParameterWithComment().
unsigned short Parameter::order_m |
Definition at line 39 of file Parameterlist.h.
Referenced by compareParameterOrder(), getPrintOrder(), printParameterDetailed(), and setPrintOrder().
string Parameter::value_m |
Definition at line 34 of file Parameterlist.h.
Referenced by getValue(), getValueAsString(), printParameter(), printParameterDetailed(), printParameterWithComment(), and setValue().