libSBML C++ API  5.18.0
UnitKind.h File Reference

Definition of SBML's UnitKind enumeration. More...

Include dependency graph for UnitKind.h:
This graph shows which files directly or indirectly include this file:

Enumerations

enum  UnitKind_t {
  UNIT_KIND_AMPERE,
  UNIT_KIND_AVOGADRO,
  UNIT_KIND_BECQUEREL,
  UNIT_KIND_CANDELA,
  UNIT_KIND_CELSIUS,
  UNIT_KIND_COULOMB,
  UNIT_KIND_DIMENSIONLESS,
  UNIT_KIND_FARAD,
  UNIT_KIND_GRAM,
  UNIT_KIND_GRAY,
  UNIT_KIND_HENRY,
  UNIT_KIND_HERTZ,
  UNIT_KIND_ITEM,
  UNIT_KIND_JOULE,
  UNIT_KIND_KATAL,
  UNIT_KIND_KELVIN,
  UNIT_KIND_KILOGRAM,
  UNIT_KIND_LITER,
  UNIT_KIND_LITRE,
  UNIT_KIND_LUMEN,
  UNIT_KIND_LUX,
  UNIT_KIND_METER,
  UNIT_KIND_METRE,
  UNIT_KIND_MOLE,
  UNIT_KIND_NEWTON,
  UNIT_KIND_OHM,
  UNIT_KIND_PASCAL,
  UNIT_KIND_RADIAN,
  UNIT_KIND_SECOND,
  UNIT_KIND_SIEMENS,
  UNIT_KIND_SIEVERT,
  UNIT_KIND_STERADIAN,
  UNIT_KIND_TESLA,
  UNIT_KIND_VOLT,
  UNIT_KIND_WATT,
  UNIT_KIND_WEBER,
  UNIT_KIND_INVALID
}
 Enumeration of predefined SBML base units. More...
 

Functions

int UnitKind_equals (UnitKind_t uk1, UnitKind_t uk2)
 Tests for logical equality between two given UNIT_KIND_ code values. More...
 
UnitKind_t UnitKind_forName (const char *name)
 Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value. More...
 
int UnitKind_isValidUnitKindString (const char *str, unsigned int level, unsigned int version)
 Predicate for testing whether a given string corresponds to a predefined libSBML unit code. More...
 
const char * UnitKind_toString (UnitKind_t uk)
 Converts a unit code to a text string equivalent. More...
 

Detailed Description

Definition of SBML's UnitKind enumeration.

Author
Ben Bornstein

Enumeration Type Documentation

enum UnitKind_t

Enumeration of predefined SBML base units.

For more information, please refer to the class documentation for Unit.

See also
UnitDefinition_t
Unit_t
Enumerator
UNIT_KIND_AMPERE 

Ampere ('A'); SI base unit of electrical current (I)

UNIT_KIND_AVOGADRO 

Avogadro; From the SBML specification, the unit 'dimensionless' multiplied with Avogadro's number

UNIT_KIND_BECQUEREL 

Bequerel ('Bq'); SI derived unit of radioactivity. Equivalent to s-1.

UNIT_KIND_CANDELA 

Candela ('cd'); SI base unit of luminous intensity

UNIT_KIND_CELSIUS 

Celsius ('°C'); unit of measurement for temperature. Can either mean a specific temperature on the Celsius scale, or can indicate a temperature interval. This duality of purpose makes it a poor choice for a unit and is only included for completeness; use UNIT_KIND_KELVIN instead.

UNIT_KIND_COULOMB 

Coulomb ('C'); SI derived unit of electric charge (Q); the charge transported by a constant current of one ampere in one second (A x s; also equivalent to F x V).

UNIT_KIND_DIMENSIONLESS 

Dimensionless; Having no explicit dimensionality, from the SBML specification. Sometimes used for counts of items. Not equivalent to unknown!

UNIT_KIND_FARAD 

Farad ('F'); SI derived unit of electric capacitance. Equivalent to s4 x A2 x m-2 x kg-1

UNIT_KIND_GRAM 

Gram ('g'); SI derived unit of mass. Equivalent to 10-3 kg

UNIT_KIND_GRAY 

Gray ('Gy'); SI derived unit of absorbed dose, specific energy (imparted) and of kerma. Equivalent to one m2 x m-2, or one J x kg-1.

UNIT_KIND_HENRY 

Henry ('H'); SI derived unit of inductance. Equivalent to m2 x kg x s-2 x A-2

UNIT_KIND_HERTZ 

Hertz ('Hz'); SI base unit of frequency; a number of cycles per second of a periodic phenomenon.

UNIT_KIND_ITEM 

Item; From the SBML specification, 'item' is used for expressing such things as 'N items' when 'mole' is not an appropriate unit

UNIT_KIND_JOULE 

Joule ('J'); The SI derived unit of energy. Equivalent to kg x m2 x s-2.

UNIT_KIND_KATAL 

Katal ('kat'); The SI derived unit of catalytic activity. Equivalent to mol x s-1.

UNIT_KIND_KELVIN 

Kelvin ('K'); SI base unit of temperature.

UNIT_KIND_KILOGRAM 

Kilogram ('kg'); SI base unit of mass.

UNIT_KIND_LITER 

Liter ('L'); American spelling of the SI unit 'litre'. Here solely to catch the misspelling; use UNIT_KIND_LITRE instead.

UNIT_KIND_LITRE 

Litre ('L'); non-SI metric system of volume. Equivalent to 103cm3.

UNIT_KIND_LUMEN 

Lumen ('lm'); SI derived unit of luminous flux. Equivalent to cd x sr.

UNIT_KIND_LUX 

Lux ('lx'); SI derived unit of luminous emittance. Equivalent to lm x m-2.

UNIT_KIND_METER 

Meter ('m'); American spelling of the SI unit 'metre'. Here solely to catch the misspelling; use UNIT_KIND_METRE instead.

UNIT_KIND_METRE 

Metre ('m'); SI base unit of length.

UNIT_KIND_MOLE 

Mole ('mol'); SI base unit of amount. Defined as the amount of any substance that contains as many elementary entities as there are atoms in 12 grams of pure Carbon-12, which corresponds to the Avogadro constant. See UNIT_KIND_AVOGADRO.

UNIT_KIND_NEWTON 

Newton ('N'); SI derived unit of force. Equivalent to one kg x m x sec-2.

UNIT_KIND_OHM 

Ohm ('Ω'); SI derived unit of electrical resistance. Equivalent to kg x m2 x s-3 x A-2.

UNIT_KIND_PASCAL 

Pascal ('Pa'); SI derived unit of pressure. Equivalent to kg x m-1 x s-2.

UNIT_KIND_RADIAN 

Radian ('rad'); SI derived unit of angular measure. Dimensionless; an angle's measurement in radians is numerically equal to the length of a corresponding arc of a unit circle.

UNIT_KIND_SECOND 

Second ('s'); SI base unit of time.

UNIT_KIND_SIEMENS 

Siemens ('S'); SI derived unit of electric conductance. Equivalent to A2 x s3 x kg-1 x m-2.

UNIT_KIND_SIEVERT 

Sievert ('Sv'); SI derived unit of equivalent radiation dose, effective dose, and committed dose. Equivalent to the UNIT_KIND_GRAY (m2 x m-2), but used to express the biological equivalent dose in human tissue.

UNIT_KIND_STERADIAN 

Steradian ('sr'); SI derived unit of solid angle. An angle's measurement in steradians is numerically equal to the area of the corresponding surface on a unit sphere. Like the radian, it is dimensionless, essentially because a solid angle is the ratio between the area subtended and the square of its distance from the vertex: both the numerator and denominator of this ratio have dimension length2. It is useful, however, to distinguish between dimensionless quantities of different nature, so in practice the symbol "sr" is used to indicate a solid angle..

UNIT_KIND_TESLA 

Tesla ('T'); SI derived unit of magnetic field strength or magnetic flux density. Equivalent to kg x A-1 x s-2.

UNIT_KIND_VOLT 

Volt ('V'); SI derived unit of electric potential. Equivalent to kg x m2 x A-1 x s-3.

UNIT_KIND_WATT 

Watt ('W'); SI derived unit of power. Equivalent to kg x m2 x s-3.

UNIT_KIND_WEBER 

Weber ('Wb'); SI derived unit of magnetic flux. Equivalent to kg x m2 x A-1 x s-2.

UNIT_KIND_INVALID 

An invalid unit. Used by libsbml when the 'unit' attribute of an element does not contain any allowed value.

Function Documentation

int UnitKind_equals ( UnitKind_t  uk1,
UnitKind_t  uk2 
)

Tests for logical equality between two given UNIT_KIND_ code values.

This function behaves exactly like C's == operator, except for the following two cases:

In the two cases above, C equality comparison would yield 0 (false) (because each of the above is a distinct enumeration value), but this function returns true.

Parameters
uk1a UNIT_KIND_ value.
uk2a second UNIT_KIND_ value to compare to uk1.
Returns
1 (true) if uk1 is logically equivalent to uk2, 0 (false) otherwise.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
UnitKind_t UnitKind_forName ( const char *  name)

Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value.

Parameters
namea string, the name of a predefined base unit in SBML.
Returns
a value from UnitKind_t corresponding to the given string name (determined in a case-insensitive manner).
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
int UnitKind_isValidUnitKindString ( const char *  str,
unsigned int  level,
unsigned int  version 
)

Predicate for testing whether a given string corresponds to a predefined libSBML unit code.

Parameters
stra text string naming a base unit defined by SBML.
levelthe Level of SBML.
versionthe Version within the Level of SBML.
Returns
1 (true) if string is the name of a valid UNIT_KIND_ value, 0 (false) otherwise.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
const char* UnitKind_toString ( UnitKind_t  uk)

Converts a unit code to a text string equivalent.

Parameters
uka value from the UnitKind_t enumeration
Returns
the name corresponding to the given unit code.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
Warning
The string returned is a static data value. The caller does not own the returned string and is therefore not allowed to modify it.