libSBML C++ API
libSBML 5.13.0 C++ API
|
{comp}
comp A reference to an externally-defined model.The ExternalModelDefinition class was introduced by the SBML Level 3 Hierarchical Model Composition (“comp”) package to define references to Model objects defined in other files.
ExternalModelDefinition objects are model definitions—in and of themselves, they are definitions of models but not uses of those models. The class provides a way to declare and identify them so that Model objects in the present SBML document can use them in Submodel objects.
ExternalModelDefinition contains two required attributes ("source" and "id") and three optional attributes ("modelRef", "md5" and "name").
The "id" attribute serves to provide a handle for the external model reference so that Submodel objects can refer to it. Crucially, it is not the identifier of the model being referenced; rather, it is an identifier for this ExternalModelDefinition object within the current SBML document. The "id" attribute takes a required value of type SId, and must be unique across all Model and ExternalModelDefinition objects present in the document.
ExternalModelDefinition also has an optional "name" attribute, of type 'string'. The "name" attribute may be used to provide a human-readable description of the ExternalModelDefintion object.
The required attribute "source" is used to locate the SBML document containing an external model definition. The value of this attribute must be of type anyURI. Since URIs may be either URLs, URNs, or relative or absolute file locations, this offers flexibility in referencing SBML documents. In all cases, the "source" attribute value must refer specifically to an SBML Level 3 Version 1 document; prior Levels/Versions of SBML are not supported by this package. The entire file at the given location is referenced. The "source" attribute must have a value for every ExternalModelDefinition instance.
ExternalModelDefinition's optional attribute "modelRef", of type SIdRef, is used to identify a Model or ExternalModelDefinition object within the SBML document located at "source". The object referenced may be the main model in the document, or it may be a model definition contained in the SBML document's ListOfModelDefinitions or ListOfExternalModelDefinitions lists. Loops are not allowed: it must be possible to follow a chain of ExternalModelDefinition objects to its end in a Model object.
In core SBML, the "id" on Model is an optional attribute, and therefore, it is possible that the Model object in a given SBML document does not have an identifier. In that case, there is no value to give to the "modelRef" attribute in ExternalModelDefinition. If "modelRef" does not have a value, then the main model (i.e., the <model>
element within the <sbml>
element) in the referenced file is interpreted as being the model referenced by this ExternalModelDefinition instance.
Finally, the optional "md5" attribute takes a string value. If set, it must be an MD5 checksum value computed over the document referenced by "source". This checksum can serve as a data integrity check over the contents of the "source". Applications may use this to verify that the contents have not changed since the time that the ExternalModelDefinition reference was constructed.
Public Member Functions | |
virtual ExternalModelDefinition * | clone () const |
Creates and returns a deep copy of this ExternalModelDefinition object. More... | |
ExternalModelDefinition (unsigned int level=CompExtension::getDefaultLevel(), unsigned int version=CompExtension::getDefaultVersion(), unsigned int pkgVersion=CompExtension::getDefaultPackageVersion()) | |
Creates a new ExternalModelDefinition with the given level, version, and package version. More... | |
ExternalModelDefinition (CompPkgNamespaces *compns) | |
Creates a new ExternalModelDefinition with the given CompPkgNamespaces object. More... | |
ExternalModelDefinition (const ExternalModelDefinition &source) | |
Copy constructor. More... | |
virtual const std::string & | getElementName () const |
Returns the XML element name of this SBML object. More... | |
virtual const std::string & | getId () const |
Returns the value of the "id" attribute of this ExternalModelDefinition. More... | |
virtual const std::string & | getMd5 () const |
Returns the value of the "md5" attribute of this ExternalModelDefinition. More... | |
virtual const std::string & | getModelRef () const |
Returns the value of the "modelRef" attribute of this ExternalModelDefinition. More... | |
virtual const std::string & | getName () const |
Returns the value of the "name" attribute of this ExternalModelDefinition. More... | |
virtual Model * | getReferencedModel () |
Resolves and returns the referenced Model object of this ExternalModelDefinition. More... | |
virtual const std::string & | getSource () const |
Returns the value of the "source" attribute of this ExternalModelDefinition. More... | |
virtual int | getTypeCode () const |
Returns the libSBML type code of this object instance. More... | |
virtual bool | hasRequiredAttributes () const |
Returns true if the "modelRef" and "id" attributes are set, and false if not. More... | |
virtual bool | isSetId () const |
Predicate returning true or false depending on whether this object's "id" attribute has been set. More... | |
virtual bool | isSetMd5 () const |
Predicate returning true or false depending on whether this ExternalModelDefinition's "md5" attribute has been set. More... | |
virtual bool | isSetModelRef () const |
Predicate returning true or false depending on whether this ExternalModelDefinition's "modelRef" attribute has been set. More... | |
virtual bool | isSetName () const |
Predicate returning true or false depending on whether this object's "name" attribute has been set. More... | |
virtual bool | isSetSource () const |
Predicate returning true or false depending on whether this ExternalModelDefinition's "source" attribute has been set. More... | |
ExternalModelDefinition & | operator= (const ExternalModelDefinition &source) |
Assignment operator. More... | |
virtual int | setId (const std::string &id) |
Sets the value of the "id" attribute of this ExternalModelDefinition. More... | |
virtual int | setMd5 (const std::string &md5) |
Sets the value of the "md5" attribute of this ExternalModelDefinition. More... | |
virtual int | setModelRef (const std::string &id) |
Sets the value of the "modelRef" attribute of this ExternalModelDefinition. More... | |
virtual int | setName (const std::string &name) |
Sets the value of the "name" attribute of this ExternalModelDefinition. More... | |
virtual int | setSource (const std::string &source) |
Sets the value of the "source" attribute of this ExternalModelDefinition. More... | |
virtual int | unsetId () |
Unsets the value of the "id" attribute of this ExternalModelDefinition. More... | |
virtual int | unsetMd5 () |
Unsets the value of the "md5" attribute of this ExternalModelDefinition. More... | |
virtual int | unsetModelRef () |
Unsets the value of the "modelRef" attribute of this ExternalModelDefinition. More... | |
virtual int | unsetName () |
Unsets the value of the "name" attribute of this ExternalModelDefinition. More... | |
virtual int | unsetSource () |
Unsets the value of the "source" attribute of this ExternalModelDefinition. More... | |
virtual | ~ExternalModelDefinition () |
Destructor. More... | |
Friends | |
class | Submodel |
ExternalModelDefinition::ExternalModelDefinition | ( | unsigned int | level = CompExtension::getDefaultLevel() , |
unsigned int | version = CompExtension::getDefaultVersion() , |
||
unsigned int | pkgVersion = CompExtension::getDefaultPackageVersion() |
||
) |
Creates a new ExternalModelDefinition with the given level, version, and package version.
level | the SBML Level |
version | the Version within the SBML Level |
pkgVersion | the version of the package |
ExternalModelDefinition::ExternalModelDefinition | ( | CompPkgNamespaces * | compns | ) |
Creates a new ExternalModelDefinition with the given CompPkgNamespaces object.
compns | the namespace to use. |
ExternalModelDefinition::ExternalModelDefinition | ( | const ExternalModelDefinition & | source | ) |
Copy constructor.
source | the object to copy. |
|
virtual |
Destructor.
|
virtual |
Creates and returns a deep copy of this ExternalModelDefinition object.
|
virtual |
Returns the XML element name of this SBML object.
|
virtual |
Returns the value of the "id" attribute of this ExternalModelDefinition.
|
virtual |
Returns the value of the "md5" attribute of this ExternalModelDefinition.
|
virtual |
Returns the value of the "modelRef" attribute of this ExternalModelDefinition.
|
virtual |
Returns the value of the "name" attribute of this ExternalModelDefinition.
|
virtual |
Resolves and returns the referenced Model object of this ExternalModelDefinition.
If none can be found, an error is set and NULL is returned. The returned Model is a non-owning pointer to the model; the original Model is saved (along with the SBMLDocument from which it comes) as a child of the CompSBMLDocumentPlugin of the SBMLDocument to which this Model belongs. If this ExternalModelDefinition is not part of any SBMLDocument, NULL will be returned.
|
virtual |
Returns the value of the "source" attribute of this ExternalModelDefinition.
|
virtual |
Returns the libSBML type code of this object instance.
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 getPackageName()
method on the object.
|
virtual |
Returns true if the "modelRef" and "id" attributes are set, and false if not.
This method does not check to see if the referred-to model actually exists.
true
if the attributes are correctly set; false
if not.
|
virtual |
Predicate returning true
or false
depending on whether this object's "id" attribute has been set.
set
/unset
/isSet
methods:
The SBML specifications define certain attributes on some classes of
objects as being optional. This requires an application to be careful
about the distinction between two cases when reading a model: (1) a given
attribute has never been set to a value, and therefore should be
assumed to have the SBML-defined default value if one exists, and (2) a
given attribute has been set to a value, but the value happens to be an
empty string. The situation can be ambiguous when reading a model from a
file or data stream and then examining the data objects that libSBML
constructs as a result. LibSBML supports these distinctions by providing
methods to set, unset, and query the status of attributes that are
optional. The methods have names of the form set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
true
if the "id" attribute of this object has been set, false
otherwise.
|
virtual |
Predicate returning true
or false
depending on whether this ExternalModelDefinition's "md5" attribute has been set.
true
if this ExternalModelDefinition's "md5" attribute has been set, otherwise false
is returned.
|
virtual |
Predicate returning true
or false
depending on whether this ExternalModelDefinition's "modelRef" attribute has been set.
true
if this ExternalModelDefinition's "modelRef" attribute has been set, otherwise false
is returned.
|
virtual |
Predicate returning true
or false
depending on whether this object's "name" attribute has been set.
set
/unset
/isSet
methods:
The SBML specifications define certain attributes on some classes of
objects as being optional. This requires an application to be careful
about the distinction between two cases when reading a model: (1) a given
attribute has never been set to a value, and therefore should be
assumed to have the SBML-defined default value if one exists, and (2) a
given attribute has been set to a value, but the value happens to be an
empty string. The situation can be ambiguous when reading a model from a
file or data stream and then examining the data objects that libSBML
constructs as a result. LibSBML supports these distinctions by providing
methods to set, unset, and query the status of attributes that are
optional. The methods have names of the form set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
true
if the "name" attribute of this object has been set, false
otherwise.
|
virtual |
Predicate returning true
or false
depending on whether this ExternalModelDefinition's "source" attribute has been set.
true
if this ExternalModelDefinition's "source" attribute has been set, otherwise false
is returned. ExternalModelDefinition & ExternalModelDefinition::operator= | ( | const ExternalModelDefinition & | source | ) |
Assignment operator.
|
virtual |
Sets the value of the "id" attribute of this ExternalModelDefinition.
This method fails if the id
is not a valid syntax for an SId.
id | the identifier to use |
|
virtual |
Sets the value of the "md5" attribute of this ExternalModelDefinition.
|
virtual |
Sets the value of the "modelRef" attribute of this ExternalModelDefinition.
Fails if the id
is not a valid syntax for an SIdRef.
|
virtual |
Sets the value of the "name" attribute of this ExternalModelDefinition.
The string in name
is copied.
name | the new name for the ExternalModelDefinition |
|
virtual |
Sets the value of the "source" attribute of this ExternalModelDefinition.
source | the value to use for the "source" attribute. |
|
virtual |
Unsets the value of the "id" attribute of this ExternalModelDefinition.
|
virtual |
Unsets the value of the "md5" attribute of this ExternalModelDefinition.
|
virtual |
Unsets the value of the "modelRef" attribute of this ExternalModelDefinition.
|
virtual |
Unsets the value of the "name" attribute of this ExternalModelDefinition.
|
virtual |
Unsets the value of the "source" attribute of this ExternalModelDefinition.
|
friend |