libSBML C# API  libSBML 5.13.0 C# API
libsbmlcs.SBMLExtensionRegistry Class Reference
Inheritance diagram for libsbmlcs.SBMLExtensionRegistry:
[legend]

Detailed Description

{core}

Registry where package extensions are registered.

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.

This class provides a central registry of all extensions known to libSBML. Each package extension must be registered with the registry. The registry class is accessed by various classes to retrieve information about known package extensions and to create additional attributes and/or elements by factory objects of the package extensions.

The package extension registry is implemented as a singleton instance of SBMLExtensionRegistry. The class provides only utility functionality; implementations of SBML packages do not need to implement any subclasses or methods of this class. SBMLExtensionRegistry is useful for its facilities to query the known packages, and to enable or disable packages selectively.

Public Member Functions

int addExtension (SBMLExtension ext)
 Add the given SBMLExtension object to this SBMLExtensionRegistry. More...
 
void addL2Namespaces (XMLNamespaces xmlns)
 Adds SBML Level 2 namespaces to the namespace list. More...
 
void disableUnusedPackages (SBMLDocument doc)
 Disables unused packages. More...
 
virtual void Dispose ()
 
void enableL2NamespaceForDocument (SBMLDocument doc)
 Enables package extensions that support serialization to SBML annotations. More...
 
SBMLExtension getExtension (string package)
 Returns an SBMLExtension object with the given package URI or package name. More...
 
long getNumExtension (SBaseExtensionPoint extPoint)
 Returns the number of extensions that have a given extension point. More...
 
bool isEnabled (string uri)
 Returns true if the given extension is enabled. More...
 
bool isRegistered (string uri)
 Returns true if a package extension is registered for the corresponding package URI. More...
 
void removeL2Namespaces (XMLNamespaces xmlns)
 Removes SBML Level 2 namespaces from the namespace list. More...
 
bool setEnabled (string uri, bool isEnabled)
 Enables or disable the package with the given URI. More...
 

Static Public Member Functions

static void disablePackage (string package)
 Disables the package with the given URI or name. More...
 
static void enablePackage (string package)
 Enables the package with the given URI / name. More...
 
static SWIGTYPE_p_std__vectorT_std__string_t getAllRegisteredPackageNames ()
 Returns a list of registered packages. More...
 
static SBMLExtensionRegistry getInstance ()
 Returns a singleton instance of the registry. More...
 
static long getNumRegisteredPackages ()
 Returns the number of registered packages. More...
 
static string getRegisteredPackageName (long index)
 Returns the nth registered package. More...
 
static bool isPackageEnabled (string package)
 Returns true if the named package is enabled. More...
 

Protected Attributes

bool swigCMemOwn
 

Member Function Documentation

§ addExtension()

int libsbmlcs.SBMLExtensionRegistry.addExtension ( SBMLExtension  ext)

Add the given SBMLExtension object to this SBMLExtensionRegistry.

Parameters
extthe SBMLExtension object to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

§ addL2Namespaces()

void libsbmlcs.SBMLExtensionRegistry.addL2Namespaces ( XMLNamespaces  xmlns)

Adds SBML Level 2 namespaces to the namespace list.

Parameters
xmlnsan XMLNamespaces object providing one or more namespaces to be added.

§ disablePackage()

static void libsbmlcs.SBMLExtensionRegistry.disablePackage ( string  package)
static

Disables the package with the given URI or name.

Parameters
packagea string representing the URI or name of the SBML package whose package extension is to be disabled.

§ disableUnusedPackages()

void libsbmlcs.SBMLExtensionRegistry.disableUnusedPackages ( SBMLDocument  doc)

Disables unused packages.

This method walks through all extensions in the list of plugins of the given SBML document doc, and disables all that are not being used.

Parameters
docthe SBMLDocument object whose unused package extensions should be disabled.

§ Dispose()

virtual void libsbmlcs.SBMLExtensionRegistry.Dispose ( )
virtual

§ enableL2NamespaceForDocument()

void libsbmlcs.SBMLExtensionRegistry.enableL2NamespaceForDocument ( SBMLDocument  doc)

Enables package extensions that support serialization to SBML annotations.

SBML Level 2 does not have a package mechanism in the way that SBML Level 3 does. However, SBML annotations can be used to store SBML constructs. In fact, a widely-used approach to developing SBML Level 3 packages involves first using them as annotations.

Parameters
docthe SBMLDocument object for which this should be enabled.

§ enablePackage()

static void libsbmlcs.SBMLExtensionRegistry.enablePackage ( string  package)
static

Enables the package with the given URI / name.

Parameters
packagethe name or URI of a package to enable.

§ getAllRegisteredPackageNames()

static SWIGTYPE_p_std__vectorT_std__string_t libsbmlcs.SBMLExtensionRegistry.getAllRegisteredPackageNames ( )
static

Returns a list of registered packages.

This method returns a vector of strings containing the nicknames of the SBML packages for which package extensions are registered with this copy of libSBML. The vector will contain string objects.

Returns
a vector of strings

§ getExtension()

SBMLExtension libsbmlcs.SBMLExtensionRegistry.getExtension ( string  package)

Returns an SBMLExtension object with the given package URI or package name.

Parameters
packagea string representing the URI or name of the SBML package whose package extension is being sought.
Returns
a clone of the SBMLExtension object with the given package URI or name.
Note
The caller is responsible for freeing the object returned. Since the object is a clone, freeing it will not result in the deletion of the original package extension object.

§ getInstance()

static SBMLExtensionRegistry libsbmlcs.SBMLExtensionRegistry.getInstance ( )
static

Returns a singleton instance of the registry.

Callers need to obtain a copy of the package extension registry before they can invoke its methods. The registry is implemented as a singleton, and this is the method callers can use to get a copy of it.

Returns
the instance of the SBMLExtensionRegistry object.

§ getNumExtension()

long libsbmlcs.SBMLExtensionRegistry.getNumExtension ( SBaseExtensionPoint  extPoint)

Returns the number of extensions that have a given extension point.

Parameters
extPointthe SBaseExtensionPoint object
Returns
the number of SBMLExtension-derived objects with the given extension point.

§ getNumRegisteredPackages()

static long libsbmlcs.SBMLExtensionRegistry.getNumRegisteredPackages ( )
static

Returns the number of registered packages.

Returns
a count of the registered package extensions.

§ getRegisteredPackageName()

static string libsbmlcs.SBMLExtensionRegistry.getRegisteredPackageName ( long  index)
static

Returns the nth registered package.

Parameters
indexzero-based index of the package name to return.
Returns
the package name with the given index, or null if none such exists.
See also
getNumRegisteredPackages()

§ isEnabled()

bool libsbmlcs.SBMLExtensionRegistry.isEnabled ( string  uri)

Returns true if the given extension is enabled.

Parameters
urithe URI of the target package.
Returns
false if the given package is disabled or not registered, true otherwise.

§ isPackageEnabled()

static bool libsbmlcs.SBMLExtensionRegistry.isPackageEnabled ( string  package)
static

Returns true if the named package is enabled.

Parameters
packagethe name or URI of a package to test.
Returns
true if the package is enabled, false otherwise.

§ isRegistered()

bool libsbmlcs.SBMLExtensionRegistry.isRegistered ( string  uri)

Returns true if a package extension is registered for the corresponding package URI.

Parameters
urithe URI of the target package.
Returns
true if the package with the given URI is registered, otherwise returns false.

§ removeL2Namespaces()

void libsbmlcs.SBMLExtensionRegistry.removeL2Namespaces ( XMLNamespaces  xmlns)

Removes SBML Level 2 namespaces from the namespace list.

Parameters
xmlnsan XMLNamespaces object listing one or more namespaces to be removed.

§ setEnabled()

bool libsbmlcs.SBMLExtensionRegistry.setEnabled ( string  uri,
bool  isEnabled 
)

Enables or disable the package with the given URI.

Parameters
urithe URI of the target package.
isEnabledtrue to enable the package, false to disable.
Returns
false if isEnabled is false or the given package is not registered, otherwise this method returns true.

Member Data Documentation

§ swigCMemOwn

bool libsbmlcs.SBMLExtensionRegistry.swigCMemOwn
protected