OEOptions¶
class OEOptions
The OEOptions is an abstract base class. The Options represent a collection of OEParameter class that defines the set of parameters associated with settings of various objects or calculations.
See also
OESimpleAppOptions class
Code Examples
Define parameters example
- The OEOptions class defines the following public methods:
AddDetail¶
bool AddDetail(const std::string &detail)
Adds a line to the detailed description of the options.
AddOption¶
OEOptions* AddOption(const OEOption&)
Adds a copy of the specified options as sub-options to this options.
AddParameter¶
OEParameter* AddParameter(const OEParameter&)
Adds a copy of the specified parameter to the options.
AddParameterPrefix¶
bool AddParameterPrefix(const std::string& suffix)
Add the specified prefix to the name of all the parameters.
AddParameterSuffix¶
bool AddParameterSuffix(const std::string& suffix)
Add the specified suffix to the name of all the parameters.
DeleteOptions¶
bool DeleteOptions(OEOptions&)
Deletes the specified sub-options, if it belongs to this options.
DeleteParameter¶
bool DeleteParameter(OEParameter& param)
Deletes the specified parameter, if it belongs to this options.
FindDupParameters¶
OEIterBase<OEParameter>* FindDupParameters(const bool visibleOnly = true)
OEIterBase<const OEParameter>* FindDupParameters(const bool visibleOnly = true) const
Returns duplicate parameters. Two parameters are considered duplicates if they have
a common name. If visibleOnly
is set to True
, parameters with visibility
OEParamVisibility::Hidden
are ignored from this list. This operation
is always recursive to the associated sub-options.
GetOption¶
OEOptions* GetOption(const std::string& name)
const OEOptions* GetOption(const std::string& name) const
Get the sub-options with the specified name. Returns a NULL pointer if a sub-options with specified name does not exist.
GetOptions¶
OEIterBase<const OEOptions>* GetOptions(const bool recursive = true) const
OEIterBase<OEOptions>* GetOptions(const bool recursive = true)
Get the sub-options of this options. A value of true
for recursive
compiles all
the sub-options from the subsequent sub-options.
GetParameter¶
OEParameter* GetParameter(const std::string& name)
const OEParameter* GetParameter(const std::string& name) const
Get the parameter with the specified name. Returns a NULL pointer if a parameter with specified name does not exist.
GetParameters¶
OEIterBase<const OEParameter>* GetParameters(const bool recursive = true) const
OEIterBase<OEParameter>* GetParameters(const bool recursive = true)
OEIterBase<const OEParameter>* GetParameters(const std::string& name, const bool recursive = true) const
OEIterBase<OEParameter>* GetParameters(const std::string& name, const bool recursive = true)
Get the parameters from this options. If a name is specified only parameters with the specified
name are provided. A value of true
for recursive
compiles all the parameters from the
subsequent sub-options.
HasDupParameters¶
bool HasDupParameters(const bool visibleOnly = true) const
Check if a there are duplicate parameters in this options. Two parameters are considered
duplicates if they have a common name. If visibleOnly
is set to True
, parameters with
visibility OEParamVisibility::Hidden
are ignored from this check. This
operation is always recursive to the associated sub-options.
HasOption¶
bool HasOption(const std::string& name) const
Check if a sub-options with the specified name exists in the options.
HasParameter¶
bool HasParameter(const std::string& name) const
Check if a parameter with the specified name (or alias) exists in the options.
SetOrderPriority¶
bool SetOrderPriority(int order)
Sets the order priority of the Options, which is used to control the order Options appear in help lists. Default: 0
SetParameterVisibility¶
bool SetParameterVisibility(const unsigned visibility)
bool SetParameterVisibility(const std::string& name, const unsigned visibility)
Sets the visibility of the parameters to the specified value. This operation is
always recursive to the associated sub-options. Valid settings are defined in the OEParamVisibility
namespace.
UpdateValues¶
bool UpdateValues(const OEOptions& opts)
Update parameters values of this options, from the parameter values of the soecified options. Two parameters are considered same if they have a common name and data type. This operation is always recursive to the associated sub-options.