OEParameter¶
class OEParameter
The OEParameter is an abstract base class. The parameters represent indivudual options in a OEOptions class, that can eventually translate to a parameter in a command-line interface application.
- The OEParameter class defines the following public methods:
AddAlias
andGetAliases
GetKeyless
andSetKeyless
IsSet
andIsSetToString
- The following classes derive from this class:
AddAlias¶
bool AddAlias(std::string alias)
Adds an ‘alias’ name for this parameter. The alias must be a single word and begin with
a '-'
. This function returns true
if the alias is valid and the add succeeds.
AddDetail¶
bool AddDetail(const std::string &detail)
Adds a line to the detailed description of the parameter. Return true
if completed successfully.
AddIllegalRange¶
bool AddIllegalRange(std::string hi_val, std::string low_val)
Adds an illegal range for this parameter in string format. This function succeeds and returns true
if the parameter can have illegal ranges.
AddIllegalValue¶
bool AddIllegalValue(std::string val)
Adds an illegal value in string format. This function succeeds and returns true
if the parameter
can have illegal values.
AddLegalRange¶
bool AddLegalRange(std::string hi_val, std::string low_val)
Adds a legal range for the parameter in string format. This function succeeds and returns true
if the parameter can have legal ranges.
AddLegalValue¶
bool AddLegalValue(std::string val)
Adds a legal value in string format. This function succeeds and returns true
if the parameter
can have legal values.
AddStringDefault¶
bool AddStringDefault(std::string string_default)
Adds a default value in string format. This function succeeds and returns true
if the default
value can be set.
AddStringValue¶
bool AddStringValue(std::string string_value)
Adds a value for the parameter in string format. This function succeeds and returns true
if the
value can be set.
ClearDefaults¶
bool ClearDefaults()=0
Clear all currently set default values. Returns true
if done successfully.
ClearValues¶
bool ClearValues()=0
Clear all currently set parameter values. Returns true
if done successfully.
GetHasDefault¶
bool GetHasDefault(unsigned int=0) const
Returns true
if a default value for the parameter is set.
GetHasValue¶
bool GetHasValue(unsigned int=0) const
Returns true
if the value of the OEParameter object is set.
GetIllegalRanges¶
OEIterBase<const std::pair<std::string, std::string> > * GetIllegalRanges() const
See AddIllegalRange
method.
GetIllegalValues¶
OEIterBase<const std::string> *GetIllegalValues() const
See AddIllegalValue
method.
GetLegalRanges¶
OEIterBase<const std::pair<std::string, std::string> > * GetLegalRanges() const
Returns the legal ranges in string format.
GetLegalValues¶
OEIterBase<const std::string> *GetLegalValues() const
Returns the legal values of the parameter in string format.
GetPrettyLegalValues¶
OEIterBase<const std::string> *GetPrettyLegalValues() const
Returns the named legal values of the parameter in string format. This list of legal values may or may-not
be idential to the one obtained from GetLegalValues
,
depending on the parameter type.
GetStringDefault¶
std::string GetStringDefault(unsigned int=0) const
Returns the string default of the parameter at the specified index. See
AddStringDefault
method.
GetStringDefaults¶
OEIterBase<const std::string> *GetStringDefaults() const
See AddStringDefault
method.
GetStringValue¶
std::string GetStringValue(unsigned int=0) const
Returns the string value of the parameter at the specified index. See
AddStringValue
method.
IsLegalString¶
bool IsLegalString(std::string value) const
Returns if the specified value in the string format is a legal
value. A setting is considered a legal value if it does not
match and illegal value or fall within an illegal range (see
OEParameter::AddIllegalValue
and
OEParameter::AddIllegalRange
member
functions of this class). Additionally if the parameter has at
least one legal value or legal range the setting must match
either a legal value or legal range.
IsSet¶
bool IsSet(unsigned int idx=0) const
Returns if the parameter current contains a setting, i.e., a default or an user-defined value.
IsSetToString¶
bool IsSetToString(std::string val) const
Returns if the parameters current setting (i.e., a default or an user-defined value) matches the specified string value.
Load¶
bool Load()
Converts the string defaults and values of this parameter into actual defaults and values.
This function will return false
if the string defaults or values cannot be converted to the
actual defaults or values, as well as if the values do not satisfy the specified ranges.
LoadDefault¶
bool LoadDefault()
Converts the string defaults of this parameter into actual defaults.
This function will return false
if the string defaults cannot be converted to the actual defaults,
as well as if the default values do not satisfy the specified ranges.
LoadValue¶
bool LoadValue()
Converts the user-defined string values of this parameter into actual values.
This function will return false
if the string values cannot be converted to the actual values,
as well as if the values do not satisfy the specified ranges.
SetIsList¶
bool SetIsList(bool is_list_parameter)
Set if the parameter is a list parameter, i.e., if the parameters can value of list of defaults or user-defined values. Default: False
SetKeyless¶
bool SetKeyless(unsigned int keyless)
Sets the keyless setting of the parameter. To enable a prrameter to be keyless the entry must be a non-zero value. A value of 0 (default) specifies the parameter to be not-keyless. Default: 0
SetName¶
bool SetName(std::string name)
Sets the name of the parameter, which must be a single word and
begin with '-'
.
SetOrderPriority¶
bool SetOrderPriority(int order)
Sets the order priority of the parameter, which is used to control the order parameters appear in help lists. Default: 0
SetRequired¶
bool SetRequired(bool required)
Sets the flag indicating if the parameter is required (i.e., must be guven a user-defined value). Default: False
SetStringDefault¶
bool SetStringDefault(std::string string_default)
Sets the default value of the parameter as a string. This string
default is not converted into the read default until the
OEParameter::LoadDefault
member function is
called. Default: None
SetStringValue¶
bool SetStringValue(std::string string_value)
Sets the value of the parameter as a string. This string value
is not converted into the real value until
the OEParameter::LoadValue
member function is
called. Default: None
SetVisibility¶
bool SetVisibility(unsigned int visibility)
Sets the visibility of the parameter. Valid settings are defined in the OEParamVisibility
namespace.
** Default OEParamVisibility::Simple
**