libSBML Perl API
libSBML 5.8.0 Perl API
|
The CompSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin class, and codifies the extentions to the SBMLDocument class defined in the SBML Level 3 Hierarchical Model Composition 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 the 'comp' constructs in the document change the mathematics of the <model>
child of the <sbml>
element. If they do, this attribute must be set true
, and if not, this attribute must be set false
.
Public Member Functions | |
int | addExternalModelDefinition (const ExternalModelDefinition *externalModelDefinition) |
Adds a copy of the given ExternalModelDefinition object to the list of ExternalModelDefinitions. More... | |
int | addModelDefinition (const ModelDefinition *modelDefinition) |
Adds a copy of the given ModelDefinition object to the list of ModelDefinitions. More... | |
virtual unsigned int | checkConsistency () |
virtual CompSBMLDocumentPlugin * | clone () const |
Creates and returns a deep copy of this CompSBMLDocumentPlugin object. More... | |
CompSBMLDocumentPlugin (const std::string &uri, const std::string &prefix, CompPkgNamespaces *compns) | |
Constructor. More... | |
CompSBMLDocumentPlugin (const CompSBMLDocumentPlugin &orig) | |
Copy constructor. 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... | |
virtual List * | getAllElements () |
Returns a List of all child SBase objects, including those nested to an arbitrary depth. More... | |
virtual SBase * | getElementByMetaId (std::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... | |
virtual SBase * | getElementBySId (std::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... | |
const std::string & | getElementNamespace () const |
Returns the XML namespace (URI) of the package extension of this plugin object. More... | |
ExternalModelDefinition * | getExternalModelDefinition (unsigned int n) |
Returns the ExternalModelDefinition with the given index. More... | |
const ExternalModelDefinition * | getExternalModelDefinition (unsigned int n) const |
Returns the ExternalModelDefinition with the given index. More... | |
ExternalModelDefinition * | getExternalModelDefinition (const std::string &sid) |
Returns the model definition object based on its identifier. More... | |
const ExternalModelDefinition * | getExternalModelDefinition (const std::string &sid) const |
Returns the model definition object based on its identifier. More... | |
unsigned int | getLevel () const |
Returns the SBML level of the package extension of this plugin object. More... | |
const ListOfExternalModelDefinitions * | getListOfExternalModelDefinitions () const |
Returns the ListOf object that holds all ExternalModelDefinitions. More... | |
const ListOfModelDefinitions * | getListOfModelDefinitions () const |
Returns the ListOf object that holds all ModelDefinitions. More... | |
const SBase * | getModel (const std::string &sid) const |
Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier. More... | |
SBase * | getModel (const std::string &sid) |
Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier. More... | |
ModelDefinition * | getModelDefinition (unsigned int n) |
Returns the ModelDefinition with the given index. More... | |
const ModelDefinition * | getModelDefinition (unsigned int n) const |
Returns the ModelDefinition with the given index. More... | |
ModelDefinition * | getModelDefinition (const std::string &sid) |
Returns the model definition object based on its identifier. More... | |
const ModelDefinition * | getModelDefinition (const std::string &sid) const |
Returns the model definition object based on its identifier. More... | |
unsigned int | getNumExternalModelDefinitions () const |
Returns the number of ExternalModelDefinitions for this SBMLDocumentPlugin. More... | |
unsigned int | getNumModelDefinitions () const |
Returns the number of ModelDefinitions for this SBMLDocumentPlugin. More... | |
const std::string & | getPackageName () const |
Returns the package name of this plugin object. More... | |
unsigned int | getPackageVersion () const |
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... | |
const SBase * | getParentSBMLObject () const |
Returns the parent SBase object to which this plugin object connected. More... | |
const std::string & | getPrefix () const |
Returns the prefix of the package extension of this plugin object. More... | |
virtual bool | getRequired () const |
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... | |
const SBMLDocument * | getSBMLDocument () const |
Returns the parent SBMLDocument of this plugin object. More... | |
std::string | getURI () const |
Gets the URI to which this element belongs to. More... | |
unsigned int | getVersion () const |
Returns the SBML version of the package extension of this plugin object. More... | |
virtual bool | isFlatteningImplemented () const |
virtual bool | isSetRequired () const |
Predicate returning true or false depending on whether this SBMLDocumentPlugin's "required" attribute has been set. More... | |
CompSBMLDocumentPlugin & | operator= (const CompSBMLDocumentPlugin &orig) |
Assignment operator for CompSBMLDocumentPlugin. More... | |
ExternalModelDefinition * | removeExternalModelDefinition (unsigned int index) |
Removes the ExternalModelDefinition with the given index. More... | |
ExternalModelDefinition * | removeExternalModelDefinition (std::string id) |
Removes the ExternalModelDefinition with the given id . More... | |
ModelDefinition * | removeModelDefinition (unsigned int index) |
Removes the ModelDefinition with the given index from the CompSBMLDocumentPlugin. More... | |
ModelDefinition * | removeModelDefinition (std::string id) |
Removes the ModelDefinition with the given id from the CompSBMLDocumentPlugin. More... | |
int | setElementNamespace (const std::string &uri) |
Sets the XML namespace to which this element belongs to. More... | |
virtual int | setRequired (bool value) |
Sets the bool value of "required" attribute of corresponding package in SBMLDocument element. More... | |
virtual int | unsetRequired () |
Unsets the value of the "required" attribute of this SBMLDocumentPlugin. More... | |
virtual | ~CompSBMLDocumentPlugin () |
Destroy this object. More... | |
Friends | |
class | ExternalModelDefinition |
CompSBMLDocumentPlugin::CompSBMLDocumentPlugin | ( | const std::string & | uri, |
const std::string & | prefix, | ||
CompPkgNamespaces * | compns | ||
) |
Constructor.
CompSBMLDocumentPlugin::CompSBMLDocumentPlugin | ( | const CompSBMLDocumentPlugin & | orig | ) |
Copy constructor.
Creates a copy of this CompSBMLDocumentPlugin object.
|
virtual |
Destroy this object.
int CompSBMLDocumentPlugin::addExternalModelDefinition | ( | const ExternalModelDefinition * | externalModelDefinition | ) |
Adds a copy of the given ExternalModelDefinition object to the list of ExternalModelDefinitions.
externalModelDefinition | the 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. |
int CompSBMLDocumentPlugin::addModelDefinition | ( | const ModelDefinition * | modelDefinition | ) |
Adds a copy of the given ModelDefinition object to the list of ModelDefinitions.
modelDefinition | the 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. |
|
virtual |
|
virtual |
Creates and returns a deep copy of this CompSBMLDocumentPlugin object.
Reimplemented from SBMLDocumentPlugin.
ExternalModelDefinition * 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.
ModelDefinition * 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.
|
virtual |
Returns a List of all child SBase objects, including those nested to an arbitrary depth.
Reimplemented from SBasePlugin.
|
virtual |
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.
metaid | string representing the meta identifier of objects to find |
metaid
. Reimplemented from SBasePlugin.
|
virtual |
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.
id | string representing the identifier of objects to find |
id
.Reimplemented from SBasePlugin.
|
inherited |
Returns the XML namespace (URI) of the package extension of this plugin object.
ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition | ( | unsigned int | n | ) |
Returns the ExternalModelDefinition with the given index.
n | the index number of the ExternalModelDefinition to get. |
NULL
is returned. const ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition | ( | unsigned int | n | ) | const |
Returns the ExternalModelDefinition with the given index.
n | the index number of the ExternalModelDefinition to get. |
NULL
is returned. ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition | ( | const std::string & | sid | ) |
Returns the model definition object based on its identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such ExternalModelDefinition exists.const ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition | ( | const std::string & | sid | ) | const |
Returns the model definition object based on its identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such ExternalModelDefinition exists.
|
inherited |
Returns the SBML level of the package extension of this plugin object.
const ListOfExternalModelDefinitions * CompSBMLDocumentPlugin::getListOfExternalModelDefinitions | ( | ) | const |
const ListOfModelDefinitions * CompSBMLDocumentPlugin::getListOfModelDefinitions | ( | ) | const |
const SBase * CompSBMLDocumentPlugin::getModel | ( | const std::string & | sid | ) | const |
Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such model exists. If no such model exists, this will return NULL
. SBase * CompSBMLDocumentPlugin::getModel | ( | const std::string & | sid | ) |
Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such model exists. If no such model exists, this will return NULL
. ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition | ( | unsigned int | n | ) |
Returns the ModelDefinition with the given index.
n | the index number of the ModelDefinition to get. |
NULL
is returned. const ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition | ( | unsigned int | n | ) | const |
Returns the ModelDefinition with the given index.
n | the index number of the ModelDefinition to get. |
n
is invalid, NULL
is returned. ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition | ( | const std::string & | sid | ) |
Returns the model definition object based on its identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such ModelDefinition exists.const ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition | ( | const std::string & | sid | ) | const |
Returns the model definition object based on its identifier.
sid | a string representing the identifier of the model definition to get. |
sid
or NULL
if no such ModelDefinition exists.unsigned int CompSBMLDocumentPlugin::getNumExternalModelDefinitions | ( | ) | const |
Returns the number of ExternalModelDefinitions for this SBMLDocumentPlugin.
unsigned int CompSBMLDocumentPlugin::getNumModelDefinitions | ( | ) | const |
Returns the number of ModelDefinitions for this SBMLDocumentPlugin.
|
inherited |
Returns the package name of this plugin object.
|
inherited |
Returns the package version of the package extension of this plugin object.
|
inherited |
|
inherited |
|
inherited |
Returns the prefix of the package extension of this plugin object.
|
virtualinherited |
Returns the bool value of "required" attribute of corresponding package in SBMLDocument element.
(EXTENSION) Additional public functions
|
inherited |
Returns the parent SBMLDocument of this plugin object.
|
inherited |
Returns the parent SBMLDocument of this plugin object.
|
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
|
inherited |
Returns the SBML version of the package extension of this plugin object.
|
virtual |
|
virtualinherited |
Predicate returning true
or false
depending on whether this SBMLDocumentPlugin's "required" attribute has been set.
true
if the "required" attribute of this SBMLDocument has been set, false
otherwise. CompSBMLDocumentPlugin & CompSBMLDocumentPlugin::operator= | ( | const CompSBMLDocumentPlugin & | orig | ) |
Assignment operator for CompSBMLDocumentPlugin.
ExternalModelDefinition * CompSBMLDocumentPlugin::removeExternalModelDefinition | ( | unsigned int | 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.
index | the index of the ExternalModelDefinition object to remove |
NULL
is returned if the given index is out of range. ExternalModelDefinition * CompSBMLDocumentPlugin::removeExternalModelDefinition | ( | std::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.
id | the id of the ExternalModelDefinition object to remove |
NULL
is returned if the given index is out of range. ModelDefinition * CompSBMLDocumentPlugin::removeModelDefinition | ( | unsigned int | 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.
index | the index of the ModelDefinition object to remove |
NULL
is returned if the given index is out of range. ModelDefinition * CompSBMLDocumentPlugin::removeModelDefinition | ( | std::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.
id | the id of the ModelDefinition object to remove |
NULL
is returned if the given index is out of range.
|
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/"
|
virtualinherited |
Sets the bool value of "required" attribute of corresponding package in SBMLDocument element.
value | the bool value of "required" attribute of corresponding package in SBMLDocument element. |
|
virtualinherited |
Unsets the value of the "required" attribute of this SBMLDocumentPlugin.
|
friend |