libSBML C++ API  5.20.2
DistribExtension.h File Reference

Definition of DistribExtension. More...

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

Classes

class  DistribExtension
 

Macros

#define DISTRIB_CREATE_NS(variable, sbmlns)   EXTENSION_CREATE_NS(DistribPkgNamespaces, variable, sbmlns);
 

Typedefs

typedef SBMLExtensionNamespaces< DistribExtensionDistribPkgNamespaces
 Required typedef definitions. More...
 

Enumerations

enum  SBMLDistribTypeCode_t {
  SBML_DISTRIB_UNCERTPARAMETER = 1500 ,
  SBML_DISTRIB_UNCERTAINTY = 1501 ,
  SBML_DISTRIB_UNCERTSTATISTICSPAN = 1502 ,
  SBML_DISTRIB_DISTRIBBASE = 1503
}
 SBMLDistribTypeCode_t Enumeration of possible types in the libSBML “distrib” package implementation. More...
 
enum  UncertType_t {
  DISTRIB_UNCERTTYPE_DISTRIBUTION ,
  DISTRIB_UNCERTTYPE_EXTERNALPARAMETER ,
  DISTRIB_UNCERTTYPE_COEFFIENTOFVARIATION ,
  DISTRIB_UNCERTTYPE_KURTOSIS ,
  DISTRIB_UNCERTTYPE_MEAN ,
  DISTRIB_UNCERTTYPE_MEDIAN ,
  DISTRIB_UNCERTTYPE_MODE ,
  DISTRIB_UNCERTTYPE_SAMPLESIZE ,
  DISTRIB_UNCERTTYPE_SKEWNESS ,
  DISTRIB_UNCERTTYPE_STANDARDDEVIATION ,
  DISTRIB_UNCERTTYPE_STANDARDERROR ,
  DISTRIB_UNCERTTYPE_VARIANCE ,
  DISTRIB_UNCERTTYPE_CONFIDENCEINTERVAL ,
  DISTRIB_UNCERTTYPE_CREDIBLEINTERVAL ,
  DISTRIB_UNCERTTYPE_INTERQUARTILERANGE ,
  DISTRIB_UNCERTTYPE_RANGE ,
  DISTRIB_UNCERTTYPE_INVALID
}
 Enumeration of values permitted as the value of the "uncerttype" attribute on Distrib objects. More...
 

Functions

UncertType_t UncertType_fromString (const char *code)
 Returns the UncertType_t enumeration corresponding to the given string or DISTRIB_UNCERTTYPE_INVALID if there is no such match. More...
 
int UncertType_isValid (UncertType_t ut)
 Predicate returning 1 (true) or 0 (false) depending on whether the given UncertType_t is valid. More...
 
int UncertType_isValidString (const char *code)
 Predicate returning 1 (true) or 0 (false) depending on whether the given string is a valid UncertType_t. More...
 
const char * UncertType_toString (UncertType_t ut)
 Returns the string version of the provided UncertType_t enumeration. More...
 

Detailed Description

Definition of DistribExtension.

Author
SBMLTeam

Macro Definition Documentation

◆ DISTRIB_CREATE_NS

#define DISTRIB_CREATE_NS (   variable,
  sbmlns 
)    EXTENSION_CREATE_NS(DistribPkgNamespaces, variable, sbmlns);

Typedef Documentation

◆ DistribPkgNamespaces

Required typedef definitions.

DistribPkgNamespace is derived from SBMLNamespaces class and used when creating an object of SBase derived classes defined in the distrib package

SBMLExtensionNamespaces<DistribExtension> must be instantiated in DistribExtension.cpp for DLL

Enumeration Type Documentation

◆ SBMLDistribTypeCode_t

SBMLDistribTypeCode_t Enumeration of possible types in the libSBML “distrib” 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_DISTRIB_UNCERTPARAMETER 

UncertParameter

SBML_DISTRIB_UNCERTAINTY 

Uncertainty

SBML_DISTRIB_UNCERTSTATISTICSPAN 

