SBMLExtensionNamespaces< SBMLExtensionType > Class Template Reference
Inheritance diagram for SBMLExtensionNamespaces< SBMLExtensionType >:

List of all members.


Detailed Description

template<class SBMLExtensionType>
class SBMLExtensionNamespaces< SBMLExtensionType >

Class to store level, version and namespace information of SBML extension package.

Public Member Functions

void addNamespace (const std::string &uri, const std::string &prefix)
 Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object.
void addNamespaces (const XMLNamespaces *xmlns)
 Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.
int addPackageNamespace (const std::string &pkgName, unsigned int pkgVersion, const std::string &prefix="")
 Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.
int addPackageNamespaces (const XMLNamespaces *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).
virtual ISBMLExtensionNamespaces * clone () const
 Creates and returns a deep copy of this SBMLExtensionNamespaces.
unsigned int getLevel ()
 Get the SBML Level of this SBMLNamespaces object.
unsigned int getLevel () const
 Get the SBML Level of this SBMLNamespaces object.
XMLNamespaces * getNamespaces ()
 Get the XML namespaces list for this SBMLNamespaces object.
const XMLNamespaces * getNamespaces () const
 Get the XML namespaces list for this SBMLNamespaces object.
virtual const std::string & getPackageName () const
 Returns the name of the main package for this namespace.
unsigned int getPackageVersion () const
 Get the SBML Package Version of this SBMLExtensionNamespaces object.
virtual std::string getURI () const
 Returns a string representing the Package XML namespace of this object.
unsigned int getVersion ()
 Get the SBML Version of this SBMLNamespaces object.
unsigned int getVersion () const
 Get the SBML Version of this SBMLNamespaces object.
bool isValidCombination ()
 Predicate returning true if the given set of namespaces represent a valid set.
SBMLExtensionNamespaces & operator= (const SBMLExtensionNamespaces &orig)
 Assignment operator for SBMLExtensionNamespaces.
int removeNamespace (const std::string &uri)
 Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.
int removePackageNamespace (unsigned int level, unsigned version, const std::string &pkgName, unsigned int pkgVersion)
 Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object.
 SBMLExtensionNamespaces (unsigned int level=SBMLExtensionType::getDefaultLevel(), unsigned int version=SBMLExtensionType::getDefaultVersion(), unsigned int pkgVersion=SBMLExtensionType::getDefaultPackageVersion(), const std::string &prefix=SBMLExtensionType::getPackageName())
 Creates a new SBMLExtensionNamespaces object corresponding to the given SBML level, version and package version.
 SBMLExtensionNamespaces (const SBMLExtensionNamespaces &orig)
 Copy constructor; creates a copy of a SBMLExtensionNamespaces.
virtual ~SBMLExtensionNamespaces ()
 Destroys this SBMLExtensionNamespaces object.

Static Public Member Functions

static std::string getSBMLNamespaceURI (unsigned int level, unsigned int version)
 Returns a string representing the SBML XML namespace for the given level and version of SBML.
static const List * getSupportedNamespaces ()
 Returns a list of all supported SBMLNamespaces in this version of libsbml.
static bool isSBMLNamespace (const std::string &uri)
 Predicate returning true if the given URL is one of SBML XML namespaces.

Constructor & Destructor Documentation

template<class SBMLExtensionType >
SBMLExtensionNamespaces< SBMLExtensionType >::SBMLExtensionNamespaces ( unsigned int  level = SBMLExtensionType::getDefaultLevel(),
unsigned int  version = SBMLExtensionType::getDefaultVersion(),
unsigned int  pkgVersion = SBMLExtensionType::getDefaultPackageVersion(),
const std::string &  prefix = SBMLExtensionType::getPackageName() 
)

Creates a new SBMLExtensionNamespaces object corresponding to the given SBML level, version and package version.

Note:
SBMLExtensionException will be thrown if the extension module that supports the combination of the given sbml level, sbml version, package name, and package version has not been registered.
Parameters:
levelthe SBML level
versionthe SBML version
pkgVersionthe package version
prefixthe prefix of the package namespace (e.g. "layout", "multi") to be added. The package's name will be used if the given string is empty (default).
template<class SBMLExtensionType >
virtual SBMLExtensionNamespaces< SBMLExtensionType >::~SBMLExtensionNamespaces ( ) [virtual]

Destroys this SBMLExtensionNamespaces object.

template<class SBMLExtensionType >
SBMLExtensionNamespaces< SBMLExtensionType >::SBMLExtensionNamespaces ( const SBMLExtensionNamespaces< SBMLExtensionType > &  orig)

Copy constructor; creates a copy of a SBMLExtensionNamespaces.

Parameters:
origthe SBMLExtensionNamespaces instance to copy.

Member Function Documentation

void SBMLNamespaces::addNamespace ( const std::string &  uri,
const std::string &  prefix 
) [inherited]

Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object.

Parameters:
urithe XML namespace to be added.
prefixthe prefix of the namespace to be added.
void SBMLNamespaces::addNamespaces ( const XMLNamespaces *  xmlns) [inherited]

Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.

The following code gives an example of how one could add the XHTML namespace to the list of namespaces recorded by the top-level <sbml> element of a model. It gives the new namespace a prefix of html.

Parameters:
xmlnsthe XML namespaces to be added.
int SBMLNamespaces::addPackageNamespace ( const std::string &  pkgName,
unsigned int  pkgVersion,
const std::string &  prefix = "" 
) [inherited]

Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.

The SBML Level and SBML Version of this object is used.

Note:
An XML namespace of a non-registered package extension can't be added by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
Parameters:
pkgNamethe string of package name (e.g. "layout", "multi")
pkgVersionthe package version
prefixthe prefix of the package namespace to be added. The package's name will be used if the given string is empty (default).
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
See also:
addNamespace()
int SBMLNamespaces::addPackageNamespaces ( const XMLNamespaces *  xmlns) [inherited]

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

Note:
XML namespaces of a non-registered package extensions are not added (just ignored) by this function. LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned if the given xmlns is null.
Parameters:
xmlnsthe XML namespaces to be added.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
template<class SBMLExtensionType >
virtual ISBMLExtensionNamespaces* SBMLExtensionNamespaces< SBMLExtensionType >::clone ( ) const [virtual]

Creates and returns a deep copy of this SBMLExtensionNamespaces.

Returns:
a (deep) copy of this SBMLExtensionNamespaces.

Reimplemented from SBMLNamespaces.

unsigned int SBMLNamespaces::getLevel ( ) [inherited]

Get the SBML Level of this SBMLNamespaces object.

Returns:
the SBML Level of this SBMLNamespaces object.
unsigned int SBMLNamespaces::getLevel ( ) const [inherited]

Get the SBML Level of this SBMLNamespaces object.

Returns:
the SBML Level of this SBMLNamespaces object.

Get the XML namespaces list for this SBMLNamespaces object.

The plural is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model, and therefore there may be multiple XML namespaces involved too. However, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.

Returns:
the XML namespaces of this SBMLNamespaces object.
const XMLNamespaces * SBMLNamespaces::getNamespaces ( ) const [inherited]

Get the XML namespaces list for this SBMLNamespaces object.

The plural is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model, and therefore there may be multiple XML namespaces involved too. However, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.

Returns:
the XML namespaces of this SBMLNamespaces object.
template<class SBMLExtensionType >
virtual const std::string& SBMLExtensionNamespaces< SBMLExtensionType >::getPackageName ( ) const [virtual]

Returns the name of the main package for this namespace.

Returns:
the name of the main package for this namespace.

Reimplemented from SBMLNamespaces.

template<class SBMLExtensionType >
unsigned int SBMLExtensionNamespaces< SBMLExtensionType >::getPackageVersion ( ) const

Get the SBML Package Version of this SBMLExtensionNamespaces object.

Returns:
the SBML Package Version of this SBMLExtensionNamespaces object.
std::string SBMLNamespaces::getSBMLNamespaceURI ( unsigned int  level,
unsigned int  version 
) [static, inherited]

Returns a string representing the SBML XML namespace for the given level and version of SBML.

Parameters:
levelthe SBML level
versionthe SBML version
Returns:
a string representing the SBML namespace that reflects the SBML Level and Version specified.
const List * SBMLNamespaces::getSupportedNamespaces ( ) [static, inherited]

Returns a list of all supported SBMLNamespaces in this version of libsbml.

Returns:
a list with supported SBML namespaces.
template<class SBMLExtensionType >
virtual std::string SBMLExtensionNamespaces< SBMLExtensionType >::getURI ( ) const [virtual]

Returns a string representing the Package XML namespace of this object.

Returns:
a string representing the SBML namespace that reflects the SBML Level and Version of this object.

Reimplemented from SBMLNamespaces.

unsigned int SBMLNamespaces::getVersion ( ) [inherited]

Get the SBML Version of this SBMLNamespaces object.

Returns:
the SBML Version of this SBMLNamespaces object.
unsigned int SBMLNamespaces::getVersion ( ) const [inherited]

Get the SBML Version of this SBMLNamespaces object.

Returns:
the SBML Version of this SBMLNamespaces object.
bool SBMLNamespaces::isSBMLNamespace ( const std::string &  uri) [static, inherited]

Predicate returning true if the given URL is one of SBML XML namespaces.

Parameters:
urithe URI of namespace
Returns:
true if the "uri" is one of SBML namespaces, false otherwise.
bool SBMLNamespaces::isValidCombination ( ) [inherited]

Predicate returning true if the given set of namespaces represent a valid set.

Returns:
true if the set of namespaces is valid, false otherwise.
template<class SBMLExtensionType >
SBMLExtensionNamespaces& SBMLExtensionNamespaces< SBMLExtensionType >::operator= ( const SBMLExtensionNamespaces< SBMLExtensionType > &  orig)

Assignment operator for SBMLExtensionNamespaces.

int SBMLNamespaces::removeNamespace ( const std::string &  uri) [inherited]

Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.

Parameters:
urithe XML namespace to be added.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
int SBMLNamespaces::removePackageNamespace ( unsigned int  level,
unsigned  version,
const std::string &  pkgName,
unsigned int  pkgVersion 
) [inherited]

Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object.

Parameters:
levelthe SBML level
versionthe SBML version
pkgNamethe string of package name (e.g. "layout", "multi")
pkgVersionthe package version
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines