SpeciesReference.cpp File Reference

Detailed Description

Include dependency graph for SpeciesReference.cpp:

Functions

SpeciesReference_t * ListOfSpeciesReferences_getById (ListOf_t *lo, const char *sid)
SpeciesReference_t * ListOfSpeciesReferences_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.
SpeciesReference_t * SpeciesReference_clone (const SpeciesReference_t *sr)
 Creates and returns a deep copy of the given SpeciesReference_t structure.
SpeciesReference_t * SpeciesReference_create (unsigned int level, unsigned int version)
 Creates a new SpeciesReference_t structure using the given SBML level and version values.
SpeciesReference_t * SpeciesReference_createModifier (unsigned int level, unsigned int version)
 Creates a new ModifierSpeciesReference (SpeciesReference_t) structure using the given SBMLNamespaces_t structure.
SpeciesReference_t * SpeciesReference_createModifierWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new ModifierSpeciesReference (SpeciesReference_t) structure using the given SBMLNamespaces_t structure.
StoichiometryMath_t * SpeciesReference_createStoichiometryMath (SpeciesReference_t *sr)
SpeciesReference_t * SpeciesReference_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new SpeciesReference_t structure using the given SBMLNamespaces_t structure.
void SpeciesReference_free (SpeciesReference_t *sr)
 Frees the given SpeciesReference_t structure.
int SpeciesReference_getConstant (const SpeciesReference_t *sr)
 Get the value of the "constant" attribute.
int SpeciesReference_getDenominator (const SpeciesReference_t *sr)
 Get the value of the "denominator" attribute, for the case of a rational-numbered stoichiometry or a model in SBML Level 1.
const char * SpeciesReference_getId (const SpeciesReference_t *sr)
 Get the value of the "id" attribute of the given SpeciesReference_t structure.
const char * SpeciesReference_getName (const SpeciesReference_t *sr)
 Get the value of the "name" attribute of the given SpeciesReference_t structure.
const XMLNamespaces_t * SpeciesReference_getNamespaces (SpeciesReference_t *sr)
 Returns a list of XMLNamespaces_t associated with this SpeciesReference_t structure.
const char * SpeciesReference_getSpecies (const SpeciesReference_t *sr)
 Get the value of the "species" attribute of the given SpeciesReference_t structure.
double SpeciesReference_getStoichiometry (const SpeciesReference_t *sr)
 Get the value of the "stoichiometry" attribute of the given SpeciesReference_t structure.
StoichiometryMath_t * SpeciesReference_getStoichiometryMath (SpeciesReference_t *sr)
 Get the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.
int SpeciesReference_hasRequiredAttributes (SpeciesReference_t *sr)
 Predicate returning true or false depending on whether all the required attributes for this SpeciesReference object have been set.
void SpeciesReference_initDefaults (SpeciesReference_t *sr)
 Initializes the attributes of the given SpeciesReference_t structure to their defaults:
int SpeciesReference_isModifier (const SpeciesReference_t *sr)
 Predicate returning true or false depending on whether the given SpeciesReference_t structure is a modifier.
