libSBML C++ API  5.20.2
FbcExtension.h File Reference

Definition of FbcExtension, the core module of fbc package. More...

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

Classes

class  FbcExtension
 

Macros

#define FBC_CREATE_NS(variable, sbmlns)    EXTENSION_CREATE_NS(FbcPkgNamespaces, variable, sbmlns);
 
#define FBC_CREATE_NS_WITH_VERSION(variable, sbmlns, version)    EXTENSION_CREATE_NS_WITH_VERSION(FbcPkgNamespaces, variable, sbmlns, version);
 

Typedefs

typedef SBMLExtensionNamespaces< FbcExtensionFbcPkgNamespaces
 

Enumerations

enum  FbcVariableType_t {
  FBC_VARIABLE_TYPE_LINEAR ,
  FBC_VARIABLE_TYPE_QUADRATIC ,
  FBC_VARIABLE_TYPE_INVALID
}
 Enumeration of values permitted as the value of the "fbcvariabletype" attribute on Fbc objects. More...
 
enum  SBMLFbcTypeCode_t {
  SBML_FBC_V1ASSOCIATION = 800 ,
  SBML_FBC_FLUXBOUND = 801 ,
  SBML_FBC_FLUXOBJECTIVE = 802 ,
  SBML_FBC_GENEASSOCIATION = 803 ,
  SBML_FBC_OBJECTIVE = 804 ,
  SBML_FBC_ASSOCIATION = 805 ,
  SBML_FBC_GENEPRODUCTASSOCIATION = 806 ,
  SBML_FBC_GENEPRODUCT = 807 ,
  SBML_FBC_GENEPRODUCTREF = 808 ,
  SBML_FBC_AND = 809 ,
  SBML_FBC_OR = 810 ,
  SBML_FBC_USERDEFINEDCONSTRAINTCOMPONENT = 811 ,
  SBML_FBC_USERDEFINEDCONSTRAINT = 812 ,
  SBML_FBC_KEYVALUEPAIR = 813
}
 SBMLFbcTypeCode_t Enumeration of possible types in the libSBML “fbc” package implementation. More...
 

Functions

FbcVariableType_t FbcVariableType_fromString (const char *code)
 Returns the FbcVariableType_t enumeration corresponding to the given string or FBC_VARIABLE_TYPE_INVALID if there is no such match. More...
 
int FbcVariableType_isValid (FbcVariableType_t fvt)
 Predicate returning 1 (true) or 0 (false) depending on whether the given FbcVariableType_t is valid. More...
 
int FbcVariableType_isValidString (const char *code)
 Predicate returning 1 (true) or 0 (false) depending on whether the given string is a valid FbcVariableType_t. More...
 
const char * FbcVariableType_toString (FbcVariableType_t fvt)
 Returns the string version of the provided FbcVariableType_t enumeration. More...
 

Detailed Description

Definition of FbcExtension, the core module of fbc package.

Author
Frank T. Bergmann

Macro Definition Documentation

◆ FBC_CREATE_NS

#define FBC_CREATE_NS (   variable,
  sbmlns 
)     EXTENSION_CREATE_NS(FbcPkgNamespaces, variable, sbmlns);

◆ FBC_CREATE_NS_WITH_VERSION

#define FBC_CREATE_NS_WITH_VERSION (   variable,
  sbmlns,
  version 
)     EXTENSION_CREATE_NS_WITH_VERSION(FbcPkgNamespaces, variable, sbmlns, version);

Typedef Documentation

◆ FbcPkgNamespaces

Enumeration Type Documentation

◆ FbcVariableType_t

Enumeration of values permitted as the value of the "fbcvariabletype" attribute on Fbc objects.

See also
Fbc::getFbcvariabletype()
Fbc::setFbcvariabletype()
Enumerator
FBC_VARIABLE_TYPE_LINEAR 

The fbc fbcvariabletype is "linear".

FBC_VARIABLE_TYPE_QUADRATIC 

The fbc fbcvariabletype is "quadratic".

FBC_VARIABLE_TYPE_INVALID 

Invalid FbcVariableType value.

◆ SBMLFbcTypeCode_t

SBMLFbcTypeCode_t Enumeration of possible types in the libSBML “fbc” package implementation.

LibSBML attaches an identifying code to every kind of SBML object. These are integer constants known as SBML type codes. The names of all the codes begin with the characters SBML_. The set of possible type codes for core elements is defined in the enumeration SBMLTypeCode_t, and in addition, libSBML plug-ins for SBML Level 3 packages define their own extra enumerations of type codes (e.g., SBMLLayoutTypeCode_t for the Level 3 Layout package). Note that different Level 3 package plug-ins may use overlapping type codes; to identify the package to which a given object belongs, call the SBase::getPackageName() method on the object.

The exception to this is lists: all SBML-style list elements have the type SBML_LIST_OF, regardless of what package they are from.

