GWOLLUM
4.2.0
Tools for gravitational-wave analyses
|
Single option. More...
#include <GwollumOptions.h>
Public Member Functions | |
void | Add (const double aValue) |
Adds the option value (double). More... | |
void | Add (const int aValue) |
Adds an option value (int). More... | |
void | Add (const string aValue) |
Adds the option value (string). More... | |
void | Add (const unsigned int aValue) |
Adds the option value (unsigned int). More... | |
double | GetDefaultD (void) |
Returns the option default value (double). More... | |
int | GetDefaultI (void) |
Returns the option default value (int). More... | |
string | GetDefaultS (void) |
Returns the option default value (string). More... | |
unsigned int | GetDefaultU (void) |
Returns the option default value (unsigned int). More... | |
string | GetKey (void) |
Returns the option key. More... | |
unsigned int | GetNumberOfValues (void) |
Returns the number of values. More... | |
string | GetOptionName (const unsigned int aValIndex) |
Returns a codified option name. More... | |
unsigned int | GetSize (void) |
Returns the option size. More... | |
string | GetTag (void) |
Returns the option tag. More... | |
char | GetType (void) |
Returns the option type. More... | |
double | GetValueD (const unsigned int aValIndex=0) |
Returns the option value (double). More... | |
bool | GetValueD (double &aValue, const unsigned int aValIndex) |
Returns the option value (double). More... | |
int | GetValueI (const unsigned int aValIndex=0) |
Returns the option value (int). More... | |
bool | GetValueI (int &aValue, const unsigned int aValIndex) |
Returns the option value (int). More... | |
string | GetValueS (const unsigned int aValIndex=0) |
Returns the option value (string). More... | |
bool | GetValueS (string &aValue, const unsigned int aValIndex) |
Returns the option value (string). More... | |
vector< double > | GetValuesD (void) |
Returns the list of option values (double). More... | |
vector< int > | GetValuesI (void) |
Returns the list of option values (int). More... | |
vector< string > | GetValuesS (void) |
Returns the list of option values (string). More... | |
vector< unsigned int > | GetValuesU (void) |
Returns the list of option values (unsigned int). More... | |
unsigned int | GetValueU (const unsigned int aValIndex=0) |
Returns the option value (unsigned int). More... | |
bool | GetValueU (unsigned int &aValue, const unsigned int aValIndex) |
Returns the option value (unsigned int). More... | |
bool | IsProvided (void) |
Tests whether an option value was provided. More... | |
void | Reset (void) |
Resets the option. More... | |
void | Set (const unsigned int aValIndex, const double aValue) |
Updates an option value (double). More... | |
void | Set (const unsigned int aValIndex, const int aValue) |
Updates an option value (int). More... | |
void | Set (const unsigned int aValIndex, const string aValue) |
Updates an option value (string). More... | |
void | Set (const unsigned int aValIndex, const unsigned int aValue) |
Updates an option value (unsigned int). More... | |
void | SetDefault (void) |
Set option to default values. More... | |
Constructors and destructors | |
GwollumOption (const string aTag, const string aKey, const int aDefaultValue, const unsigned int aSize=0) | |
Constructor of the GwollumOption class (int). More... | |
GwollumOption (const string aTag, const string aKey, const unsigned int aDefaultValue, const unsigned int aSize=0) | |
Constructor of the GwollumOption class (unsigned int). More... | |
GwollumOption (const string aTag, const string aKey, const double aDefaultValue, const unsigned int aSize=0) | |
Constructor of the GwollumOption class (double). More... | |
GwollumOption (const string aTag, const string aKey, const string aDefaultValue, const unsigned int aSize=0) | |
Constructor of the GwollumOption class (string). More... | |
virtual | ~GwollumOption (void) |
Destructor of the GwollumOption class. More... | |
Private Attributes | |
double | ddef |
Option double default value. More... | |
vector< double > | dvec |
Option double vector. More... | |
int | idef |
Option integer default value. More... | |
vector< int > | ivec |
Option integer vector. More... | |
string | key |
Option key. More... | |
unsigned int | osize |
Option size (number of fixed values). More... | |
bool | provided |
Set to true if the option was explicitly given. More... | |
string | sdef |
Option string default value. More... | |
vector< string > | svec |
Option string vector. More... | |
string | tag |
Option tag. More... | |
unsigned int | udef |
Option unsigned integer default value. More... | |
vector< unsigned int > | uvec |
Option unsigned integer vector. More... | |
char | valtype |
Option value type. More... | |
Single option.
A single option is defined by:
GwollumOption::GwollumOption | ( | const string | aTag, |
const string | aKey, | ||
const int | aDefaultValue, | ||
const unsigned int | aSize = 0 |
||
) |
Constructor of the GwollumOption class (int).
The option is uniquely identified by a TAG and a KEY string. It is given a default value. It is possible to fix the number of values for the option. If the size is equal to 0, the number of values is not fixed.
[in] | aTag | Option tag. Do not use "_"; they will be removed. |
[in] | aKey | Option aKey. Do not use "_"; they will be removed. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for a variable size. |
GwollumOption::GwollumOption | ( | const string | aTag, |
const string | aKey, | ||
const unsigned int | aDefaultValue, | ||
const unsigned int | aSize = 0 |
||
) |
Constructor of the GwollumOption class (unsigned int).
The option is uniquely identified by a TAG and a KEY string. It is given a default value. It is possible to fix the number of values for the option. If the size is equal to 0, the number of values is not fixed.
[in] | aTag | Option tag. Do not use "_"; they will be removed. |
[in] | aKey | Option aKey. Do not use "_"; they will be removed. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for a variable size. |
GwollumOption::GwollumOption | ( | const string | aTag, |
const string | aKey, | ||
const double | aDefaultValue, | ||
const unsigned int | aSize = 0 |
||
) |
Constructor of the GwollumOption class (double).
The option is uniquely identified by a TAG and a KEY string. It is given a default value. It is possible to fix the number of values for the option. If the size is equal to 0, the number of values is not fixed.
[in] | aTag | Option tag. Do not use "_"; they will be removed. |
[in] | aKey | Option aKey. Do not use "_"; they will be removed. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for a variable size. |
GwollumOption::GwollumOption | ( | const string | aTag, |
const string | aKey, | ||
const string | aDefaultValue, | ||
const unsigned int | aSize = 0 |
||
) |
Constructor of the GwollumOption class (string).
The option is uniquely identified by a TAG and a KEY string. It is given a default value. It is possible to fix the number of values for the option. If the size is equal to 0, the number of values is not fixed.
[in] | aTag | Option tag. Do not use "_"; they will be removed. |
[in] | aKey | Option aKey. Do not use "_"; they will be removed. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for a variable size. |
|
virtual |
Destructor of the GwollumOption class.
|
inline |
Adds the option value (double).
Appends the value to the list of option values.
[in] | aValue | Option value. |
|
inline |
Adds an option value (int).
Appends the value to the list of option values.
[in] | aValue | Option value. |
|
inline |
Adds the option value (string).
Appends the value to the list of option values.
[in] | aValue | Option value. |
|
inline |
Adds the option value (unsigned int).
Appends the value to the list of option values.
[in] | aValue | Option value. |
|
inline |
Returns the option default value (double).
|
inline |
Returns the option default value (int).
|
inline |
Returns the option default value (string).
|
inline |
Returns the option default value (unsigned int).
|
inline |
Returns the option key.
|
inline |
Returns the number of values.
string GwollumOption::GetOptionName | ( | const unsigned int | aValIndex | ) |
Returns a codified option name.
The option name is codified: [TAG]_[KEY]_[INDEX]_[SIZE]
:
[TAG]
: option tag word.[KEY]
: option key word.[INDEX]
: option value index.[SIZE]
: option size (0 for variable option).[in] | aValIndex | Option value index. |
|
inline |
Returns the option size.
|
inline |
Returns the option tag.
|
inline |
Returns the option type.
|
inline |
Returns the option value (double).
double
options! [in] | aValIndex | Option index. |
|
inline |
Returns the option value (double).
double
options! [out] | aValue | Returned value. |
[in] | aValIndex | Value index. |
|
inline |
Returns the option value (int).
int
options! [in] | aValIndex | Value index. |
|
inline |
Returns the option value (int).
int
options! [out] | aValue | Returned value. |
[in] | aValIndex | Value index. |
|
inline |
Returns the option value (string).
string
options! [in] | aValIndex | Option index. |
|
inline |
Returns the option value (string).
string
options! [out] | aValue | Returned value. |
[in] | aValIndex | Value index. |
|
inline |
Returns the list of option values (double).
double
options!
|
inline |
Returns the list of option values (int).
int
options!
|
inline |
Returns the list of option values (string).
string
options!
|
inline |
Returns the list of option values (unsigned int).
unsigned int
options!
|
inline |
Returns the option value (unsigned int).
unsigned int
options! [in] | aValIndex | Option index. |
|
inline |
Returns the option value (unsigned int).
unsigned int
options! [out] | aValue | Returned value. |
[in] | aValIndex | Value index. |
|
inline |
void GwollumOption::Reset | ( | void | ) |
Resets the option.
All the option values are removed. Fixed-size option values are set to default. Variable-size options are simply empty.
|
inline |
Updates an option value (double).
[in] | aValIndex | Option index. |
[in] | aValue | Option value. |
|
inline |
Updates an option value (int).
[in] | aValIndex | Option index. |
[in] | aValue | Option value. |
|
inline |
Updates an option value (string).
[in] | aValIndex | Option index. |
[in] | aValue | Option value. |
|
inline |
Updates an option value (unsigned int).
[in] | aValIndex | Option index. |
[in] | aValue | Option value. |
void GwollumOption::SetDefault | ( | void | ) |
Set option to default values.
For fixed-size options, all values are set to default. For variable-size options, the option is given one single value set to default.
|
private |
Option double default value.
|
private |
Option double vector.
|
private |
Option integer default value.
|
private |
Option integer vector.
|
private |
Option key.
|
private |
Option size (number of fixed values).
|
private |
Set to true if the option was explicitly given.
|
private |
Option string default value.
|
private |
Option string vector.
|
private |
Option tag.
|
private |
Option unsigned integer default value.
|
private |
Option unsigned integer vector.
|
private |
Option value type.