libSBML Perl API
libSBML 5.10.0 Perl API
|
{core} Class of object that encapsulates a conversion option.
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.
LibSBML provides a number of converters that can perform transformations on SBML documents. These converters allow their behaviors to be controlled by setting property values. Converter properties are communicated using objects of class ConversionProperties, and within such objects, individual options are encapsulated using ConversionOption objects.
A ConversionOption object consists of four parts:
There are no constraints on the values of keys or descriptions; authors of SBML converters are free to choose them as they see fit.
An option in ConversionOption must have a data type declared, to indicate whether it is a string value, an integer, and so forth. The possible types of values are taken from the enumeration ConversionOptionType_t. The following are the possible values:
Enumerator | Meaning |
CNV_TYPE_BOOL | Indicates the value type is a Boolean. |
CNV_TYPE_DOUBLE | Indicates the value type is a double-sized float. |
CNV_TYPE_INT | Indicates the value type is an integer. |
CNV_TYPE_SINGLE | Indicates the value type is a float. |
CNV_TYPE_STRING | Indicates the value type is a string. |
Public Member Functions | |
virtual ConversionOption * | clone () const |
Creates and returns a deep copy of this ConversionOption object. More... | |
ConversionOption (std::string key, std::string value="", ConversionOptionType_t type=CNV_TYPE_STRING, std::string description="") | |
Creates a new ConversionOption. More... | |
ConversionOption (std::string key, const char *value, std::string description="") | |
Creates a new ConversionOption specialized for string-type options. More... | |
ConversionOption (std::string key, bool value, std::string description="") | |
Creates a new ConversionOption specialized for Boolean-type options. More... | |
ConversionOption (std::string key, double value, std::string description="") | |
Creates a new ConversionOption specialized for double-type options. More... | |
ConversionOption (std::string key, float value, std::string description="") | |
Creates a new ConversionOption specialized for float-type options. More... | |
ConversionOption (std::string key, int value, std::string description="") | |
Creates a new ConversionOption specialized for integer-type options. More... | |
ConversionOption (const ConversionOption &orig) | |
Copy constructor; creates a copy of an ConversionOption object. More... | |
virtual bool | getBoolValue () const |
Returns the value of this option as a Boolean. More... | |
virtual std::string | getDescription () const |
Returns the description string for this option. More... | |
virtual double | getDoubleValue () const |
Returns the value of this option as a double . More... | |
virtual float | getFloatValue () const |
Returns the value of this option as a float . More... | |
virtual int | getIntValue () const |
Returns the value of this option as an integer . More... | |
virtual std::string | getKey () const |
Returns the key for this option. More... | |
virtual ConversionOptionType_t | getType () const |
Returns the type of this option. More... | |
virtual std::string | getValue () const |
Returns the value of this option. More... | |
ConversionOption & | operator= (const ConversionOption &rhs) |
Assignment operator for ConversionOption. More... | |
virtual void | setBoolValue (bool value) |
Set the value of this option to a given Boolean value. More... | |
virtual void | setDescription (std::string description) |
Sets the description text for this option. More... | |
virtual void | setDoubleValue (double value) |
Set the value of this option to a given double value. More... | |
virtual void | setFloatValue (float value) |
Set the value of this option to a given float value. More... | |
virtual void | setIntValue (int value) |
Set the value of this option to a given int value. More... | |
virtual void | setKey (std::string key) |
Sets the key for this option. More... | |
virtual void | setType (ConversionOptionType_t type) |
Sets the type of this option. More... | |
virtual void | setValue (std::string value) |
Sets the value for this option. More... | |
virtual | ~ConversionOption () |
Destroys this object. More... | |
ConversionOption::ConversionOption | ( | std::string | key, |
std::string | value = "" , |
||
ConversionOptionType_t | type = CNV_TYPE_STRING , |
||
std::string | description = "" |
||
) |
Creates a new ConversionOption.
This is the general constructor, taking arguments for all aspects of an option. Other constructors exist with different arguments.
key | the key for this option |
value | an optional value for this option |
type | the type of this option |
description | the description for this option |
ConversionOption::ConversionOption | ( | std::string | key, |
const char * | value, | ||
std::string | description = "" |
||
) |
Creates a new ConversionOption specialized for string-type options.
key | the key for this option |
value | the value for this option |
description | an optional description |
ConversionOption::ConversionOption | ( | std::string | key, |
bool | value, | ||
std::string | description = "" |
||
) |
Creates a new ConversionOption specialized for Boolean-type options.
key | the key for this option |
value | the value for this option |
description | an optional description |
ConversionOption::ConversionOption | ( | std::string | key, |
double | value, | ||
std::string | description = "" |
||
) |
Creates a new ConversionOption specialized for double-type options.
key | the key for this option |
value | the value for this option |
description | an optional description |
ConversionOption::ConversionOption | ( | std::string | key, |
float | value, | ||
std::string | description = "" |
||
) |
Creates a new ConversionOption specialized for float-type options.
key | the key for this option |
value | the value for this option |
description | an optional description |
ConversionOption::ConversionOption | ( | std::string | key, |
int | value, | ||
std::string | description = "" |
||
) |
Creates a new ConversionOption specialized for integer-type options.
key | the key for this option |
value | the value for this option |
description | an optional description |
ConversionOption::ConversionOption | ( | const ConversionOption & | orig | ) |
Copy constructor; creates a copy of an ConversionOption object.
orig | the ConversionOption object to copy. |
SBMLConstructorException | Thrown if the argument orig is NULL . |
|
virtual |
Destroys this object.
|
virtual |
Creates and returns a deep copy of this ConversionOption object.
|
virtual |
Returns the value of this option as a Boolean.
|
virtual |
Returns the description string for this option.
|
virtual |
Returns the value of this option as a double
.
|
virtual |
Returns the value of this option as a float
.
|
virtual |
Returns the value of this option as an integer
.
|
virtual |
Returns the key for this option.
|
virtual |
Returns the type of this option.
|
virtual |
Returns the value of this option.
ConversionOption & ConversionOption::operator= | ( | const ConversionOption & | rhs | ) |
Assignment operator for ConversionOption.
rhs | The object whose values are used as the basis of the assignment. |
SBMLConstructorException | Thrown if the argument rhs is NULL . |
|
virtual |
Set the value of this option to a given Boolean value.
Invoking this method will also set the type of the option to CNV_TYPE_BOOL.
value | the Boolean value to set |
|
virtual |
Sets the description text for this option.
description | the description to set for this option. |
|
virtual |
Set the value of this option to a given double
value.
Invoking this method will also set the type of the option to CNV_TYPE_DOUBLE.
value | the value to set |
|
virtual |
Set the value of this option to a given float
value.
Invoking this method will also set the type of the option to CNV_TYPE_SINGLE.
value | the value to set |
|
virtual |
Set the value of this option to a given int
value.
Invoking this method will also set the type of the option to CNV_TYPE_INT.
value | the value to set |
|
virtual |
Sets the key for this option.
key | a string representing the key to set. |
|
virtual |
Sets the type of this option.
type | the type value to use. |
|
virtual |
Sets the value for this option.
value | the value to set, as a string. |