int SpeciesReference_isSetConstant (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "constant" attribute of the given SpeciesReference_t structure is set.
int SpeciesReference_isSetId (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "id" attribute of the given SpeciesReference_t structure is set.
int SpeciesReference_isSetName (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "name" attribute of the given SpeciesReference_t structure is set.
int SpeciesReference_isSetSpecies (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "species" attribute of the given SpeciesReference_t structure is set.
int SpeciesReference_isSetStoichiometry (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "stoichiometry" attribute of the given SpeciesReference_t structure is set.
int SpeciesReference_isSetStoichiometryMath (const SpeciesReference_t *sr)
 Predicate returning nonzero (for true) or zero (for false) depending on whether the "stoichiometryMath" subelement of the given SpeciesReference_t structure is non-empty.
int SpeciesReference_setConstant (SpeciesReference_t *sr, int value)
 Assign the "constant" attribute of a SpeciesReference_t structure.
int SpeciesReference_setDenominator (SpeciesReference_t *sr, int value)
 Sets the value of the "denominator" attribute of the given SpeciesReference_t structure.
int SpeciesReference_setId (SpeciesReference_t *sr, const char *sid)
 Sets the value of the "id" attribute of the given SpeciesReference_t structure.
int SpeciesReference_setName (SpeciesReference_t *sr, const char *name)
 Sets the value of the "name" attribute of the given SpeciesReference_t structure.
int SpeciesReference_setSpecies (SpeciesReference_t *sr, const char *sid)
 Sets the value of the "species" attribute of the given SpeciesReference_t structure.
int SpeciesReference_setStoichiometry (SpeciesReference_t *sr, double value)
 Sets the value of the "stoichiometry" attribute of the given SpeciesReference_t structure.
int SpeciesReference_setStoichiometryMath (SpeciesReference_t *sr, const StoichiometryMath_t *math)
 Sets the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.
int SpeciesReference_unsetId (SpeciesReference_t *sr)
 Unsets the value of the "id" attribute of the given SpeciesReference_t structure.
int SpeciesReference_unsetName (SpeciesReference_t *sr)
 Unsets the value of the "name" attribute of the given SpeciesReference_t structure.
int SpeciesReference_unsetStoichiometry (SpeciesReference_t *sr)
 Unsets the content of the "stoichiometry" attribute of the given SpeciesReference_t structure.
int SpeciesReference_unsetStoichiometryMath (SpeciesReference_t *sr)
 Unsets the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.

Function Documentation

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

SpeciesReference_t* SpeciesReference_clone ( const SpeciesReference_t *  sr)

Creates and returns a deep copy of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
a (deep) copy of this SpeciesReference_t.
SpeciesReference_t* SpeciesReference_create ( unsigned int  level,
unsigned int  version 
)

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

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

Creates a new ModifierSpeciesReference (SpeciesReference_t) structure using the given SBMLNamespaces_t structure.

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

Creates a new ModifierSpeciesReference (SpeciesReference_t) structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this ModifierSpeciesReference
Returns:
a pointer to the newly created SpeciesReference_t structure.
Note:
Once a ModifierSpeciesReference has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the ModifierSpeciesReference. 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.
StoichiometryMath_t* SpeciesReference_createStoichiometryMath ( SpeciesReference_t *  sr)
SpeciesReference_t* SpeciesReference_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new SpeciesReference_t structure using the given SBMLNamespaces_t structure.

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

Frees the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure.
int SpeciesReference_getConstant ( const SpeciesReference_t *  sr)

Get the value of the "constant" attribute.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the constant attribute of this SpeciesReference.
int SpeciesReference_getDenominator ( const SpeciesReference_t *  sr)

Get the value of the "denominator" attribute, for the case of a rational-numbered stoichiometry or a model in SBML Level 1.

The "denominator" attribute is only actually written out in the case of an SBML Level 1 model. In SBML Level 2, rational-number stoichiometries are written as MathML elements in the "stoichiometryMath" subelement. However, as a convenience to users, libSBML allows the creation and manipulation of rational-number stoichiometries by supplying the numerator and denominator directly rather than having to manually create an ASTNode structure. LibSBML will write out the appropriate constructs (either a combination of "stoichiometry" and "denominator" in the case of SBML Level 1, or a "stoichiometryMath" subelement in the case of SBML Level 2).

This function returns 0 if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the denominator of this SpeciesReference.
const char* SpeciesReference_getId ( const SpeciesReference_t *  sr)

Get the value of the "id" attribute of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the identifier of the SpeciesReference_t instance.
const char* SpeciesReference_getName ( const SpeciesReference_t *  sr)

Get the value of the "name" attribute of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the name of the SpeciesReference_t instance.
const XMLNamespaces_t* SpeciesReference_getNamespaces ( SpeciesReference_t *  sr)

Returns a list of XMLNamespaces_t associated with this SpeciesReference_t structure.

Parameters:
srthe SpeciesReference_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
const char* SpeciesReference_getSpecies ( const SpeciesReference_t *  sr)

Get the value of the "species" attribute of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the "species" attribute value
double SpeciesReference_getStoichiometry ( const SpeciesReference_t *  sr)

Get the value of the "stoichiometry" attribute of the given SpeciesReference_t structure.

This function returns zero if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the "stoichiometry" attribute value
StoichiometryMath_t* SpeciesReference_getStoichiometryMath ( SpeciesReference_t *  sr)

Get the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.

This function returns NULL if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
the stoichiometryMath of this SpeciesReference.
int SpeciesReference_hasRequiredAttributes ( SpeciesReference_t *  sr)

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

Parameters:
pthe SpeciesReference_t structure to check.
Note:
The required attributes for a SpeciesReference object are:
  • species
  • constant (in L3 only)
Returns:
a true if all the required attributes for this object have been defined, false otherwise.
void SpeciesReference_initDefaults ( SpeciesReference_t *  sr)

Initializes the attributes of the given SpeciesReference_t structure to their defaults:

  • stoichiometry is set to 1
  • denominator is set to 1

This function has no effect if the SpeciesReference_t structure is a modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
int SpeciesReference_isModifier ( const SpeciesReference_t *  sr)

Predicate returning true or false depending on whether the given SpeciesReference_t structure is a modifier.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if this SpeciesReference_t represents a modifier species, zero (0)if it is a plain SpeciesReference.
int SpeciesReference_isSetConstant ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "constant" attribute of the given SpeciesReference_t structure is set.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "constant" attribute of given SpeciesReference_t structure is set, zero (0) otherwise.
int SpeciesReference_isSetId ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "id" attribute of the given SpeciesReference_t structure is set.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "id" attribute of given SpeciesReference_t structure is set, zero (0) otherwise.
int SpeciesReference_isSetName ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "name" attribute of the given SpeciesReference_t structure is set.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "name" attribute of given SpeciesReference_t structure is set, zero (0) otherwise.
int SpeciesReference_isSetSpecies ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "species" attribute of the given SpeciesReference_t structure is set.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "species" attribute of given SpeciesReference_t structure is set, zero (0) otherwise.
int SpeciesReference_isSetStoichiometry ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "stoichiometry" attribute of the given SpeciesReference_t structure is set.

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "stoichiometry" attribute of given SpeciesReference_t structure is set, zero (0) otherwise.
int SpeciesReference_isSetStoichiometryMath ( const SpeciesReference_t *  sr)

Predicate returning nonzero (for true) or zero (for false) depending on whether the "stoichiometryMath" subelement of the given SpeciesReference_t structure is non-empty.

This function returns false if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
Returns:
nonzero if the "stoichiometryMath" subelement has content, zero (0) otherwise.
int SpeciesReference_setConstant ( SpeciesReference_t *  sr,
int  value 
)

Assign the "constant" attribute of a SpeciesReference_t structure.

Parameters:
pthe SpeciesReference_t structure to set.
valuethe value to assign as the "constant" attribute of the speciesReference, 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 SpeciesReference_setDenominator ( SpeciesReference_t *  sr,
int  value 
)

Sets the value of the "denominator" attribute of the given SpeciesReference_t structure.

The "denominator" attribute is only actually written out in the case of an SBML Level 1 model. In SBML Level 2, rational-number stoichiometries are written as MathML elements in the "stoichiometryMath" subelement. However, as a convenience to users, libSBML allows the creation and manipulation of rational-number stoichiometries by supplying the numerator and denominator directly rather than having to manually create an ASTNode structure. LibSBML will write out the appropriate constructs (either a combination of "stoichiometry" and "denominator" in the case of SBML Level 1, or a "stoichiometryMath" subelement in the case of SBML Level 2).

This function has no effect if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
valueThe value to assign to the "denominator" attribute.
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 SpeciesReference_setId ( SpeciesReference_t *  sr,
const char *  sid 
)

Sets the value of the "id" attribute of the given SpeciesReference_t structure.

The string in sid will be copied.

Parameters:
srThe SpeciesReference_t structure to use.
sidThe identifier string that will be copied and assigned as the "id" attribute value.
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
  • LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Using this function with an id of NULL is equivalent to unsetting the "id" attribute.
int SpeciesReference_setName ( SpeciesReference_t *  sr,
const char *  name 
)

Sets the value of the "name" attribute of the given SpeciesReference_t structure.

The string in sid will be copied.

Parameters:
srThe SpeciesReference_t structure to use.
sidThe identifier string that will be copied and assigned as the "name" attribute value.
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
  • LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int SpeciesReference_setSpecies ( SpeciesReference_t *  sr,
const char *  sid 
)

Sets the value of the "species" attribute of the given SpeciesReference_t structure.

The string in sid will be copied.

Parameters:
srThe SpeciesReference_t structure to use.
sidThe identifier string that will be copied and assigned as the "species" attribute value.
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 "species" attribute.
int SpeciesReference_setStoichiometry ( SpeciesReference_t *  sr,
double  value 
)

Sets the value of the "stoichiometry" attribute of the given SpeciesReference_t structure.

This function has no effect if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
valueThe value to assign to the "stoichiometry" attribute.
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 SpeciesReference_setStoichiometryMath ( SpeciesReference_t *  sr,
const StoichiometryMath_t *  math 
)

Sets the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.

This function has no effect if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure to use.
mathAn ASTNode expression tree to use as the content of the "stoichiometryMath" subelement.
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
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
int SpeciesReference_unsetId ( SpeciesReference_t *  sr)

Unsets the value of the "id" attribute of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure 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
  • LIBSBML_OPERATION_FAILED
int SpeciesReference_unsetName ( SpeciesReference_t *  sr)

Unsets the value of the "name" attribute of the given SpeciesReference_t structure.

Parameters:
srThe SpeciesReference_t structure 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
  • LIBSBML_OPERATION_FAILED
int SpeciesReference_unsetStoichiometry ( SpeciesReference_t *  sr)

Unsets the content of the "stoichiometry" attribute of the given SpeciesReference_t structure.

This function has no effect if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure 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
  • LIBSBML_OPERATION_FAILED
int SpeciesReference_unsetStoichiometryMath ( SpeciesReference_t *  sr)

Unsets the content of the "stoichiometryMath" subelement of the given SpeciesReference_t structure.

This function has no effect if the SpeciesReference_t structure is a Modifer (see SpeciesReference_isModifier()).

Parameters:
srThe SpeciesReference_t structure 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
  • LIBSBML_OPERATION_FAILED
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines