Species.cpp File Reference

Detailed Description

Implementations of Species and ListOfSpecies.

Author:
Ben Bornstein
Include dependency graph for Species.cpp:

Functions

Species_t * ListOfSpecies_getById (ListOf_t *lo, const char *sid)
Species_t * ListOfSpecies_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.
Species_t * Species_clone (const Species_t *s)
 Creates a deep copy of the given Species_t structure.
Species_t * Species_create (unsigned int level, unsigned int version)
 Creates a new Species_t structure using the given SBML level and version values.
Species_t * Species_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new Species_t structure using the given SBMLNamespaces_t structure.
void Species_free (Species_t *s)
 Frees the given Species_t structure.
int Species_getBoundaryCondition (const Species_t *s)
 Get the value of the "boundaryCondition" attribute.
int Species_getCharge (const Species_t *s)
 Get the value of the "charge" attribute.
const char * Species_getCompartment (const Species_t *s)
 Get the compartment in which this species is located.
int Species_getConstant (const Species_t *s)
 Get the value of the "constant" attribute.
const char * Species_getConversionFactor (const Species_t *s)
 Get the value of the "conversionFactor" attribute.
UnitDefinition_t * Species_getDerivedUnitDefinition (Species_t *s)
 Constructs and returns a UnitDefinition_t structure that expresses the units of this Species_t structure.
int Species_getHasOnlySubstanceUnits (const Species_t *s)
 Get the value of the "hasOnlySubstanceUnits" attribute.
const char * Species_getId (const Species_t *s)
 Takes a Species_t structure and returns its identifier.
double Species_getInitialAmount (const Species_t *s)
 Get the value of the "initialAmount" attribute.
double Species_getInitialConcentration (const Species_t *s)
 Get the value of the "initialConcentration" attribute.
const char * Species_getName (const Species_t *s)
 Takes a Species_t structure and returns its name.
const XMLNamespaces_t * Species_getNamespaces (Species_t *s)
 Returns a list of XMLNamespaces_t associated with this Species_t structure.
const char * Species_getSpatialSizeUnits (const Species_t *s)
 Get the value of the "spatialSizeUnits" attribute.
const char * Species_getSpeciesType (const Species_t *s)
 Get the species type of this Species_t structure, as indicated by the Species_t structure object's "speciesType" attribute value.
const char * Species_getSubstanceUnits (const Species_t *s)
 Get the value of the "substanceUnit" attribute.
const char * Species_getUnits (const Species_t *s)
 (SBML Level 1 only) Get the value of the "units" attribute.
int Species_hasRequiredAttributes (Species_t *s)
 Predicate returning true or false depending on whether all the required attributes for this Species object have been set.
void Species_initDefaults (Species_t *s)
 Initializes the attributes of the given Species_t structure to the defaults defined in the specification of the relevant Level/Version of SBML.
int Species_isSetBoundaryCondition (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "boundaryCondition" of the given Species_t structure is set.
int Species_isSetCharge (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "charge" of the given Species_t structure is set.
int Species_isSetCompartment (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "compartment" of the given Species_t structure is set.
int Species_isSetConstant (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "constant" of the given Species_t structure is set.
int Species_isSetConversionFactor (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "conversionFactor" of the given Species_t structure is set.
int Species_isSetHasOnlySubstanceUnits (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "hasOnlySubstanceUnits" of the given Species_t structure is set.
int Species_isSetId (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "id" of the given Species_t structure is set.
int Species_isSetInitialAmount (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "initialAmount" of the given Species_t structure is set.
int Species_isSetInitialConcentration (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "compartment" of the given Species_t structure is set.
int Species_isSetName (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "name" of the given Species_t structure is set.
int Species_isSetSpatialSizeUnits (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "spatialSizeUnits" of the given Species_t structure is set.
int Species_isSetSpeciesType (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "speciesType" of the given Species_t structure is set.
int Species_isSetSubstanceUnits (const Species_t *s)
 Predicate returning true or false depending on whether the attribute "substanceUnits" of the given Species_t structure is set.
int Species_isSetUnits (const Species_t *s)
 (SBML Level 1 only) Predicate returning true or false depending on whether the attribute "units" of the given Species_t structure is set.
int Species_setBoundaryCondition (Species_t *s, int value)
 Sets the "boundaryCondition" attribute of the given Species_t structure.
int Species_setCharge (Species_t *s, int value)
 Sets the "charge" attribute of the given Species_t structure.
int Species_setCompartment (Species_t *s, const char *sid)
 Sets the "compartment" attribute of the given Species_t structure.
int Species_setConstant (Species_t *s, int value)
 Sets the "constant" attribute of the given Species_t structure.
int Species_setConversionFactor (Species_t *s, const char *sid)
 Sets the "conversionFactor" attribute of the given Species_t structure.
int Species_setHasOnlySubstanceUnits (Species_t *s, int value)
 Sets the "hasOnlySubstanceUnits" attribute of the given Species_t structure.
int Species_setId (Species_t *s, const char *sid)
 Sets the "id" attribute of the given Species_t structure.
int Species_setInitialAmount (Species_t *s, double value)
 Sets the "initialAmount" attribute value of the given Species_t structure.
int Species_setInitialConcentration (Species_t *s, double value)
 Sets the "initialConcentration" attribute value of the given Species_t structure.
int Species_setName (Species_t *s, const char *name)
 Sets the "name" attribute of the given Species_t structure.
int Species_setSpatialSizeUnits (Species_t *s, const char *sid)
 Sets the "spatialSizeUnits" attribute of the given Species_t structure.
int Species_setSpeciesType (Species_t *s, const char *sid)
 Sets the "speciesType" attribute of the given Species_t structure.
int Species_setSubstanceUnits (Species_t *s, const char *sid)
 Sets the "substanceUnits" attribute of the given Species_t structure.
int Species_setUnits (Species_t *s, const char *sname)
 (SBML Level 1 only) Sets the "units" attribute of the given Species_t structure.
int Species_unsetCharge (Species_t *s)
 Unsets the "charge" attribute of the given Species_t structure.
int Species_unsetConversionFactor (Species_t *s)
 Unsets the "conversionFactor" attribute of the given Species_t structure.
int Species_unsetInitialAmount (Species_t *s)
 Unsets the "initialAmount" attribute of the given Species_t structure.
int Species_unsetInitialConcentration (Species_t *s)
 Unsets the "initialConcentration" attribute of the given Species_t structure.
int Species_unsetName (Species_t *s)
 Unsets the "name" attribute of the given Species_t structure.
int Species_unsetSpatialSizeUnits (Species_t *s)
 Unsets the "spatialSizeUnits" attribute of the given Species_t structure.
int Species_unsetSpeciesType (Species_t *s)
 Unsets the "speciesType" attribute of the given Species_t structure.
int Species_unsetSubstanceUnits (Species_t *s)
 Unsets the "substanceUnits" attribute of the given Species_t structure.
int Species_unsetUnits (Species_t *s)
 Unsets the "units" attribute of the given Species_t structure.

Function Documentation

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

Species_t* Species_clone ( const Species_t *  s)

Creates a deep copy of the given Species_t structure.

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

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

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

Creates a new Species_t structure using the given SBMLNamespaces_t structure.

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

Frees the given Species_t structure.

Parameters:
sthe Species_t structure to be freed.
int Species_getBoundaryCondition ( const Species_t *  s)

Get the value of the "boundaryCondition" attribute.

Parameters:
sthe Species_t structure
Returns:
nonzero (true) if the given Species_t structure's "boundaryCondition" attribute value is nonzero, zero (0) otherwise.
int Species_getCharge ( const Species_t *  s)

Get the value of the "charge" attribute.

Parameters:
sthe Species_t structure
Returns:
the charge of the given Species_t structure.
Note:
Beginning in SBML Level 2 Version 2, the "charge" attribute on Species_t is deprecated and its use strongly discouraged. Its presence is considered a misfeature in earlier definitions of SBML because its implications for the mathematics of a model were never defined, and in any case, no known modeling system ever used it. Instead, models take account of charge values directly in their definitions of species by (for example) having separate species identities for the charged and uncharged versions of the same species. This allows the condition to affect model mathematics directly. LibSBML retains this method for easier compatibility with SBML Level 1.
const char* Species_getCompartment ( const Species_t *  s)

Get the compartment in which this species is located.

Parameters:
sthe Species_t structure
Returns:
the value of the "compartment" attribute of the given Species_t structure, as a string.
int Species_getConstant ( const Species_t *  s)

Get the value of the "constant" attribute.

Parameters:
sthe Species_t structure
Returns:
nonzero (true) if the given Species_t structure's "constant" attribute value is nonzero, false otherwise.
const char* Species_getConversionFactor ( const Species_t *  s)

Get the value of the "conversionFactor" attribute.

Parameters:
sthe Species_t structure
Returns:
the "conversionFactor" attribute of the given Species_t structure, as a string.
UnitDefinition_t* Species_getDerivedUnitDefinition ( Species_t *  s)

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

Parameters:
sthe Species_t structure whose units are to be returned.
Returns:
a UnitDefinition_t structure that expresses the units of this Species_t strucuture.
Note:
This function returns the units of the Species_t expressed as a UnitDefinition_t. The units may be those explicitly declared or those derived from the default units of the Model_t containing this Species_t and it's Compartment_t.

Note that the functionality that facilitates unit analysis depends on the model as a whole. Thus, in cases where the object has not been added to a model or the model itself is incomplete, unit analysis is not possible and this method will return NULL.

int Species_getHasOnlySubstanceUnits ( const Species_t *  s)

Get the value of the "hasOnlySubstanceUnits" attribute.

Parameters:
sthe Species_t structure
Returns:
nonzero (true) if the given Species_t structure's "hasOnlySubstanceUnits" attribute value is nonzero, zero (0) otherwise.
const char* Species_getId ( const Species_t *  s)

Takes a Species_t structure and returns its identifier.

Parameters:
sthe Species_t structure whose identifier is sought
Returns:
the identifier of the Species_t structure s, as a pointer to a string.
double Species_getInitialAmount ( const Species_t *  s)

Get the value of the "initialAmount" attribute.

Parameters:
sthe Species_t structure
Returns:
the "initialAmount" attribute of the given Species_t structure, as a float-point number.
double Species_getInitialConcentration ( const Species_t *  s)

Get the value of the "initialConcentration" attribute.

Parameters:
sthe Species_t structure
Returns:
the "initialConcentration" of the given Species_t structure, as a float-point number.
const char* Species_getName ( const Species_t *  s)

Takes a Species_t structure and returns its name.

Parameters:
sthe Species_t structure whose name is sought.
Returns:
the name of the Species_t structure s, as a pointer to a string.
const XMLNamespaces_t* Species_getNamespaces ( Species_t *  s)

Returns a list of XMLNamespaces_t associated with this Species_t structure.

Parameters:
sthe Species_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
const char* Species_getSpatialSizeUnits ( const Species_t *  s)

Get the value of the "spatialSizeUnits" attribute.

Parameters:
sthe Species_t structure
Returns:
the spatialSizeUnits of the given Species.
Warning:
In versions of SBML Level~2 before Version 3, the Species_t structure included an attribute called "spatialSizeUnits", which allowed explicitly setting the units of size for initial concentration. This attribute was removed in SBML Level 2 Version 3. LibSBML retains this attribute for compatibility with older definitions of Level 2, but its use is strongly discouraged because it is incompatible with Level 2 Versions 3 and 4.
const char* Species_getSpeciesType ( const Species_t *  s)

Get the species type of this Species_t structure, as indicated by the Species_t structure object's "speciesType" attribute value.

Parameters:
sthe Species_t structure
Returns:
the value of the "speciesType" attribute of the Species_t structure s as a string.
const char* Species_getSubstanceUnits ( const Species_t *  s)

Get the value of the "substanceUnit" attribute.

Parameters:
sthe Species_t structure
Returns:
the "substanceUnits" attribute of the given Species_t structure, as a string.
const char* Species_getUnits ( const Species_t *  s)

(SBML Level 1 only) Get the value of the "units" attribute.

Parameters:
sthe Species_t structure
Returns:
the units of the given Species_t structure.
int Species_hasRequiredAttributes ( Species_t *  s)

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

Parameters:
sthe Species_t structure to check.
Note:
The required attributes for a Species object are:
  • id (name L1)
  • compartment
  • initialAmount (L1 only)
  • hasOnlySubstanceUnits (L3 on)
  • boundaryCondition (L3 on)
  • constant (L3 on)
Returns:
a true if all the required attributes for this object have been defined, false otherwise.
void Species_initDefaults ( Species_t *  s)

Initializes the attributes of the given Species_t structure to the defaults defined in the specification of the relevant Level/Version of SBML.

  • sets "boundaryCondition" to 1 (true)
  • (Level 2 only) sets "constant" to 0 (false)
  • (Level 2 only) sets "hasOnlySubstanceUnits" to 0 (false)
Parameters:
sthe Species_t structure.
int Species_isSetBoundaryCondition ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "boundaryCondition" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "boundaryCondition" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetCharge ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "charge" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "charge" attribute of the given Species_t structure is set, false (0) otherwise.
Note:
Beginning in SBML Level 2 Version 2, the "charge" attribute on Species in SBML is deprecated and its use strongly discouraged. Its presence is considered a misfeature in earlier definitions of SBML because its implications for the mathematics of a model were never defined, and in any case, no known modeling system ever used it. Instead, models take account of charge values directly in their definitions of species by (for example) having separate species identities for the charged and uncharged versions of the same species. This allows the condition to affect model mathematics directly. LibSBML retains this method for easier compatibility with SBML Level 1.
int Species_isSetCompartment ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "compartment" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "compartment" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetConstant ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "constant" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "constant" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetConversionFactor ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "conversionFactor" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "conversionFactor" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetHasOnlySubstanceUnits ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "hasOnlySubstanceUnits" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "hasOnlySubstanceUnits" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetId ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "id" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "id" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetInitialAmount ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "initialAmount" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "initialAmount" attribute of the given Species_t structure is set, false (0) otherwise.
Note:
In SBML Level 1, Species_t' "initialAmount" is required and therefore should always be set. (However, in Level 1, the attribute has no default value either, so this method will not return nonzero until a value has been assigned.) In SBML Level 2, "initialAmount" is optional and as such may or may not be set.
int Species_isSetInitialConcentration ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "compartment" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "compartment" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetName ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "name" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "name" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetSpatialSizeUnits ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "spatialSizeUnits" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "spatialSizeUnits" attribute of the given Species_t structure is set, false (0) otherwise.
Warning:
In versions of SBML Level~2 before Version 3, the class Species included an attribute called "spatialSizeUnits", which allowed explicitly setting the units of size for initial concentration. This attribute was removed in SBML Level 2 Version 3. LibSBML retains this attribute for compatibility with older definitions of Level 2, but its use is strongly discouraged because it is incompatible with Level 2 Versions 3 and 4.
int Species_isSetSpeciesType ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "speciesType" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "speciesType" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetSubstanceUnits ( const Species_t *  s)

Predicate returning true or false depending on whether the attribute "substanceUnits" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "substanceUnits" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_isSetUnits ( const Species_t *  s)

(SBML Level 1 only) Predicate returning true or false depending on whether the attribute "units" of the given Species_t structure is set.

Parameters:
sthe Species_t structure
Returns:
true (nonzero) if the "units" attribute of the given Species_t structure is set, false (0) otherwise.
int Species_setBoundaryCondition ( Species_t *  s,
int  value 
)

Sets the "boundaryCondition" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure
valuenonzero to indicate true, zero to indicate false.
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 Species_setCharge ( Species_t *  s,
int  value 
)

Sets the "charge" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure
valuethe value of charge to assign to the "charge" 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
  • LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Beginning in SBML Level 2 Version 2, the "charge" attribute on Species in SBML is deprecated and its use strongly discouraged. Its presence is considered a misfeature in earlier definitions of SBML because its implications for the mathematics of a model were never defined, and in any case, no known modeling system ever used it. Instead, models take account of charge values directly in their definitions of species by (for example) having separate species identities for the charged and uncharged versions of the same species. This allows the condition to affect model mathematics directly. LibSBML retains this method for easier compatibility with SBML Level 1.
int Species_setCompartment ( Species_t *  s,
const char *  sid 
)

Sets the "compartment" attribute of the given Species_t structure.

This function copies the string given in compartment. If the string is NULL, this function performs unsetCompartment() instead.

Parameters:
sthe Species_t structure
sidthe identifer to which the "compartment" attribute should be set.
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 "compartment" attribute.
int Species_setConstant ( Species_t *  s,
int  value 
)

Sets the "constant" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure
valuenonzero to indicate true, zero to indicate false.
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 Species_setConversionFactor ( Species_t *  s,
const char *  sid 
)

Sets the "conversionFactor" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetConversionFactor() instead.

Parameters:
sthe Species_t structure
conversionFactorthe identifer to which the "conversionFactor" attribute should be set.
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 "conversionFactor" attribute.
int Species_setHasOnlySubstanceUnits ( Species_t *  s,
int  value 
)

Sets the "hasOnlySubstanceUnits" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure
valuenonzero to indicate true, zero to indicate false.
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 Species_setId ( Species_t *  s,
const char *  sid 
)

Sets the "id" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetId() instead.

Parameters:
sthe Species_t structure
sidthe identifier string to which the "id" attribute should be set.
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 Species_setInitialAmount ( Species_t *  s,
double  value 
)

Sets the "initialAmount" attribute value of the given Species_t structure.

As a side-effect, calling this function also unsets the "initialConcentration" attribute.

Parameters:
sthe Species_t structure
valuethe numerical value for the "initialAmount" 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 Species_setInitialConcentration ( Species_t *  s,
double  value 
)

Sets the "initialConcentration" attribute value of the given Species_t structure.

As a side-effect, calling this function also unsets the "initialAmount" attribute.

Parameters:
sthe Species_t structure
valuethe numerical value for the "initialConcentration" 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
  • LIBSBML_UNEXPECTED_ATTRIBUTE
int Species_setName ( Species_t *  s,
const char *  name 
)

Sets the "name" attribute of the given Species_t structure.

This function copies the string given in name. If the string is NULL, this function performs unsetName() instead.

Parameters:
sthe Species_t structure
namethe name string to which the "name" attribute should be set.
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 Species_setSpatialSizeUnits ( Species_t *  s,
const char *  sid 
)

Sets the "spatialSizeUnits" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetSpatialSizeUnits() instead.

Parameters:
sthe Species_t structure
spatialSizeUnitsthe identifer to which the "spatialSizeUnits" attribute should be set.
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 "spatialSizeUnits" attribute.
Warning:
In versions of SBML Level~2 before Version 3, the class Species included an attribute called "spatialSizeUnits", which allowed explicitly setting the units of size for initial concentration. This attribute was removed in SBML Level 2 Version 3. LibSBML retains this attribute for compatibility with older definitions of Level 2, but its use is strongly discouraged because it is incompatible with Level 2 Versions 3 and 4.
int Species_setSpeciesType ( Species_t *  s,
const char *  sid 
)

Sets the "speciesType" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetSpeciesType() instead.

Parameters:
sthe Species_t structure
speciesTypethe identifer to which the "speciesType" attribute should be set.
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 "speciesType" attribute.
int Species_setSubstanceUnits ( Species_t *  s,
const char *  sid 
)

Sets the "substanceUnits" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetSubstanceUnits() instead.

Parameters:
sthe Species_t structure
substanceUnitsthe identifer to which the "substanceUnits" attribute should be set.
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 "substanceUnits" attribute.
int Species_setUnits ( Species_t *  s,
const char *  sname 
)

(SBML Level 1 only) Sets the "units" attribute of the given Species_t structure.

This function copies the string given in sid. If the string is NULL, this function performs unsetUnits() instead.

Parameters:
sthe Species_t structure
unitsthe identifer to which the "units" attribute should be set.
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 "units" attribute.
int Species_unsetCharge ( Species_t *  s)

Unsets the "charge" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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
Note:
Beginning in SBML Level 2 Version 2, the "charge" attribute on Species in SBML is deprecated and its use strongly discouraged. Its presence is considered a misfeature in earlier definitions of SBML because its implications for the mathematics of a model were never defined, and in any case, no known modeling system ever used it. Instead, models take account of charge values directly in their definitions of species by (for example) having separate species identities for the charged and uncharged versions of the same species. This allows the condition to affect model mathematics directly. LibSBML retains this method for easier compatibility with SBML Level 1.
int Species_unsetConversionFactor ( Species_t *  s)

Unsets the "conversionFactor" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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 Species_unsetInitialAmount ( Species_t *  s)

Unsets the "initialAmount" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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
int Species_unsetInitialConcentration ( Species_t *  s)

Unsets the "initialConcentration" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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
int Species_unsetName ( Species_t *  s)

Unsets the "name" attribute of the given Species_t structure.

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 Species_unsetSpatialSizeUnits ( Species_t *  s)

Unsets the "spatialSizeUnits" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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
Warning:
In versions of SBML Level~2 before Version 3, the class Species included an attribute called "spatialSizeUnits", which allowed explicitly setting the units of size for initial concentration. This attribute was removed in SBML Level 2 Version 3. LibSBML retains this attribute for compatibility with older definitions of Level 2, but its use is strongly discouraged because it is incompatible with Level 2 Versions 3 and 4.
int Species_unsetSpeciesType ( Species_t *  s)

Unsets the "speciesType" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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 Species_unsetSubstanceUnits ( Species_t *  s)

Unsets the "substanceUnits" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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 Species_unsetUnits ( Species_t *  s)

Unsets the "units" attribute of the given Species_t structure.

Parameters:
sthe Species_t structure whose attribute 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
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines