Enumeration to identify SBML objects at runtime.
- Author:
- Ben Bornstein
An enumeration of SBML types to help identify SBML objects at runtime.
Abstract types do not have a typecode since they cannot be instantiated.
(NOTES)
- Each typecode is used as a return value (int) of the following functions
(In libSBML 5, the type of return values in these functions have been changed from typecode (int) to int for extensibility.)
- Each pacakge extension must define similar enum type for each SBase subclass (e.g. SBMLLayoutTypeCode_t for the layout extension, SBMLGroupTypeCode_t for group extension).
- The value of each typecode can be duplicated between those of different packages.
- To distinguish the typecodes of different packages, not only the return value of getTypeCode() but also that of getPackageName() must be checked as follows:
void example (const SBase *sb) { cons std::string pkgName = sb->getPackageName(); if (pkgName == "core") { switch (sb->getTypeCode()) { case SBML_MODEL: .... break; case SBML_REACTION: .... } } else if (pkgName == "layout") { switch (sb->getTypeCode()) { case SBML_LAYOUT_LAYOUT: .... break; case SBML_LAYOUT_REACTIONGLYPH: .... } } ... }
- Enumerator:
| SBML_UNKNOWN |
|
| SBML_COMPARTMENT |
|
| SBML_COMPARTMENT_TYPE |
|
| SBML_CONSTRAINT |
|
| SBML_DOCUMENT |
|
| SBML_EVENT |
|
| SBML_EVENT_ASSIGNMENT |
|
| SBML_FUNCTION_DEFINITION |
|
| SBML_INITIAL_ASSIGNMENT |
|
| SBML_KINETIC_LAW |
|
| SBML_LIST_OF |
|
| SBML_MODEL |
|
| SBML_PARAMETER |
|
| SBML_REACTION |
|
| SBML_RULE |
|
| SBML_SPECIES |
|
| SBML_SPECIES_REFERENCE |
|
| SBML_SPECIES_TYPE |
|
| SBML_MODIFIER_SPECIES_REFERENCE |
|
| SBML_UNIT_DEFINITION |
|
| SBML_UNIT |
|
| SBML_ALGEBRAIC_RULE |
|
| SBML_ASSIGNMENT_RULE |
|
| SBML_RATE_RULE |
|
| SBML_SPECIES_CONCENTRATION_RULE |
|
| SBML_COMPARTMENT_VOLUME_RULE |
|
| SBML_PARAMETER_RULE |
|
| SBML_TRIGGER |
|
| SBML_DELAY |
|
| SBML_STOICHIOMETRY_MATH |
|
| SBML_LOCAL_PARAMETER |
|
| SBML_PRIORITY |
|