UncertSpan

SBML_DISTRIB_DISTRIBBASE 

DistribBase

◆ UncertType_t

Enumeration of values permitted as the value of the "uncerttype" attribute on Distrib objects.

See also
Distrib::getUncerttype()
Distrib::setUncerttype()
Enumerator
DISTRIB_UNCERTTYPE_DISTRIBUTION 

The distrib uncerttype is "distribution".

DISTRIB_UNCERTTYPE_EXTERNALPARAMETER 

The distrib uncerttype is "externalParameter".

DISTRIB_UNCERTTYPE_COEFFIENTOFVARIATION 

The distrib uncerttype is "coeffientOfVariation".

DISTRIB_UNCERTTYPE_KURTOSIS 

The distrib uncerttype is "kurtosis".

DISTRIB_UNCERTTYPE_MEAN 

The distrib uncerttype is "mean".

DISTRIB_UNCERTTYPE_MEDIAN 

The distrib uncerttype is "median".

DISTRIB_UNCERTTYPE_MODE 

The distrib uncerttype is "mode".

DISTRIB_UNCERTTYPE_SAMPLESIZE 

The distrib uncerttype is "sampleSize".

DISTRIB_UNCERTTYPE_SKEWNESS 

The distrib uncerttype is "skewness".

DISTRIB_UNCERTTYPE_STANDARDDEVIATION 

The distrib uncerttype is "standardDeviation".

DISTRIB_UNCERTTYPE_STANDARDERROR 

The distrib uncerttype is "standardError".

DISTRIB_UNCERTTYPE_VARIANCE 

The distrib uncerttype is "variance".

DISTRIB_UNCERTTYPE_CONFIDENCEINTERVAL 

The distrib uncerttype is "confidenceInterval".

DISTRIB_UNCERTTYPE_CREDIBLEINTERVAL 

The distrib uncerttype is "credibleInterval".

DISTRIB_UNCERTTYPE_INTERQUARTILERANGE 

The distrib uncerttype is "interquartileRange".

DISTRIB_UNCERTTYPE_RANGE 

The distrib uncerttype is "range".

DISTRIB_UNCERTTYPE_INVALID 

Invalid UncertType value.

Function Documentation

◆ UncertType_fromString()

UncertType_t UncertType_fromString ( const char *  code)

Returns the UncertType_t enumeration corresponding to the given string or DISTRIB_UNCERTTYPE_INVALID if there is no such match.

Parameters
codethe string to convert to a UncertType_t.
Returns
the corresponding UncertType_t or DISTRIB_UNCERTTYPE_INVALID if no match is found.
Note
The matching is case-sensitive: "distribution" will return DISTRIB_UNCERTTYPE_DISTRIBUTION, but "Distribution" will return DISTRIB_UNCERTTYPE_INVALID.

◆ UncertType_isValid()

◆ UncertType_isValidString()

int UncertType_isValidString ( const char *  code)

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

Parameters
codethe string to query.
Returns
1 (true) if the string is "distribution", "externalParameter", "coeffientOfVariation", "kurtosis", "mean", "median", "mode", "sampleSize", "skewness", "standardDeviation", "standardError", "variance", "confidenceInterval", "credibleInterval", "interquartileRange", "range", or "invalid UncertType value"; 0 (false) otherwise.
Note
The matching is case-sensitive: "distribution" will return 1 (true), but "Distribution" will return 0 (false).

◆ UncertType_toString()

const char* UncertType_toString ( UncertType_t  ut)

Returns the string version of the provided UncertType_t enumeration.

Parameters
utthe UncertType_t enumeration value to convert.
Returns
A string corresponding to the given type: "distribution", "externalParameter", "coeffientOfVariation", "kurtosis", "mean", "median", "mode", "sampleSize", "skewness", "standardDeviation", "standardError", "variance", "confidenceInterval", "credibleInterval", "interquartileRange", "range", "invalid UncertType value", or NULL if the value is DISTRIB_UNCERTTYPE_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.