Set of SBML Level + Version + namespace triples.
This class of objects is defined by libSBML only and has no direct
equivalent in terms of SBML components. This class is not prescribed by
the SBML specifications, although it is used to implement features
defined in SBML.
SBMLExtensionNamespaces is a template class. It is extended from SBMLNamespaces and is meant to be used by package extensions to store the SBML Level, Version within a Level, and package version of the SBML Level 3 package implemented by a libSBML package extension.
How to use SBMLExtensionNamespaces for a package implementation
- Each package extension in libSBML needs to extend and instantiate the template class SBMLExtensionNamespaces, as well as declare a specific
typedef
. The following sections explain these steps in detail.
1. Define the typedef
Each package needs to declare a package-specific version of the SBMLExtensionNamespaces class using a typedef
. The following example code demonstrates how this is done in the case of the Layout package:
typedef SBMLExtensionNamespaces<LayoutExtension> LayoutPkgNamespaces;
This creates a new type called LayoutPkgNamespaces. The code above is usually placed in the same file that contains the SBMLExtension-derived definition of the package extension base class. In the case of the Layout package, this is in the file src/packages/layout/extension/LayoutExtension.h
in the libSBML source distribution.
2. Instantiate a template instance
Each package needs to instantiate a template instance of the SBMLExtensionNamespaces class. The following example code demonstrates how this is done in the case of the Layout package:
template class LIBSBML_EXTERN SBMLExtensionNamespaces<LayoutExtension>;
In the case of the Layout package, the code above is located in the file src/packages/layout/extension/LayoutExtension.cpp
in the libSBML source distribution.
3. Create constructors that accept the class
Each SBase-derived class in the package extension should implement a constructor that accepts the SBMLExtensionNamespaces-derived class as an argument. For example, in the Layout package, the class BoundBox has a constructor declared as follows
BoundingBox(LayoutPkgNamespaces layoutns);
The implementation of this constructor must, among other things, take the argument namespace object and use it to set the XML namespace URI for the object. Again, for the BoundingBox example:
BoundingBox.BoundingBox()
: SBase(layoutns)
,mPosition(layoutns)
,mDimensions(layoutns)
,mPositionExplicitlySet (false)
,mDimensionsExplicitlySet (false)
{
setElementNamespace(layoutns->getURI());
connectToChild();
mPosition.setElementName('position');
loadPlugins(layoutns);
}
|
def | __init__ (self, args) |
| Set of SBML Level + Version + namespace triples. More...
|
|
def | addNamespace (self, uri, prefix) |
| Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object. More...
|
|
def | addNamespaces (self, xmlns) |
| Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object. More...
|
|
def | addPackageNamespace (self, args) |
| Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. More...
|
|
def | addPackageNamespaces (self, xmlns) |
| Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function). More...
|
|
def | clone (self) |
| Creates and returns a deep copy of this SBMLNamespaces object. More...
|
|
def | freeSBMLNamespaces (supportedNS) |
| Frees the list of supported namespaces as generated by getSupportedNamespaces(). More...
|
|
def | getLevel (self, args) |
| Get the SBML Level of this SBMLNamespaces object. More...
|
|
def | getNamespaces (self, args) |
| Get the XML namespaces list for this SBMLNamespaces object. More...
|
|
def | getPackageName (self) |
| Returns the name of the main package for this namespace. More...
|
|
def | getPackageVersion (self) |
|
def | getSBMLNamespaceURI (level, version) |
| Returns a string representing the SBML XML namespace for the given level and version of SBML. More...
|
|
def | getSupportedNamespaces () |
| Returns a list of all supported SBMLNamespaces in this version of libsbml. More...
|
|
def | getURI (self) |
| Returns a string representing the SBML XML namespace of this object. More...
|
|
def | getVersion (self, args) |
| Get the SBML Version of this SBMLNamespaces object. More...
|
|
def | isSBMLNamespace (uri) |
| Predicate returning True if the given URL is one of SBML XML namespaces. More...
|
|
def | isValidCombination (self) |
| Predicate returning True if the given set of namespaces represent a valid set. More...
|
|
def | removeNamespace (self, uri) |
| Removes an XML namespace from the set of namespaces within this SBMLNamespaces object. More...
|
|
def | removePackageNamespace (self, level, version, pkgName, pkgVersion) |
| Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object. More...
|
|