libSBML C++ API  libSBML 5.8.0 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CompSBMLDocumentPlugin Class Reference
Inheritance diagram for CompSBMLDocumentPlugin:
[legend]

Detailed Description

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 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 CompSBMLDocumentPluginclone () 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...
 
ExternalModelDefinitioncreateExternalModelDefinition ()
 Creates a ExternalModelDefinition object, adds it to the end of the ExternalModelDefinition objects list and returns a pointer to the newly created object. More...
 
ModelDefinitioncreateModelDefinition ()
 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 ListgetAllElements ()
 Returns a List of all child SBase objects, including those nested to an arbitrary depth. More...
 
virtual SBasegetElementByMetaId (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 SBasegetElementBySId (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...
 
ExternalModelDefinitiongetExternalModelDefinition (unsigned int n)
 Returns the ExternalModelDefinition with the given index. More...
 
const ExternalModelDefinitiongetExternalModelDefinition (unsigned int n) const
 Returns the ExternalModelDefinition with the given index. More...
 
ExternalModelDefinitiongetExternalModelDefinition (const std::string &sid)
 Returns the model definition object based on its identifier. More...
 
const ExternalModelDefinitiongetExternalModelDefinition (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 ListOfModelDefinitionsgetListOfModelDefinitions () const
 Returns the ListOf object that holds all ModelDefinitions. More...
 
const SBasegetModel (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...
 
SBasegetModel (const std::string &sid)
 Searches the model namespace of the document and returns the Model, ModelDefinition, or ExternalModelDefintion object with the given identifier. More...
 
ModelDefinitiongetModelDefinition (unsigned int n)
 Returns the ModelDefinition with the given index. More...
 
const ModelDefinitiongetModelDefinition (unsigned int n) const
 Returns the ModelDefinition with the given index. More...
 
ModelDefinitiongetModelDefinition (const std::string &sid)
 Returns the model definition object based on its identifier. More...
 
const ModelDefinitiongetModelDefinition (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...
 
SBasegetParentSBMLObject ()
 Returns the parent SBase object to which this plugin object connected. More...
 
const SBasegetParentSBMLObject () 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...
 
SBMLDocumentgetSBMLDocument ()
 Returns the parent SBMLDocument of this plugin object. More...
 
const SBMLDocumentgetSBMLDocument () 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...
 
CompSBMLDocumentPluginoperator= (const CompSBMLDocumentPlugin &orig)
 Assignment operator for CompSBMLDocumentPlugin. More...
 
ExternalModelDefinitionremoveExternalModelDefinition (unsigned int index)
 Removes the ExternalModelDefinition with the given index. More...
 
ExternalModelDefinitionremoveExternalModelDefinition (std::string id)
 Removes the ExternalModelDefinition with the given id. More...
 
ModelDefinitionremoveModelDefinition (unsigned int index)
 Removes the ModelDefinition with the given index from the CompSBMLDocumentPlugin. More...
 
ModelDefinitionremoveModelDefinition (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
 

Constructor & Destructor Documentation

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.

CompSBMLDocumentPlugin::~CompSBMLDocumentPlugin ( )
virtual

Destroy this object.

Member Function Documentation

int CompSBMLDocumentPlugin::addExternalModelDefinition ( const 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 function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int CompSBMLDocumentPlugin::addModelDefinition ( const 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 function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
unsigned int CompSBMLDocumentPlugin::checkConsistency ( )
virtual
CompSBMLDocumentPlugin * CompSBMLDocumentPlugin::clone ( ) const
virtual

Creates and returns a deep copy of this CompSBMLDocumentPlugin object.

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.

Returns
a newly created ExternalModelDefinition 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.

Returns
a newly created ModelDefinition object
List * CompSBMLDocumentPlugin::getAllElements ( )
virtual

Returns a List of all child SBase objects, including those nested to an arbitrary depth.

Returns
a List of pointers to all children objects.

Reimplemented from SBasePlugin.

SBase * CompSBMLDocumentPlugin::getElementByMetaId ( std::string  metaid)
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.

Parameters
metaidstring representing the meta identifier of objects to find
Returns
a pointer to the SBase element with the given metaid.

Reimplemented from SBasePlugin.

SBase * CompSBMLDocumentPlugin::getElementBySId ( std::string  id)
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.

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.

Reimplemented from SBasePlugin.

const std::string & SBasePlugin::getElementNamespace ( ) const
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 * CompSBMLDocumentPlugin::getExternalModelDefinition ( unsigned int  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.
const ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition ( unsigned int  n) const

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 * CompSBMLDocumentPlugin::getExternalModelDefinition ( const std::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
get(unsigned int n)
size()
const ExternalModelDefinition * CompSBMLDocumentPlugin::getExternalModelDefinition ( const std::string &  sid) const

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
get(unsigned int n)
size()
unsigned int SBasePlugin::getLevel ( ) const
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.
const ListOfExternalModelDefinitions * CompSBMLDocumentPlugin::getListOfExternalModelDefinitions ( ) const

Returns the ListOf object that holds all ExternalModelDefinitions.

Returns
the ListOf object that holds all ExternalModelDefinitions.
const ListOfModelDefinitions * CompSBMLDocumentPlugin::getListOfModelDefinitions ( ) const

Returns the ListOf object that holds all ModelDefinitions.

Returns
the ListOf object that holds all ModelDefinitions.
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.

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.
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.

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 * CompSBMLDocumentPlugin::getModelDefinition ( unsigned int  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.
const ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition ( unsigned int  n) const

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 n is invalid, NULL is returned.
ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition ( const std::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
get(unsigned int n)
size()
const ModelDefinition * CompSBMLDocumentPlugin::getModelDefinition ( const std::string &  sid) const

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
get(unsigned int n)
size()
unsigned int CompSBMLDocumentPlugin::getNumExternalModelDefinitions ( ) const

Returns the number of ExternalModelDefinitions for this SBMLDocumentPlugin.

Returns
the number of ExternalModelDefinitions for this SBMLDocumentPlugin.
unsigned int CompSBMLDocumentPlugin::getNumModelDefinitions ( ) const

Returns the number of ModelDefinitions for this SBMLDocumentPlugin.

Returns
the number of ModelDefinitions.
const std::string & SBasePlugin::getPackageName ( ) const
inherited

Returns the package name of this plugin object.

Returns
the package name of this plugin object.
unsigned int SBasePlugin::getPackageVersion ( ) const
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 * 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.
const SBase * SBasePlugin::getParentSBMLObject ( ) const
inherited

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

Returns
the parent SBase object to which this plugin object connected.
const std::string & SBasePlugin::getPrefix ( ) const
inherited

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

Returns
the prefix of the package extension of this plugin object.
bool SBMLDocumentPlugin::getRequired ( ) const
virtualinherited

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

(EXTENSION) Additional public functions

Returns
the bool value of "required" attribute of corresponding package in SBMLDocument element.
SBMLDocument * SBasePlugin::getSBMLDocument ( )
inherited

Returns the parent SBMLDocument of this plugin object.

Returns
the parent SBMLDocument object of this plugin object.
const SBMLDocument * SBasePlugin::getSBMLDocument ( ) const
inherited

Returns the parent SBMLDocument of this plugin object.

Returns
the parent SBMLDocument object of this plugin object.
std::string SBasePlugin::getURI ( ) const
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
unsigned int SBasePlugin::getVersion ( ) const
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 CompSBMLDocumentPlugin::isFlatteningImplemented ( ) const
virtual
bool SBMLDocumentPlugin::isSetRequired ( ) const
virtualinherited

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.
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.

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 * 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.

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 * 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.

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 * 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.

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.
int SBasePlugin::setElementNamespace ( const std::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 value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int SBMLDocumentPlugin::setRequired ( bool  value)
virtualinherited

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

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:
int SBMLDocumentPlugin::unsetRequired ( )
virtualinherited

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

Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:

Friends And Related Function Documentation

friend class ExternalModelDefinition
friend