libSBML Perl API  libSBML 5.10.0 Perl API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SBMLExtensionRegistry Class Reference

Detailed Description

{core} Registry class in which extension packages are registered.

Public Member Functions

int addExtension (const SBMLExtension *ext)
 Add the given SBMLExtension to this SBMLExtensionRegistry. More...
 
void addL2Namespaces (XMLNamespaces *xmlns) const
 adds all L2 Extension namespaces to the namespace list. More...
 
void disableUnusedPackages (SBMLDocument *doc)
 Goes through all extensions in the list of plugins of the given document and disables all plugins that are not being used. More...
 
void enableL2NamespaceForDocument (SBMLDocument *doc) const
 Enables all extensions that support serialization / deserialization with SBML Annotations. More...
 
SBMLExtensiongetExtension (const std::string &package)
 Returns an SBMLExtension object with the given package URI or package name (string). More...
 
unsigned int getNumExtension (const SBaseExtensionPoint &extPoint)
 Returns the number of SBMLExtension* with the given extension point. More...
 
bool isEnabled (const std::string &uri)
 Checks if the extension with the given URI is enabled (true) or disabled (false) More...
 
bool isRegistered (const std::string &uri)
 Checks if the extension with the given URI is registered (true) or not (false) More...
 
void removeL2Namespaces (XMLNamespaces *xmlns) const
 Remove all L2 Extension namespaces from the namespace list. More...
 
bool setEnabled (const std::string &uri, bool isEnabled)
 Enable/disable the package with the given uri. More...
 

Static Public Member Functions

static void disablePackage (const std::string &package)
 Disables the package with the given URI / name. More...
 
static void enablePackage (const std::string &package)
 Enables the package with the given URI / name. More...
 
static SBMLExtensionRegistrygetInstance ()
 Returns an instance (singleton) of the SBMLExtensionRegistry class. More...
 
static unsigned int getNumRegisteredPackages ()
 Returns the number of registered packages. More...
 
static std::string getRegisteredPackageName (unsigned int index)
 Returns the registered package name at the given index. More...
 
static ListgetRegisteredPackageNames ()
 Returns a list of registered packages (such as 'layout', 'fbc' or 'comp') the list contains char* strings and has to be freed by the caller. More...
 
static bool isPackageEnabled (const std::string &package)
 If the given package is enabled, returns true; otherwise, returns false. More...
 

Member Function Documentation

int SBMLExtensionRegistry::addExtension ( const SBMLExtension ext)

Add the given SBMLExtension 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:
void SBMLExtensionRegistry::addL2Namespaces ( XMLNamespaces xmlns) const

adds all L2 Extension namespaces to the namespace list.

This will call all overriden SBMLExtension::addL2Namespaces methods.

void SBMLExtensionRegistry::disablePackage ( const std::string &  package)
static

Disables the package with the given URI / name.

void SBMLExtensionRegistry::disableUnusedPackages ( SBMLDocument doc)

Goes through all extensions in the list of plugins of the given document and disables all plugins that are not being used.

void SBMLExtensionRegistry::enableL2NamespaceForDocument ( SBMLDocument doc) const

Enables all extensions that support serialization / deserialization with SBML Annotations.

void SBMLExtensionRegistry::enablePackage ( const std::string &  package)
static

Enables the package with the given URI / name.

SBMLExtension* SBMLExtensionRegistry::getExtension ( const std::string &  package)

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

Parameters
packagethe URI or name of the package extension
Returns
a clone of the SBMLExtension object with the given package URI or name. The returned extension is to be freed (i.e.: deleted) by the caller!
static SBMLExtensionRegistry& SBMLExtensionRegistry::getInstance ( )
static

Returns an instance (singleton) of the SBMLExtensionRegistry class.

This function needs to be invoked when manipulating the SBMLExtensionRegistry class.

Returns
the instance of the SBMLExtensionRegistry object.
unsigned int SBMLExtensionRegistry::getNumExtension ( const SBaseExtensionPoint extPoint)

Returns the number of SBMLExtension* with the given extension point.

Parameters
extPointthe SBaseExtensionPoint
Returns
the number of SBMLExtension* with the given extension point.
unsigned int SBMLExtensionRegistry::getNumRegisteredPackages ( )
static

Returns the number of registered packages.

Returns
the number of registered packages.
Examples:
printRegisteredPackages.cpp.
std::string SBMLExtensionRegistry::getRegisteredPackageName ( unsigned int  index)
static

Returns the registered package name at the given index.

Parameters
indexzero based index of the package name to return
Returns
the package name with the given index or NULL
Examples:
printRegisteredPackages.cpp.
List * SBMLExtensionRegistry::getRegisteredPackageNames ( )
static

Returns a list of registered packages (such as 'layout', 'fbc' or 'comp') the list contains char* strings and has to be freed by the caller.

Returns
the names of the registered packages in a list
bool SBMLExtensionRegistry::isEnabled ( const std::string &  uri)

Checks if the extension with the given URI is enabled (true) or disabled (false)

Parameters
urithe URI of the target package.
Returns
false will be returned if the given package is disabled or not registered, otherwise true will be returned.
bool SBMLExtensionRegistry::isPackageEnabled ( const std::string &  package)
static

If the given package is enabled, returns true; otherwise, returns false.

Returns
the status (enabled = true, disabled = false of the given package.
the status (enabled = true, disabled = false of the given package.
bool SBMLExtensionRegistry::isRegistered ( const std::string &  uri)

Checks if the extension with the given URI is registered (true) or not (false)

Parameters
urithe URI of the target package.
Returns
true will be returned if the package with the given URI is registered, otherwise false will be returned.
void SBMLExtensionRegistry::removeL2Namespaces ( XMLNamespaces xmlns) const

Remove all L2 Extension namespaces from the namespace list.

This will call all overriden SBMLExtension::removeL2Namespaces methods.

bool SBMLExtensionRegistry::setEnabled ( const std::string &  uri,
bool  isEnabled 
)

Enable/disable the package with the given uri.

Parameters
urithe URI of the target package.
isEnabledthe bool value corresponding to enabled (true) or disabled (false)
Returns
false will be returned if the given bool value is false or the given package is not registered, otherwise true will be returned.