Implementations of SBML's UnitDefinition and ListOfUnitDefinitions.

Functions | |
| UnitDefinition_t * | ListOfUnitDefinitions_getById (ListOf_t *lo, const char *sid) |
| UnitDefinition_t * | ListOfUnitDefinitions_removeById (ListOf_t *lo, const char *sid) |
Removes item in this ListOf items with the given id or NULL if no such item exists. | |
| int | UnitDefinition_addUnit (UnitDefinition_t *ud, const Unit_t *u) |
| Adds a copy of the given Unit to the given UnitDefinition_t structure. | |
| int | UnitDefinition_areEquivalent (UnitDefinition_t *ud1, UnitDefinition_t *ud2) |
| int | UnitDefinition_areIdentical (UnitDefinition_t *ud1, UnitDefinition_t *ud2) |
| UnitDefinition_t * | UnitDefinition_clone (const UnitDefinition_t *ud) |
| Creates and returns a deep copy of the given UnitDefinition_t structure. | |
| UnitDefinition_t * | UnitDefinition_combine (UnitDefinition_t *ud1, UnitDefinition_t *ud2) |
| UnitDefinition_t * | UnitDefinition_convertToSI (UnitDefinition_t *ud) |
| UnitDefinition_t * | UnitDefinition_create (unsigned int level, unsigned int version) |
Creates a new UnitDefinition_t structure using the given SBML level and version values. | |
| Unit_t * | UnitDefinition_createUnit (UnitDefinition_t *ud) |
| Creates a new and empty Unit_t structure, adds it to the given UnitDefinition_t structure's list of units, and returns the Unit_t structure. | |
| UnitDefinition_t * | UnitDefinition_createWithNS (SBMLNamespaces_t *sbmlns) |
| Creates a new UnitDefinition_t structure using the given SBMLNamespaces_t structure. | |
| void | UnitDefinition_free (UnitDefinition_t *ud) |
| Frees the given UnitDefinition_t. | |
| const char * | UnitDefinition_getId (const UnitDefinition_t *ud) |
| Returns the identifier of this UnitDefinition_t structure. | |
| ListOf_t * | UnitDefinition_getListOfUnits (UnitDefinition_t *ud) |
| Returns the list of Units for the given UnitDefinition_t structure. | |
| const char * | UnitDefinition_getName (const UnitDefinition_t *ud) |
| Returns the name of this UnitDefinition_t structure. | |
| const XMLNamespaces_t * | UnitDefinition_getNamespaces (UnitDefinition_t *ud) |
| Returns a list of XMLNamespaces_t associated with this UnitDefinition_t structure. | |
| unsigned int | UnitDefinition_getNumUnits (const UnitDefinition_t *ud) |
| Returns the number of Unit_t structures contained within this UnitDefinition_t. | |
| Unit_t * | UnitDefinition_getUnit (UnitDefinition_t *ud, unsigned int n) |
| Returns a specific Unit_t instance belonging to the given UnitDefinition_t structure. | |
| int | UnitDefinition_isSetId (const UnitDefinition_t *ud) |
Predicate to test whether the "id" attribute of the given UnitDefinition_t ud is set. | |
| int | UnitDefinition_isSetName (const UnitDefinition_t *ud) |
Predicate to test whether the "name" attribute of the given UnitDefinition_t ud is set. | |
| int | UnitDefinition_isVariantOfArea (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "area". | |
| int | UnitDefinition_isVariantOfDimensionless (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the unit "dimensionless". | |
| int | UnitDefinition_isVariantOfLength (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "length". | |
| int | UnitDefinition_isVariantOfMass (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "mass". | |
| int | UnitDefinition_isVariantOfSubstance (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "substance". | |
| int | UnitDefinition_isVariantOfSubstancePerTime (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "substance" divided by the built-in unit "time". | |
| int | UnitDefinition_isVariantOfTime (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "time". | |
| int | UnitDefinition_isVariantOfVolume (const UnitDefinition_t *ud) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "volume". | |
| const char * | UnitDefinition_printUnits (UnitDefinition_t *ud, int compact) |
| Unit_t * | UnitDefinition_removeUnit (UnitDefinition_t *ud, unsigned int n) |
| Removes the nth Unit_t object from this UnitDefinition_t object and returns a pointer to it. | |
| void | UnitDefinition_reorder (UnitDefinition_t *ud) |
| int | UnitDefinition_setId (UnitDefinition_t *ud, const char *id) |
| Sets the attribute "id" of the given UnitDefinition_t structure to a copy of the given string. | |
| int | UnitDefinition_setName (UnitDefinition_t *ud, const char *name) |
| Sets the attribute "name" of the given UnitDefinition_t structure to a copy of the given string. | |
| void | UnitDefinition_simplify (UnitDefinition_t *ud) |
| int | UnitDefinition_unsetName (UnitDefinition_t *ud) |
| Unsets the name of the given UnitDefinition_t structure. | |
| UnitDefinition_t* ListOfUnitDefinitions_getById | ( | ListOf_t * | lo, |
| const char * | sid | ||
| ) |
NULL if no such item exists. | UnitDefinition_t* ListOfUnitDefinitions_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.
| int UnitDefinition_addUnit | ( | UnitDefinition_t * | ud, |
| const Unit_t * | u | ||
| ) |
Adds a copy of the given Unit to the given UnitDefinition_t structure.
| ud | the UnitDefinition_t structure. |
| u | the Unit instance to add. |
| int UnitDefinition_areEquivalent | ( | UnitDefinition_t * | ud1, |
| UnitDefinition_t * | ud2 | ||
| ) |
| int UnitDefinition_areIdentical | ( | UnitDefinition_t * | ud1, |
| UnitDefinition_t * | ud2 | ||
| ) |
| UnitDefinition_t* UnitDefinition_clone | ( | const UnitDefinition_t * | ud | ) |
Creates and returns a deep copy of the given UnitDefinition_t structure.
| ud | the UnitDefinition_t structure to copy |
| UnitDefinition_t* UnitDefinition_combine | ( | UnitDefinition_t * | ud1, |
| UnitDefinition_t * | ud2 | ||
| ) |
| UnitDefinition_t* UnitDefinition_convertToSI | ( | UnitDefinition_t * | ud | ) |
| UnitDefinition_t* UnitDefinition_create | ( | unsigned int | level, |
| unsigned int | version | ||
| ) |
Creates a new UnitDefinition_t structure using the given SBML level and version values.
| level | an unsigned int, the SBML Level to assign to this UnitDefinition |
| version | an unsigned int, the SBML Version to assign to this UnitDefinition |
level and version for the document override those used to create the UnitDefinition. 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. | Unit_t* UnitDefinition_createUnit | ( | UnitDefinition_t * | ud | ) |
Creates a new and empty Unit_t structure, adds it to the given UnitDefinition_t structure's list of units, and returns the Unit_t structure.
| UnitDefinition_t* UnitDefinition_createWithNS | ( | SBMLNamespaces_t * | sbmlns | ) |
Creates a new UnitDefinition_t structure using the given SBMLNamespaces_t structure.
| sbmlns | SBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this UnitDefinition |
sbmlns namespaces for the document override those used to create the UnitDefinition. 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 UnitDefinition_free | ( | UnitDefinition_t * | ud | ) |
Frees the given UnitDefinition_t.
| const char* UnitDefinition_getId | ( | const UnitDefinition_t * | ud | ) |
Returns the identifier of this UnitDefinition_t structure.
| ud | the UnitDefinition_t whose identifier is sought |
| ListOf_t* UnitDefinition_getListOfUnits | ( | UnitDefinition_t * | ud | ) |
Returns the list of Units for the given UnitDefinition_t structure.
| ud | the UnitDefinition_t to use |
| const char* UnitDefinition_getName | ( | const UnitDefinition_t * | ud | ) |
Returns the name of this UnitDefinition_t structure.
| ud | the UnitDefinition_t whose name is sought |
| const XMLNamespaces_t* UnitDefinition_getNamespaces | ( | UnitDefinition_t * | ud | ) |
Returns a list of XMLNamespaces_t associated with this UnitDefinition_t structure.
| ud | the UnitDefinition_t structure |
| unsigned int UnitDefinition_getNumUnits | ( | const UnitDefinition_t * | ud | ) |
Returns the number of Unit_t structures contained within this UnitDefinition_t.
| ud | the UnitDefinition_t structure in question |
| Unit_t* UnitDefinition_getUnit | ( | UnitDefinition_t * | ud, |
| unsigned int | n | ||
| ) |
Returns a specific Unit_t instance belonging to the given UnitDefinition_t structure.
| ud | the UnitDefinition_t structure in question |
| n | an integer, the index of the Unit_t structure to be returned. |
| int UnitDefinition_isSetId | ( | const UnitDefinition_t * | ud | ) |
Predicate to test whether the "id" attribute of the given UnitDefinition_t ud is set.
| ud | the UnitDefinition_t to query. |
| int UnitDefinition_isSetName | ( | const UnitDefinition_t * | ud | ) |
Predicate to test whether the "name" attribute of the given UnitDefinition_t ud is set.
| ud | the UnitDefinition_t to query. |
| int UnitDefinition_isVariantOfArea | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "area".
| ud | the UnitDefinition_t to query. |
true if the UnitDefinition_t structure ud is a variant of the built-in unit area, meaning square metres with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfDimensionless | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the unit "dimensionless".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of dimensionless, meaning dimensionless with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfLength | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "length".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition_t is a variant of the built-in unit length, meaning metres with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfMass | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "mass".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of mass, meaning gram or kilogram with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfSubstance | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "substance".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of the built-in unit substance, meaning moles or items with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfSubstancePerTime | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "substance" divided by the built-in unit "time".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of the built-in unit substance per built-in unit time, meaning it contains two units one of which is a variant of substance and the other is a variant of time which an exponent of -1; false otherwise. | int UnitDefinition_isVariantOfTime | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "time".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of the built-in unit time, meaning seconds with only abritrary variations in scale or multiplier values; false otherwise. | int UnitDefinition_isVariantOfVolume | ( | const UnitDefinition_t * | ud | ) |
Convenience function for testing if a given unit definition is a variant of the built-in unit "volume".
| ud | the UnitDefinition_t to query. |
true if this UnitDefinition is a variant of the built-in unit volume, meaning litre or cubic metre with only abritrary variations in scale or multiplier values; false otherwise. | const char* UnitDefinition_printUnits | ( | UnitDefinition_t * | ud, |
| int | compact | ||
| ) |
| Unit_t* UnitDefinition_removeUnit | ( | UnitDefinition_t * | ud, |
| unsigned int | n | ||
| ) |
Removes the nth Unit_t object from this UnitDefinition_t object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
| m | the UnitDefinition_t structure |
| n | the integer index of the Unit_t sought |
NULL is returned if the given index is out of range. | void UnitDefinition_reorder | ( | UnitDefinition_t * | ud | ) |
| int UnitDefinition_setId | ( | UnitDefinition_t * | ud, |
| const char * | id | ||
| ) |
Sets the attribute "id" of the given UnitDefinition_t structure to a copy of the given string.
| ud | the UnitDefinition_t structure whose id is to be set |
| id | a string, the new identifier for the UnitDefinition_t structure |
| int UnitDefinition_setName | ( | UnitDefinition_t * | ud, |
| const char * | name | ||
| ) |
Sets the attribute "name" of the given UnitDefinition_t structure to a copy of the given string.
| ud | the UnitDefinition_t structure whose name is to be set |
| name | a string, the new name for the UnitDefinition_t structure |
| void UnitDefinition_simplify | ( | UnitDefinition_t * | ud | ) |
| int UnitDefinition_unsetName | ( | UnitDefinition_t * | ud | ) |
Unsets the name of the given UnitDefinition_t structure.
| ud | the UnitDefinition_t whose name is to be unset. |