OEParameter

class OEParameter

This class represents OEParameter.

The following classes derive from this class:

AddAlias

bool AddAlias(std::string alias)=0

Adds and ‘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)=0

Adds a line to the detailed description of the parameter. This function currently always returns true.

AddIllegalRange

bool AddIllegalRange(std::string hi_val, std::string low_val)=0

Adds an illegal range for this parameter in string format. This function succeeds and returns true if the parameter can have illegal ranges and false otherwise. Currently only int, float and double parameters can have illegal ranges, and for these parameters inf and -inf are legal high and low values respectively.

AddIllegalValue

bool AddIllegalValue(std::string val)=0

Adds a legal value in string format. This function succeeds and returns true if the parameter can have legal values. As a special case for string parameters ‘val’ can be a pattern with up to two * wildcards.

AddLegalRange

bool AddLegalRange(std::string hi_val, std::string low_val)=0

Adds a legal range for the parameter in string format. This function succeeds and returns true if the parameter can have legal ranges and false otherwise. Currently only int, float and double parameters can have legal ranges, and for these parameters inf and -inf are legal high and low values respectively.

AddLegalValue

bool AddLegalValue(std::string val)=0

AddStringDefault

bool AddStringDefault(std::string string_default)=0

AddStringValue

bool AddStringValue(std::string string_value)=0

ClassID

std::string ClassID() const =0

Returns the class id this parameter implementation class was registered to OEInterface::Factory with.

ClearDefaults

bool ClearDefaults()=0

ClearValues

bool ClearValues()=0

CreateCopy

OEParameter *CreateCopy() const =0

Creates a copy of this OEParameter instance.

GetAliases

OEIterBase<const std::string> *GetAliases() const =0

Returns the aliases of the OEParameter object.

GetBrief

std::string GetBrief() const =0

Returns the brief description of the OEParameter object.

GetCommand

std::string GetCommand() const =0

GetDetail

OEIterBase<const std::string> *GetDetail() const =0

Returns the detailed description of the OEParameter object.

GetElement

std::string GetElement() const =0

GetHasDefault

bool GetHasDefault(unsigned int=0) const =0

Returns true if the default of the OEParameter object is set.

GetHasValue

bool GetHasValue(unsigned int=0) const =0

Returns true if the value of the OEParameter object is set.

GetIllegalRanges

OEIterBase<const std::pair<std::string, std::string> > *
  GetIllegalRanges() const =0

Returns the illegal ranges of the OEParameter object in string format.

GetIllegalValues

OEIterBase<const std::string> *GetIllegalValues() const =0

Returns the illegal values of the OEParameter object in string format.

GetIsList

bool GetIsList() const =0

GetKeyless

unsigned int GetKeyless() const =0

Returns the keyless setting of the OEParameter object.

GetLegalRanges

OEIterBase<const std::pair<std::string, std::string> > *
  GetLegalRanges() const =0

Returns the legal ranges in string format.

GetLegalValues

OEIterBase<const std::string> *GetLegalValues() const =0

Returns the legal values of the OEParameter object in string format.

GetName

std::string GetName() const =0

Returns the name of the OEParameter object.

GetOrderPriority

int GetOrderPriority() const =0

Returns the order priority of the OEParameter object. The order priority flag affects the ordering of parameters returned by the OEInterface class’s method GetParameters(false).

GetRequired

bool GetRequired() const =0

Returns true if the OEParameter object is required.

GetStringDefault

std::string GetStringDefault(unsigned int=0) const =0

Returns the string default of the OEParameter object.

GetStringDefaults

OEIterBase<const std::string> *GetStringDefaults() const =0

GetStringValue

std::string GetStringValue(unsigned int=0) const =0

Returns the string value of the OEParameter object.

GetStringValues

OEIterBase<const std::string> *GetStringValues() const =0

GetVisibility

unsigned int GetVisibility() const =0

Returns the visibility of the parameter (see OEParamVisibility namespace).

IsLegalString

bool IsLegalString(std::string value) const =0

Returns if the given setting in 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

This method is equivalent to the expression OEParameter::GetHasValue || OEParameter::GetHasDefault.

IsSetToString

bool IsSetToString(std::string val) const =0

Converts ‘val’ from a string the actual parameter type and then returns false unless one of the following conditions is met.

  1. The parameter’s value is set and that value matches ‘val’.
  2. The parameter’s value is not set, but the parameters default is set and the default matches ‘val’.

Load

bool Load()

This method is equivalent to OEParameter::LoadValue && OEParameter::LoadDefault.

LoadDefault

bool LoadDefault()=0

Converts the string default of this parameter into actual default returned by OETypedParameter ‘s OETypedParameter::GetValue member function. This function will return not succeed and return false if the string default cannot be converted to the actual default, or if passing OEParameter::GetStringValue to OEParameter::IsLegalString returns false.

LoadValue

bool LoadValue()=0

Converts the string value of this parameter into actual value returned by OETypedParameter ‘s OETypedParameter::GetValue member function. This function will return not succeed and return false if the string value cannot be converted to the actual value, or if passing OEParameter::GetStringValue to OEParameter::IsLegalString returns false.

ReadValueAndDefaultBinary

size_t ReadValueAndDefaultBinary(const unsigned char *)=0

Reads and sets the current value and default of this parameter from the binary written by OEParameter::WriteValueAndDefaultBinary.

SetBrief

bool SetBrief(std::string brief)=0

Sets the brief description of the parameter. The function returns true if the set succeeded. Currently this function always succeeds for any parameter implemented by OpenEye.

SetCommand

bool SetCommand(const std::string &cmd)=0

SetElement

bool SetElement(const std::string &el)=0

SetIsList

bool SetIsList(bool is_list_parameter)=0

SetKeyless

bool SetKeyless(unsigned int keyless)=0

Sets the keyless setting of the parameter. The function returns true if the set succeeded. Currently this function always succeeds for any parameter implemented by OpenEye.

SetName

bool SetName(std::string name)=0

Sets the name of the parameter, which must be a single word and begin with '-'. The function returns true if the set succeeded.

SetOrderPriority

bool SetOrderPriority(int order)=0

Sets the order priority of the parameter, which is used to control the order parameters appear in help lists. This function currently always returns true. The order priority flag affects the ordering of parameters returned by the OEInterface class’s member function GetParameters(false)

SetRequired

bool SetRequired(bool required)=0

Sets the flag indicating if the parameter is required. The function returns true if the set succeeded. Currently this function always succeeds for any parameter implemented by OpenEye.

SetStringDefault

bool SetStringDefault(std::string string_default)=0

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.

SetStringValue

bool SetStringValue(std::string string_value)=0

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. The function returns true if the set succeeded. Currently this function always succeeds for any parameter implemented by OpenEye.

SetVisibility

bool SetVisibility(unsigned int visibility)=0

Sets the visibility of the parameter. Valid settings are OEParamVisibility::Simple, OEParamVisibility::Normal and OEParamVisibility::Hidden. Other values will be ignored and the function will return false.

TypedParameterTypeID

const void *TypedParameterTypeID() const =0

Returns OEGetDataType <TT>, where TT is the OETypedParameter <TT> this parameter implementation class derives from. (All implementations of OEParameter must derive from OETypedParameter).

ValueAndDefaultBinarySize

size_t ValueAndDefaultBinarySize() const =0

Returns the size of the binary that will be written by OEParameter::WriteValueAndDefaultBinary.

WriteValueAndDefaultBinary

size_t WriteValueAndDefaultBinary(unsigned char *) const =0

Writes the current value and default of this parameters (as returned by OETypedParameter::GetValue and OETypedParameter::GetDefault of OETypedParameter) as a platform independent binary.