Here follow some additional general information about libSBML type codes:
  • The codes are the possible return values (integers) for the following functions: (Compatibility note: in libSBML 5, the type of return values of these functions changed from an enumeration to an integer for extensibility in the face of different programming languages.)
  • Each package extension must define similar sets of values for each SBase subclass (e.g. SBMLLayoutTypeCode_t for the SBML Level 3 Layout extension, SBMLFbcTypeCode_t for the SBML Level 3 Flux Balance Constraints extension, etc.).
  • The value of each package-specific type code can be duplicated between those of different packages. (This is necessary because the development of libSBML extensions for different SBML packages may be undertaken by different developers at different times; requiring the developers to coordinate their use of type codes would be nettlesome and probably doomed to failure.)
  • To distinguish between the type codes of different packages, both the return value of SBase::getTypeCode() and SBase::getPackageName() must be checked. This is particularly important for functions that take an SBML type code as an argument, such as SBase::getAncestorOfType(), which by default assumes you are handing it a core type, and will return NULL if the value you give it is actually from a package.

The following example code illustrates the combined use of SBase::getPackageName() and SBase::getTypeCode():

void example (const SBase *sb)
{
cons std::string pkgName = sb->getPackageName();
if (pkgName == "core")
{
switch (sb->getTypeCode())
{
case SBML_MODEL:
....
break;
....
}
}
else if (pkgName == "layout")
{
switch (sb->getTypeCode())
{
....
break;
....
}
}
...
}
@ SBML_LAYOUT_REACTIONGLYPH
Definition: LayoutExtension.h:446
@ SBML_LAYOUT_LAYOUT
Definition: LayoutExtension.h:443
@ SBML_MODEL
Definition: SBMLTypeCodes.h:75
@ SBML_REACTION
Definition: SBMLTypeCodes.h:77
Definition: SBase.h:191
const std::string & getPackageName() const
Returns the name of the SBML Level&#160;3 package in which this element is defined.
Definition: SBase.cpp:3476
virtual int getTypeCode() const
Returns the libSBML type code for this object.
Definition: SBase.cpp:3500
Enumerator
SBML_FBC_V1ASSOCIATION 

Association (only used in Version 1; replaced in Version 2 with FbcAssociation)

SBML_FBC_FLUXBOUND 

FluxBound

SBML_FBC_FLUXOBJECTIVE 

FluxObjective

SBML_FBC_GENEASSOCIATION 

GeneAssociation (only used in Version 1; replaced in Version 2 with GeneProductAssociation)

SBML_FBC_OBJECTIVE 

Objective

SBML_FBC_ASSOCIATION 

FbcAssociation

SBML_FBC_GENEPRODUCTASSOCIATION 

GeneProductAssociation

SBML_FBC_GENEPRODUCT 

GeneProduct

SBML_FBC_GENEPRODUCTREF 

GeneProductRef

SBML_FBC_AND 

FbcAnd

SBML_FBC_OR 

FbcOr

SBML_FBC_USERDEFINEDCONSTRAINTCOMPONENT 

UserDefinedConstraintComponent

SBML_FBC_USERDEFINEDCONSTRAINT 

UserDefinedConstraint

SBML_FBC_KEYVALUEPAIR 

KeyValuePair

Function Documentation

◆ FbcVariableType_fromString()

FbcVariableType_t FbcVariableType_fromString ( const char *  code)

Returns the FbcVariableType_t enumeration corresponding to the given string or FBC_VARIABLE_TYPE_INVALID if there is no such match.

Parameters
codethe string to convert to a FbcVariableType_t.
Returns
the corresponding FbcVariableType_t or FBC_VARIABLE_TYPE_INVALID if no match is found.
Note
The matching is case-sensitive: "linear" will return FBC_VARIABLE_TYPE_LINEAR, but "Linear" will return FBC_VARIABLE_TYPE_INVALID.

◆ FbcVariableType_isValid()

int FbcVariableType_isValid ( FbcVariableType_t  fvt)

Predicate returning 1 (true) or 0 (false) depending on whether the given FbcVariableType_t is valid.

Parameters
fvtthe FbcVariableType_t enumeration to query.
Returns
1 (true) if the FbcVariableType_t is FBC_VARIABLE_TYPE_LINEAR, or FBC_VARIABLE_TYPE_QUADRATIC; 0 (false) otherwise (including FBC_VARIABLE_TYPE_INVALID).

◆ FbcVariableType_isValidString()

int FbcVariableType_isValidString ( const char *  code)

Predicate returning 1 (true) or 0 (false) depending on whether the given string is a valid FbcVariableType_t.

Parameters
codethe string to query.
Returns
1 (true) if the string is "linear", "quadratic", or "invalid FbcVariableType value"; 0 (false) otherwise.
Note
The matching is case-sensitive: "linear" will return 1 (true), but "Linear" will return 0 (false).

◆ FbcVariableType_toString()

const char* FbcVariableType_toString ( FbcVariableType_t  fvt)

Returns the string version of the provided FbcVariableType_t enumeration.

Parameters
fvtthe FbcVariableType_t enumeration value to convert.
Returns
A string corresponding to the given type: "linear", "quadratic", "invalid FbcVariableType value", or NULL if the value is FBC_VARIABLE_TYPE_INVALID or another invalid enumeration value.
Note
The string returned by this function is a pointer to a string literal defined in the libSBML library, and may not be modified or deleted.