Loading...
Searching...
No Matches
doc_extension_sbaseplugincreator Class Reference

## Detailed Description

  This is a template class that constitutes another piece of glue used to connect package extension objects to the overall package support framework in libSBML. This particular template class is used to create factory objects that in turn construct new instances of package plugin objects when necessary. These factories are invoked when, for example, libSBML encounters an SBML Level 3 package in an SBML document and needs to activate the corresponding libSBML package extension.

The use of SBasePluginCreator is a simple matter of invoking it on every object derived from SBasePlugin or SBMLDocumentPlugin (which is itself derived from SBasePlugin). The typical use is illustrated by the following code fragment:

SBaseExtensionPoint docExtPoint("core", SBML_DOCUMENT);
SBaseExtensionPoint modelExtPoint("core", SBML_MODEL);
SBasePluginCreator<GroupsSBMLDocumentPlugin, GroupsExtension> docPluginCreator(docExtPoint, pkgURIs);
SBasePluginCreator<GroupsModelPlugin, GroupsExtension> modelPluginCreator(modelExtPoint, pkgURIs);

The code above is typically placed in the implementation of the `init()` method of the package class derived from SBMLExtension. (For the example above, it would be in the `GroupsExtension.cpp` file.)