libSBML C# API  libSBML 5.10.0 C# API
 All Classes Namespaces Files Functions Variables Properties Pages
libsbmlcs.CompSBMLDocumentPlugin Class Reference
Inheritance diagram for libsbmlcs.CompSBMLDocumentPlugin:
[legend]

Detailed Description

{comp}

comp Implementation of the “comp” package extention to the SBMLDocument construct.

The CompSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin class, and codifies the extentions to the SBMLDocument class defined in the SBML Level 3 comp package (“comp”). This extention allows multiple Model objects to be defined in a single SBMLDocument, stored in an optional child ListOfModelDefinitions object, as well as define references to Model objects in other files, stored in the optional child ListOfExternalModelDefinitions object. These model definitions, if present, allow Submodel objects to reference other Models to instantiate.

The presence of ModelDefinitions and ExternalModelDefinitions in an SBMLDocument does not change the default Model in the file. If a SBMLDocument is submitted somewhere to be simulated, it is still the <model> child of the <sbml> element that should be simulated.

In addition, as all packages do, the CompSBMLDocumentPlugin defines a required flag named required, which indicates whether “comp” constructs can be used to change the core mathematics of the <model> child of the <sbml> element. Because they can, this attribute must be set true.

Public Member Functions

int addExternalModelDefinition (ExternalModelDefinition externalModelDefinition)
 Adds a copy of the given ExternalModelDefinition object to the list of ExternalModelDefinitions. More...
 
int addModelDefinition (ModelDefinition modelDefinition)
 Adds a copy of the given ModelDefinition object to the list of ModelDefinitions. More...
 
long checkConsistency ()
 Check consistency function. More...
 
SBasePlugin clone ()
 Creates and returns a deep copy of this CompSBMLDocumentPlugin object. More...
 
 CompSBMLDocumentPlugin (string uri, string prefix, CompPkgNamespaces compns)
 Constructor. More...
 
 CompSBMLDocumentPlugin (CompSBMLDocumentPlugin orig)
 Copy constructor. More...
 
void connectToChild ()
 Sets the *parent* of this SBML object to child SBML objects (if any). More...
 
void connectToParent (SBase parent)
 Sets the parent SBML object of this SBML object. More...
 
ExternalModelDefinition createExternalModelDefinition ()
 Creates a ExternalModelDefinition object, adds it to the end of the ExternalModelDefinition objects list and returns a pointer to the newly created object. More...
 
ModelDefinition createModelDefinition ()
 Creates a ModelDefinition object, adds it to the end of the ModelDefinition objects list and returns a pointer to the newly created object. More...
 
SBase createObject (XMLInputStream stream)
 Create and return an SBML object of this class, if present. More...
 
override void Dispose ()
 
void divideAssignmentsToSIdByFunction (string id, ASTNode function)
 If the function of this object is to assign a value has a child 'math' object (or anything with ASTNodes in general), replace the 'math' object with the function (existing/function). More...
 
void enablePackageInternal (string pkgURI, string pkgPrefix, bool flag)
 Enables/Disables the given package with child elements in this plugin object (if any). More...
 
long getColumn ()
 Returns the column number on which this object first appears in the XML representation of the SBML document. More...
 
SBase getElementByMetaId (string metaid)
 Returns the first child element it can find with the given metaid, or itself if it has the given metaid, or null if no such object is found. More...
 
SBase getElementBySId (string id)
 Returns the first child element found that has the given id in the model-wide SId namespace, or null if no such object is found. More...
 
string getElementNamespace ()
 Returns the XML namespace (URI) of the package extension of this plugin object. More...
 
ExternalModelDefinition getExternalModelDefinition (long n)
 Returns the ExternalModelDefinition with the given index. More...
 
ExternalModelDefinition getExternalModelDefinition (string sid)
 Returns the model definition object based on its identifier. More...
 
long getLevel ()
 Returns the SBML level of the package extension of this plugin object. More...
 
long getLine ()
 Returns the line number on which this object first appears in the XML representation of the SBML document. More...
 
SBaseList getListOfAllElements (ElementFilter filter)
 
