libSBML Perl API
libSBML 5.8.0 Perl API
|
Enumeration to identify SBML objects at runtime.
Enumerations | |
enum | SBMLTypeCode_t { SBML_UNKNOWN = 0, SBML_COMPARTMENT = 1, SBML_COMPARTMENT_TYPE = 2, SBML_CONSTRAINT = 3, SBML_DOCUMENT = 4, SBML_EVENT = 5, SBML_EVENT_ASSIGNMENT = 6, SBML_FUNCTION_DEFINITION = 7, SBML_INITIAL_ASSIGNMENT = 8, SBML_KINETIC_LAW = 9, SBML_LIST_OF = 10, SBML_MODEL = 11, SBML_PARAMETER = 12, SBML_REACTION = 13, SBML_RULE = 14, SBML_SPECIES = 15, SBML_SPECIES_REFERENCE = 16, SBML_SPECIES_TYPE = 17, SBML_MODIFIER_SPECIES_REFERENCE = 18, SBML_UNIT_DEFINITION = 19, SBML_UNIT = 20, SBML_ALGEBRAIC_RULE = 21, SBML_ASSIGNMENT_RULE = 22, SBML_RATE_RULE = 23, SBML_SPECIES_CONCENTRATION_RULE = 24, SBML_COMPARTMENT_VOLUME_RULE = 25, SBML_PARAMETER_RULE = 26, SBML_TRIGGER = 27, SBML_DELAY = 28, SBML_STOICHIOMETRY_MATH = 29, SBML_LOCAL_PARAMETER = 30, SBML_PRIORITY = 31 } |
An enumeration of SBML types to help identify SBML objects at runtime. More... | |
Functions | |
const char * | SBMLTypeCode_toString (int tc, const char *pkgName) |
This method takes an SBML type code and returns a string representing the code. More... | |
enum SBMLTypeCode_t |
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.)
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: .... } } ... }
const char* SBMLTypeCode_toString | ( | int | tc, |
const char * | pkgName | ||
) |
This method takes an SBML type code and returns a string representing the code.