Parameter.h File Reference

Detailed Description

Definitions of Parameter and ListOfParameters.

Author:
Ben Bornstein
Include dependency graph for Parameter.h:
This graph shows which files directly or indirectly include this file:

Functions

Parameter_t * ListOfParameters_getById (ListOf_t *lo, const char *sid)
Parameter_t * ListOfParameters_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.
Parameter_t * Parameter_clone (const Parameter_t *p)
 Creates a deep copy of the given Parameter_t structure.
Parameter_t * Parameter_create (unsigned int level, unsigned int version)
 Creates a new Parameter_t structure using the given SBML level and version values.
Parameter_t * Parameter_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new Parameter_t structure using the given SBMLNamespaces_t structure.
void Parameter_free (Parameter_t *p)
 Frees the given Parameter_t structure.
int Parameter_getConstant (const Parameter_t *p)
 Takes a Parameter_t structure and returns zero or nonzero, depending on the value of the parameter's "constant" attribute.
UnitDefinition_t * Parameter_getDerivedUnitDefinition (Parameter_t *p)
 Constructs and returns a UnitDefinition_t structure that expresses the units of this Parameter_t structure.
const char * Parameter_getId (const Parameter_t *p)
 Takes a Parameter_t structure and returns its identifier.
const char * Parameter_getName (const Parameter_t *p)
 Takes a Parameter_t structure and returns its name.
const XMLNamespaces_t * Parameter_getNamespaces (Parameter_t *c)
 Returns a list of XMLNamespaces_t associated with this Parameter_t structure.
const char * Parameter_getUnits (const Parameter_t *p)
 Takes a Parameter_t structure and returns its units.
double Parameter_getValue (const Parameter_t *p)
 Takes a Parameter_t structure and returns its value.
int Parameter_hasRequiredAttributes (Parameter_t *p)
 Predicate returning true or false depending on whether all the required attributes for this Parameter object have been set.
void Parameter_initDefaults (Parameter_t *p)
 Initializes the attributes of this Parameter_t structure to their defaults.
int Parameter_isSetConstant (const Parameter_t *p)
 Predicate returning true or false depending on whether the given Parameter_t structure's constant attribute have been set.
int Parameter_isSetId (const Parameter_t *p)
 Predicate returning true or false depending on whether the given Parameter_t structure's identifier is set.
int Parameter_isSetName (const Parameter_t *p)
 Predicate returning true or false depending on whether the given Parameter_t structure's name is set.
int Parameter_isSetUnits (const Parameter_t *p)
 Predicate returning true or false depending on whether the given Parameter_t structure's units have been set.
int Parameter_isSetValue (const Parameter_t *p)
 Predicate returning true or false depending on whether the given Parameter_t structure's value is set.
int Parameter_setConstant (Parameter_t *p, int value)
 Assign the "constant" attribute of a Parameter_t structure.
int Parameter_setId (Parameter_t *p, const char *sid)
 Assigns the identifier of a Parameter_t structure.
int Parameter_setName (Parameter_t *p, const char *name)
 Assign the name of a Parameter_t structure.
int Parameter_setUnits (Parameter_t *p, const char *units)
 Assign the units of a Parameter_t structure.
int Parameter_setValue (Parameter_t *p, double value)
 Assign the value of a Parameter_t structure.
int Parameter_unsetName (Parameter_t *p)
 Unsets the name of this Parameter_t structure.
int Parameter_unsetUnits (Parameter_t *p)
 Unsets the units of this Parameter_t structure.
int Parameter_unsetValue (Parameter_t *p)
 Unsets the value of this Parameter_t structure.

Function Documentation

Parameter_t* ListOfParameters_getById ( ListOf_t *  lo,
const char *  sid 
)
Returns:
item in this ListOfParameter with the given id or NULL if no such item exists.
Parameter_t* ListOfParameters_removeById ( ListOf_t *  lo,
const char *  sid 
)

Removes item in this ListOf items with the given id or NULL if no such item exists.

The caller owns the returned item and is responsible for deleting it.

Parameter_t* Parameter_clone ( const Parameter_t *  p)

Creates a deep copy of the given Parameter_t structure.

Parameters:
pthe Parameter_t structure to be copied
Returns:
a (deep) copy of the given Parameter_t structure.
Parameter_t* Parameter_create ( unsigned int  level,
unsigned int  version 
)

Creates a new Parameter_t structure using the given SBML level and version values.

Parameters:
levelan unsigned int, the SBML Level to assign to this Parameter
versionan unsigned int, the SBML Version to assign to this Parameter
Returns:
a pointer to the newly created Parameter_t structure.
Note:
Once a Parameter has been added to an SBMLDocument, the level and version for the document override those used to create the Parameter. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
Parameter_t* Parameter_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new Parameter_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this Parameter
Returns:
a pointer to the newly created Parameter_t structure.
Note:
Once a Parameter has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the Parameter. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
void Parameter_free ( Parameter_t *  p)

Frees the given Parameter_t structure.

Parameters:
pthe Parameter_t structure to be freed.
int Parameter_getConstant ( const Parameter_t *  p)

Takes a Parameter_t structure and returns zero or nonzero, depending on the value of the parameter's "constant" attribute.

Parameters:
pthe Parameter_t whose constant value is sought.
Returns:
the value of the "constant" attribute, with nonzero meaning true and zero meaning false.
UnitDefinition_t* Parameter_getDerivedUnitDefinition ( Parameter_t *  p)

Constructs and returns a UnitDefinition_t structure that expresses the units of this Parameter_t structure.

Parameters:
pthe Parameter_t structure whose units are to be returned.
Returns:
a UnitDefinition_t structure that expresses the units of this Parameter_t strucuture.
Note:
This function returns the units of the Parameter_t expressed as a UnitDefinition_t. The units may be those explicitly declared. In the case where no units have been declared, NULL is returned.
const char* Parameter_getId ( const Parameter_t *  p)