SBaseList getListOfAllElements ()
 
ListOfExternalModelDefinitions getListOfExternalModelDefinitions ()
 Returns the ListOf object that holds all ExternalModelDefinitions. More...
 
ListOfModelDefinitions getListOfModelDefinitions ()
 Returns the ListOf object that holds all ModelDefinitions. More...
 
SBase getModel (string sid)
 Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier. More...
 
ModelDefinition getModelDefinition (long n)
 Returns the ModelDefinition with the given index. More...
 
ModelDefinition getModelDefinition (string sid)
 Returns the model definition object based on its identifier. More...
 
long getNumExternalModelDefinitions ()
 Returns the number of ExternalModelDefinitions for this SBMLDocumentPlugin. More...
 
long getNumModelDefinitions ()
 Returns the number of ModelDefinitions for this SBMLDocumentPlugin. More...
 
bool getOverrideCompFlattening ()
 
string getPackageName ()
 Returns the package name of this plugin object. More...
 
long getPackageVersion ()
 Returns the package version of the package extension of this plugin object. More...
 
SBase getParentSBMLObject ()
 Returns the parent SBase object to which this plugin object connected. More...
 
string getPrefix ()
 Returns the prefix of the package extension of this plugin object. More...
 
bool getRequired ()
 Returns the bool value of 'required' attribute of corresponding package in SBMLDocument element. More...
 
SBMLDocument getSBMLDocument ()
 Returns the parent SBMLDocument of this plugin object. More...
 
SBMLNamespaces getSBMLNamespaces ()
 
string getURI ()
 Gets the URI to which this element belongs to. More...
 
long getVersion ()
 Returns the SBML version of the package extension of this plugin object. More...
 
bool hasIdentifierBeginningWith (string prefix)
 Check to see if the given prefix is used by any of the IDs defined by extension elements. More...
 
bool isCompFlatteningImplemented ()
 
bool isSetRequired ()
 Predicate returning true or false depending on whether this SBMLDocumentPlugin's 'required' attribute has been set. More...
 
void logUnknownElement (string element, long sbmlLevel, long sbmlVersion, long pkgVersion)
 Helper to log a common type of error for elements. More...
 
void multiplyAssignmentsToSIdByFunction (string id, ASTNode function)
 If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing*function). More...
 
int prependStringToAllIdentifiers (string prefix)
 Add the given string to all identifiers in the object. More...
 
ExternalModelDefinition removeExternalModelDefinition (long index)
 Removes the ExternalModelDefinition with the given index. More...
 
ExternalModelDefinition removeExternalModelDefinition (string id)
 Removes the ExternalModelDefinition with the given id. More...
 
ModelDefinition removeModelDefinition (long index)
 Removes the ModelDefinition with the given index from the CompSBMLDocumentPlugin. More...
 
ModelDefinition removeModelDefinition (string id)
 Removes the ModelDefinition with the given id from the CompSBMLDocumentPlugin. More...
 
void replaceSIDWithFunction (string id, ASTNode function)
 If this object has a child 'math' object (or anything with ASTNodes in general), replace all nodes with the name 'id' with the provided function. More...
 
int setElementNamespace (string uri)
 Sets the XML namespace to which this element belongs to. More...
 
void setOverrideCompFlattening (bool overrideCompFlattening)
 
int setRequired (bool value)
 Sets the bool value of 'required' attribute of corresponding package in SBMLDocument element. More...
 
bool stripPackage (string pkgPrefix, bool flag)
 
int transformIdentifiers (IdentifierTransformer sidTransformer)
 
int unsetRequired ()
 Unsets the value of the 'required' attribute of this SBMLDocumentPlugin. More...
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

libsbmlcs.CompSBMLDocumentPlugin.CompSBMLDocumentPlugin ( string  uri,
string  prefix,
CompPkgNamespaces  compns 
)

Constructor.

libsbmlcs.CompSBMLDocumentPlugin.CompSBMLDocumentPlugin ( CompSBMLDocumentPlugin  orig)

Copy constructor.

Creates a copy of this CompSBMLDocumentPlugin object.

Member Function Documentation

int libsbmlcs.CompSBMLDocumentPlugin.addExternalModelDefinition ( ExternalModelDefinition  externalModelDefinition)

Adds a copy of the given ExternalModelDefinition object to the list of ExternalModelDefinitions.

Parameters
externalModelDefinitionthe ExternalModelDefinition object to be added to the list of ExternalModelDefinitions. Fails if the added ExternalModelDefinition is null, does not match the level/version/package of the parent object, or cannot be added to the list of external model definitions.
Returns
integer value indicating success/failure of the operation. The possible return values are:
int libsbmlcs.CompSBMLDocumentPlugin.addModelDefinition ( ModelDefinition  modelDefinition)

Adds a copy of the given ModelDefinition object to the list of ModelDefinitions.

Parameters
modelDefinitionthe ModelDefinition object to be added to the list of ModelDefinitions. Fails if the added ModelDefinition is null, does not match the level/version/package of the parent object, or cannot be added to the list of replaced elements.
Returns
integer value indicating success/failure of the operation. The possible return values are:
long libsbmlcs.CompSBMLDocumentPlugin.checkConsistency ( )

Check consistency function.

SBasePlugin libsbmlcs.CompSBMLDocumentPlugin.clone ( )

Creates and returns a deep copy of this CompSBMLDocumentPlugin object.

Returns
a (deep) copy of this CompSBMLDocumentPlugin object
void libsbmlcs.CompSBMLDocumentPlugin.connectToChild ( )

Sets the *parent* of this SBML object to child SBML objects (if any).

(Creates a child-parent relationship by the parent)

See also
setSBMLDocument
enablePackageInternal
void libsbmlcs.CompSBMLDocumentPlugin.connectToParent ( SBase  parent)

Sets the parent SBML object of this SBML object.

(Creates a child-parent relationship by the child) This function is called when a child element is set/added/created by its parent element (e.g. by setXXX, addXXX, createXXX, and connectToChild functions of the parent element).

Parameters
parentthe SBML object to use
ExternalModelDefinition libsbmlcs.CompSBMLDocumentPlugin.createExternalModelDefinition ( )

Creates a ExternalModelDefinition object, adds it to the end of the ExternalModelDefinition objects list and returns a pointer to the newly created object.

Returns
a newly created ExternalModelDefinition object
ModelDefinition libsbmlcs.CompSBMLDocumentPlugin.createModelDefinition ( )

Creates a ModelDefinition object, adds it to the end of the ModelDefinition objects list and returns a pointer to the newly created object.

Returns
a newly created ModelDefinition object
SBase libsbmlcs.CompSBMLDocumentPlugin.createObject ( XMLInputStream  stream)

Create and return an SBML object of this class, if present.

Returns
the SBML object corresponding to next XMLToken in the XMLInputStream or null if the token was not recognized.
override void libsbmlcs.CompSBMLDocumentPlugin.Dispose ( )
virtual

Reimplemented from libsbmlcs.SBasePlugin.

void libsbmlcs.SBasePlugin.divideAssignmentsToSIdByFunction ( string  id,
ASTNode  function 
)
inherited

If the function of this object is to assign a value has a child 'math' object (or anything with ASTNodes in general), replace the 'math' object with the function (existing/function).

Note
This function does nothing itself–subclasses with ASTNode subelements must override this function.
void libsbmlcs.CompSBMLDocumentPlugin.enablePackageInternal ( string  pkgURI,
string  pkgPrefix,
bool  flag 
)

Enables/Disables the given package with child elements in this plugin object (if any).

(This is an internal implementation invoked from SBase::enablePackageInternal() function)

Note
Subclasses in which one or more SBase derived elements are defined must override this function.
See also
setSBMLDocument
connectToParent
long libsbmlcs.SBasePlugin.getColumn ( )
inherited

Returns the column number on which this object first appears in the XML representation of the SBML document.

Returns
the column number of the underlying SBML object.
Note
The column number for each construct in an SBML model is set upon reading the model. The accuracy of the column number depends on the correctness of the XML representation of the model, and on the particular XML parser library being used. The former limitation relates to the following problem: if the model is actually invalid XML, then the parser may not be able to interpret the data correctly and consequently may not be able to establish the real column number. The latter limitation is simply that different parsers seem to have their own accuracy limitations, and out of all the parsers supported by libSBML, none have been 100% accurate in all situations. (At this time, libSBML supports the use of libxml2, Expat and Xerces.)
See also
getLine()
SBase libsbmlcs.CompSBMLDocumentPlugin.getElementByMetaId ( string  metaid)

Returns the first child element it can find with the given metaid, or itself if it has the given metaid, or null if no such object is found.

Parameters
metaidstring representing the meta identifier of objects to find
Returns
a pointer to the SBase element with the given metaid.
SBase libsbmlcs.CompSBMLDocumentPlugin.getElementBySId ( string  id)

Returns the first child element found that has the given id in the model-wide SId namespace, or null if no such object is found.

Parameters
idstring representing the identifier of objects to find
Returns
a pointer to the SBase element with the given id.
Note
The comp SBML document plugin has multiple model-wide SId namespaces, so a valid document may well contain multiple elements with the same SId that reside in separate models. It is not recommended to ever call this function—instead, call the function on the child ModelDefinition objects.
string libsbmlcs.SBasePlugin.getElementNamespace ( )
inherited

Returns the XML namespace (URI) of the package extension of this plugin object.

Returns
the URI of the package extension of this plugin object.
ExternalModelDefinition libsbmlcs.CompSBMLDocumentPlugin.getExternalModelDefinition ( long  n)

Returns the ExternalModelDefinition with the given index.

Parameters
nthe index number of the ExternalModelDefinition to get.
Returns
the nth ExternalModelDefinition in the ListOfExternalModelDefinitions. If the index is invalid, null is returned.
ExternalModelDefinition libsbmlcs.CompSBMLDocumentPlugin.getExternalModelDefinition ( string  sid)

Returns the model definition object based on its identifier.

Parameters
sida string representing the identifier of the model definition to get.
Returns
ExternalModelDefinition in the ListOfExternalModelDefinitions with the given sid or null if no such ExternalModelDefinition exists.
See also
getExternalModelDefinition(long n)
getListOfExternalModelDefinitions()
long libsbmlcs.SBasePlugin.getLevel ( )
inherited

Returns the SBML level of the package extension of this plugin object.

Returns
the SBML level of the package extension of this plugin object.
long libsbmlcs.SBasePlugin.getLine ( )
inherited

Returns the line number on which this object first appears in the XML representation of the SBML document.

Returns
the line number of the underlying SBML object.
Note
The line number for each construct in an SBML model is set upon reading the model. The accuracy of the line number depends on the correctness of the XML representation of the model, and on the particular XML parser library being used. The former limitation relates to the following problem: if the model is actually invalid XML, then the parser may not be able to interpret the data correctly and consequently may not be able to establish the real line number. The latter limitation is simply that different parsers seem to have their own accuracy limitations, and out of all the parsers supported by libSBML, none have been 100% accurate in all situations. (At this time, libSBML supports the use of libxml2, Expat and Xerces.)
See also
getColumn()
SBaseList libsbmlcs.SBasePlugin.getListOfAllElements ( ElementFilter  filter)
inherited
SBaseList libsbmlcs.SBasePlugin.getListOfAllElements ( )
inherited
ListOfExternalModelDefinitions libsbmlcs.CompSBMLDocumentPlugin.getListOfExternalModelDefinitions ( )

Returns the ListOf object that holds all ExternalModelDefinitions.

Returns
the ListOf object that holds all ExternalModelDefinitions.
ListOfModelDefinitions libsbmlcs.CompSBMLDocumentPlugin.getListOfModelDefinitions ( )

Returns the ListOf object that holds all ModelDefinitions.

Returns
the ListOf object that holds all ModelDefinitions.
SBase libsbmlcs.CompSBMLDocumentPlugin.getModel ( string  sid)

Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier.

Parameters
sida string representing the identifier of the model definition to get.
Returns
The SBase corresponding to the given sid or null if no such model exists. If no such model exists, this will return null.
ModelDefinition libsbmlcs.CompSBMLDocumentPlugin.getModelDefinition ( long  n)

Returns the ModelDefinition with the given index.

Parameters
nthe index number of the ModelDefinition to get.
Returns
the nth ModelDefinition in the ListOfModelDefinitions. If the index is invalid, null is returned.
ModelDefinition libsbmlcs.CompSBMLDocumentPlugin.getModelDefinition ( string  sid)

Returns the model definition object based on its identifier.

Parameters
sida string representing the identifier of the model definition to get.
Returns
ModelDefinition in the ListOfModelDefinitions with the given sid or null if no such ModelDefinition exists.
See also
getModelDefinition(long n)
getListOfModelDefinitions()
long libsbmlcs.CompSBMLDocumentPlugin.getNumExternalModelDefinitions ( )

Returns the number of ExternalModelDefinitions for this SBMLDocumentPlugin.

Returns
the number of ExternalModelDefinitions for this SBMLDocumentPlugin.
long libsbmlcs.CompSBMLDocumentPlugin.getNumModelDefinitions ( )

Returns the number of ModelDefinitions for this SBMLDocumentPlugin.

Returns
the number of ModelDefinitions.
bool libsbmlcs.CompSBMLDocumentPlugin.getOverrideCompFlattening ( )
string libsbmlcs.SBasePlugin.getPackageName ( )
inherited

Returns the package name of this plugin object.

Returns
the package name of this plugin object.
long libsbmlcs.SBasePlugin.getPackageVersion ( )
inherited

Returns the package version of the package extension of this plugin object.

Returns
the package version of the package extension of this plugin object.
SBase libsbmlcs.SBasePlugin.getParentSBMLObject ( )
inherited

Returns the parent SBase object to which this plugin object connected.

Returns
the parent SBase object to which this plugin object connected.
string libsbmlcs.SBasePlugin.getPrefix ( )
inherited

Returns the prefix of the package extension of this plugin object.

Returns
the prefix of the package extension of this plugin object.
bool libsbmlcs.SBMLDocumentPlugin.getRequired ( )
inherited

Returns the bool value of 'required' attribute of corresponding package in SBMLDocument element.

Returns
the bool value of 'required' attribute of corresponding package in SBMLDocument element.
SBMLDocument libsbmlcs.SBasePlugin.getSBMLDocument ( )
inherited

Returns the parent SBMLDocument of this plugin object.

Returns
the parent SBMLDocument object of this plugin object.
SBMLNamespaces libsbmlcs.SBasePlugin.getSBMLNamespaces ( )
inherited
string libsbmlcs.SBasePlugin.getURI ( )
inherited

Gets the URI to which this element belongs to.

For example, all elements that belong to SBML Level 3 Version 1 Core must would have the URI 'http://www.sbml.org/sbml/level3/version1/core'; all elements that belong to Layout Extension Version 1 for SBML Level 3 Version 1 Core must would have the URI 'http://www.sbml.org/sbml/level3/version1/layout/version1/'

Unlike getElementNamespace, this function first returns the URI for this element by looking into the SBMLNamespaces object of the document with the its package name. if not found it will return the result of getElementNamespace

Returns
the URI this elements
See also
getPackageName()
getElementNamespace()
SBMLDocument::getSBMLNamespaces()
getSBMLDocument()
long libsbmlcs.SBasePlugin.getVersion ( )
inherited

Returns the SBML version of the package extension of this plugin object.

Returns
the SBML version of the package extension of this plugin object.
bool libsbmlcs.SBasePlugin.hasIdentifierBeginningWith ( string  prefix)
inherited

Check to see if the given prefix is used by any of the IDs defined by extension elements.

A package that defines its own 'id' attribute for a core element would check that attribute here.

bool libsbmlcs.CompSBMLDocumentPlugin.isCompFlatteningImplemented ( )
bool libsbmlcs.SBMLDocumentPlugin.isSetRequired ( )
inherited

Predicate returning true or false depending on whether this SBMLDocumentPlugin's 'required' attribute has been set.

Returns
true if the 'required' attribute of this SBMLDocument has been set, false otherwise.
void libsbmlcs.SBasePlugin.logUnknownElement ( string  element,
long  sbmlLevel,
long  sbmlVersion,
long  pkgVersion 
)
inherited

Helper to log a common type of error for elements.

void libsbmlcs.SBasePlugin.multiplyAssignmentsToSIdByFunction ( string  id,
ASTNode  function 
)
inherited

If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing*function).

int libsbmlcs.SBasePlugin.prependStringToAllIdentifiers ( string  prefix)
inherited

Add the given string to all identifiers in the object.

If the string is added to anything other than an id or a metaid, this code is responsible for tracking down and renaming all *idRefs in the package extention that identifier comes from.

ExternalModelDefinition libsbmlcs.CompSBMLDocumentPlugin.removeExternalModelDefinition ( long  index)

Removes the ExternalModelDefinition with the given index.

A pointer to the ExternalModelDefinition that was removed is returned. If no ExternalModelDefinition has been removed, null is returned.

Parameters
indexthe index of the ExternalModelDefinition object to remove
Returns
the ExternalModelDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if the given index is out of range.
ExternalModelDefinition libsbmlcs.CompSBMLDocumentPlugin.removeExternalModelDefinition ( string  id)

Removes the ExternalModelDefinition with the given id.

A pointer to the ExternalModelDefinition that was removed is returned. If no ExternalModelDefinition has been removed, null is returned.

Parameters
idthe id of the ExternalModelDefinition object to remove
Returns
the ExternalModelDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if the given index is out of range.
ModelDefinition libsbmlcs.CompSBMLDocumentPlugin.removeModelDefinition ( long  index)

Removes the ModelDefinition with the given index from the CompSBMLDocumentPlugin.

A pointer to the ModelDefinition that was removed is returned. If no ModelDefinition has been removed, null is returned.

Parameters
indexthe index of the ModelDefinition object to remove
Returns
the ModelDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if the given index is out of range.
ModelDefinition libsbmlcs.CompSBMLDocumentPlugin.removeModelDefinition ( string  id)

Removes the ModelDefinition with the given id from the CompSBMLDocumentPlugin.

A pointer to the ModelDefinition that was removed is returned. If no ModelDefinition has been removed, null is returned.

Parameters
idthe id of the ModelDefinition object to remove
Returns
the ModelDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if the given index is out of range.
void libsbmlcs.SBasePlugin.replaceSIDWithFunction ( string  id,
ASTNode  function 
)
inherited

If this object has a child 'math' object (or anything with ASTNodes in general), replace all nodes with the name 'id' with the provided function.

Note
This function does nothing itself–subclasses with ASTNode subelements must override this function.
int libsbmlcs.SBasePlugin.setElementNamespace ( string  uri)
inherited

Sets the XML namespace to which this element belongs to.

For example, all elements that belong to SBML Level 3 Version 1 Core must set the namespace to 'http://www.sbml.org/sbml/level3/version1/core'; all elements that belong to Layout Extension Version 1 for SBML Level 3 Version 1 Core must set the namespace to 'http://www.sbml.org/sbml/level3/version1/layout/version1/'

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
void libsbmlcs.CompSBMLDocumentPlugin.setOverrideCompFlattening ( bool  overrideCompFlattening)
int libsbmlcs.CompSBMLDocumentPlugin.setRequired ( bool  value)

Sets the bool value of 'required' attribute of corresponding package in SBMLDocument element.

The only legal value is 'true' for the Hierarchical Model Composition package.

Parameters
valuethe bool value of 'required' attribute of corresponding package in SBMLDocument element.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
bool libsbmlcs.SBasePlugin.stripPackage ( string  pkgPrefix,
bool  flag 
)
inherited
int libsbmlcs.SBasePlugin.transformIdentifiers ( IdentifierTransformer  sidTransformer)
inherited
int libsbmlcs.SBMLDocumentPlugin.unsetRequired ( )
inherited

Unsets the value of the 'required' attribute of this SBMLDocumentPlugin.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Member Data Documentation

bool libsbmlcs.SBasePlugin.swigCMemOwn
protectedinherited