LocalParameter.cpp File Reference

Detailed Description

Implementations of LocalLocalParameter and ListOfLocalLocalParameters.

Author:
Sarah Keating
Include dependency graph for LocalParameter.cpp:

Functions

LocalParameter_t * ListOfLocalParameters_getById (ListOf_t *lo, const char *sid)
LocalParameter_t * ListOfLocalParameters_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.
LocalParameter_t * LocalParameter_clone (const LocalParameter_t *p)
 Creates a deep copy of the given LocalParameter_t structure.
LocalParameter_t * LocalParameter_create (unsigned int level, unsigned int version)
 Creates a new LocalParameter_t structure using the given SBML level and version values.
LocalParameter_t * LocalParameter_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new LocalParameter_t structure using the given SBMLNamespaces_t structure.
void LocalParameter_free (LocalParameter_t *p)
 Frees the given LocalParameter_t structure.
UnitDefinition_t * LocalParameter_getDerivedUnitDefinition (LocalParameter_t *p)
 Constructs and returns a UnitDefinition_t structure that expresses the units of this LocalParameter_t structure.
const char * LocalParameter_getId (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its identifier.
const char * LocalParameter_getName (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its name.
const XMLNamespaces_t * LocalParameter_getNamespaces (LocalParameter_t *p)
 Returns a list of XMLNamespaces_t associated with this LocalParameter_t structure.
const char * LocalParameter_getUnits (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its units.
double LocalParameter_getValue (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its value.
int LocalParameter_hasRequiredAttributes (LocalParameter_t *p)
 Predicate returning true or false depending on whether all the required attributes for this LocalParameter object have been set.
int LocalParameter_isSetId (const LocalParameter_t *p)
 Predicate returning true or false depending on whether the given LocalParameter_t structure's identifier is set.
int LocalParameter_isSetName (const LocalParameter_t *p)
 Predicate returning true or false depending on whether the given LocalParameter_t structure's name is set.
int LocalParameter_isSetUnits (const LocalParameter_t *p)
 Predicate returning true or false depending on whether the given LocalParameter_t structure's units have been set.
int LocalParameter_isSetValue (const LocalParameter_t *p)
 Predicate returning true or false depending on whether the given LocalParameter_t structure's value is set.
int LocalParameter_setId (LocalParameter_t *p, const char *sid)
 Assigns the identifier of a LocalParameter_t structure.
int LocalParameter_setName (LocalParameter_t *p, const char *name)
 Assign the name of a LocalParameter_t structure.
int LocalParameter_setUnits (LocalParameter_t *p, const char *units)
 Assign the units of a LocalParameter_t structure.
int LocalParameter_setValue (LocalParameter_t *p, double value)
 Assign the value of a LocalParameter_t structure.
int LocalParameter_unsetName (LocalParameter_t *p)
 Unsets the name of this LocalParameter_t structure.
int LocalParameter_unsetUnits (LocalParameter_t *p)
 Unsets the units of this LocalParameter_t structure.
int LocalParameter_unsetValue (LocalParameter_t *p)
 Unsets the value of this LocalParameter_t structure.

Function Documentation

LocalParameter_t* ListOfLocalParameters_getById ( ListOf_t *  lo,
const char *  sid 
)
Returns:
item in this ListOfLocalParameter with the given id or NULL if no such item exists.
LocalParameter_t* ListOfLocalParameters_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.

LocalParameter_t* LocalParameter_clone ( const LocalParameter_t *  p)

Creates a deep copy of the given LocalParameter_t structure.

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

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

Parameters:
levelan unsigned int, the SBML Level to assign to this LocalParameter
versionan unsigned int, the SBML Version to assign to this LocalParameter
Returns:
a pointer to the newly created LocalParameter_t structure.
Note:
Once a LocalParameter has been added to an SBMLDocument, the level and version for the document override those used to create the LocalParameter. 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.
LocalParameter_t* LocalParameter_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new LocalParameter_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this LocalParameter
Returns:
a pointer to the newly created LocalParameter_t structure.
Note:
Once a LocalParameter has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the LocalParameter. 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 LocalParameter_free ( LocalParameter_t *  p)

Frees the given LocalParameter_t structure.

Parameters:
pthe LocalParameter_t structure to be freed.
UnitDefinition_t* LocalParameter_getDerivedUnitDefinition ( LocalParameter_t *  p)

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

Parameters:
pthe LocalParameter_t structure whose units are to be returned.
Returns:
a UnitDefinition_t structure that expresses the units of this LocalParameter_t strucuture.
Note:
This function returns the units of the LocalParameter_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* LocalParameter_getId ( const LocalParameter_t *  p)

Takes a LocalParameter_t structure and returns its identifier.

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

Takes a LocalParameter_t structure and returns its name.

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

Returns a list of XMLNamespaces_t associated with this LocalParameter_t structure.

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

Takes a LocalParameter_t structure and returns its units.

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

Takes a LocalParameter_t structure and returns its value.

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

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

Parameters:
pthe LocalParameter_t structure to check.
Note:
The required attributes for a LocalParameter object are:
  • id (name in L1)
Returns:
a true if all the required attributes for this object have been defined, false otherwise.
int LocalParameter_isSetId ( const LocalParameter_t *  p)

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

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

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

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

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

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

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

Parameters:
pthe LocalParameter_t structure to query
Returns:
non-zero (true) if the "value" attribute of the given LocalParameter_t structure is set, zero (false) otherwise.
Note:
In SBML Level 1 Version 1, a LocalParameter 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 LocalParameter_setId ( LocalParameter_t *  p,
const char *  sid 
)

Assigns the identifier of a LocalParameter_t structure.

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

Parameters:
pthe LocalParameter_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 LocalParameter_setName ( LocalParameter_t *  p,
const char *  name 
)

Assign the name of a LocalParameter_t structure.

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

Parameters:
pthe LocalParameter_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 LocalParameter_setUnits ( LocalParameter_t *  p,
const char *  units 
)

Assign the units of a LocalParameter_t structure.

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

Parameters:
pthe LocalParameter_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 LocalParameter_setValue ( LocalParameter_t *  p,
double  value 
)

Assign the value of a LocalParameter_t structure.

Parameters:
pthe LocalParameter_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 LocalParameter_unsetName ( LocalParameter_t *  p)

Unsets the name of this LocalParameter_t structure.

Parameters:
pthe LocalParameter_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 LocalParameter_unsetUnits ( LocalParameter_t *  p)

Unsets the units of this LocalParameter_t structure.

Parameters:
pthe LocalParameter_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 LocalParameter_unsetValue ( LocalParameter_t *  p)

Unsets the value of this LocalParameter_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 LocalParameter_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