Takes a Parameter_t structure and returns its identifier.

Parameters:
pthe Parameter_t structure whose identifier is sought
Returns:
the identifier of this Parameter_t, as a pointer to a string.
const char* Parameter_getName ( const Parameter_t *  p)

Takes a Parameter_t structure and returns its name.

Parameters:
pthe Parameter_t whose name is sought.
Returns:
the name of this Parameter_t, as a pointer to a string.
const XMLNamespaces_t* Parameter_getNamespaces ( Parameter_t *  p)

Returns a list of XMLNamespaces_t associated with this Parameter_t structure.

Parameters:
pthe Parameter_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
const char* Parameter_getUnits ( const Parameter_t *  p)

Takes a Parameter_t structure and returns its units.

Parameters:
pthe Parameter_t whose units are sought.
Returns:
the units assigned to this Parameter_t structure, as a pointer to a string.
double Parameter_getValue ( const Parameter_t *  p)

Takes a Parameter_t structure and returns its value.

Parameters:
pthe Parameter_t whose value is sought.
Returns:
the value assigned to this Parameter_t structure, as a double.
int Parameter_hasRequiredAttributes ( Parameter_t *  p)

Predicate returning true or false depending on whether all the required attributes for this Parameter object have been set.

Parameters:
pthe Parameter_t structure to check.
Note:
The required attributes for a Parameter object are:
  • id (name in L1)
  • constant (in L3 only)
Returns:
a true if all the required attributes for this object have been defined, false otherwise.
void Parameter_initDefaults ( Parameter_t *  p)

Initializes the attributes of this Parameter_t structure to their defaults.

The exact results depends on the SBML Level and Version in use. The cases are currently the following:

  • (SBML Level 2 only) constant = 1 (true)
Parameters:
pthe Parameter_t structure to initialize
int Parameter_isSetConstant ( const Parameter_t *  p)

Predicate returning true or false depending on whether the given Parameter_t structure's constant attribute have been set.

Parameters:
pthe Parameter_t structure to query
Returns:
non-zero (true) if the "constant" attribute of the given Parameter_t structure is set, zero (false) otherwise.
int Parameter_isSetId ( const Parameter_t *  p)

Predicate returning true or false depending on whether the given Parameter_t structure's identifier is set.

Parameters:
pthe Parameter_t structure to query
Returns:
non-zero (true) if the "id" attribute of the given Parameter_t structure is set, zero (false) otherwise.
int Parameter_isSetName ( const Parameter_t *  p)

Predicate returning true or false depending on whether the given Parameter_t structure's name is set.

Parameters:
pthe Parameter_t structure to query
Returns:
non-zero (true) if the "name" attribute of the given Parameter_t structure is set, zero (false) otherwise.
int Parameter_isSetUnits ( const Parameter_t *  p)

Predicate returning true or false depending on whether the given Parameter_t structure's units have been set.

Parameters:
pthe Parameter_t structure to query
Returns:
non-zero (true) if the "units" attribute of the given Parameter_t structure is set, zero (false) otherwise.
int Parameter_isSetValue ( const Parameter_t *  p)

Predicate returning true or false depending on whether the given Parameter_t structure's value is set.

Parameters:
pthe Parameter_t structure to query
Returns:
non-zero (true) if the "value" attribute of the given Parameter_t structure is set, zero (false) otherwise.
Note:
In SBML Level 1 Version 1, a Parameter value is required and therefore should always be set. In Level 1 Version 2 and later, the value is optional, and as such, may or may not be set.
int Parameter_setConstant ( Parameter_t *  p,
int  value 
)

Assign the "constant" attribute of a Parameter_t structure.

Parameters:
pthe Parameter_t structure to set.
valuethe value to assign as the "constant" attribute of the parameter, either zero for false or nonzero for true.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
int Parameter_setId ( Parameter_t *  p,
const char *  sid 
)

Assigns the identifier of a Parameter_t structure.

This makes a copy of the string passed in the param sid.

Parameters:
pthe Parameter_t structure to set.
sidthe string to use as the identifier.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with an id of NULL is equivalent to unsetting the "id" attribute.
int Parameter_setName ( Parameter_t *  p,
const char *  name 
)

Assign the name of a Parameter_t structure.

This makes a copy of the string passed in as the argument name.

Parameters:
pthe Parameter_t structure to set.
namethe string to use as the name.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int Parameter_setUnits ( Parameter_t *  p,
const char *  units 
)

Assign the units of a Parameter_t structure.

This makes a copy of the string passed in as the argument units.

Parameters:
pthe Parameter_t structure to set.
unitsthe string to use as the identifier of the units to assign.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with units set to NULL is equivalent to unsetting the "units" attribute.
int Parameter_setValue ( Parameter_t *  p,
double  value 
)

Assign the value of a Parameter_t structure.

Parameters:
pthe Parameter_t structure to set.
valuethe double value to use.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int Parameter_unsetName ( Parameter_t *  p)

Unsets the name of this Parameter_t structure.

Parameters:
pthe Parameter_t structure whose name is to be unset.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Parameter_unsetUnits ( Parameter_t *  p)

Unsets the units of this Parameter_t structure.

Parameters:
pthe Parameter_t structure whose units are to be unset.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Parameter_unsetValue ( Parameter_t *  p)

Unsets the value of this Parameter_t structure.

In SBML Level 1 Version 1, a parameter is required to have a value and therefore this attribute should always be set. In Level 1 Version 2 and beyond, a value is optional, and as such, may or may not be set.

Parameters:
pthe Parameter_t structure whose value is to be unset.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines