libSBML C++ API  5.20.2
CallbackRegistry Class Reference

Static Public Member Functions

static void addCallback (Callback *cb)
 Registers a new processing callback that will be called with a newly instantiated ModelDefinition object. More...
 
static void clearCallbacks ()
 Clears all registered processing callbacks. More...
 
static int getNumCallbacks ()
 
static int invokeCallbacks (SBMLDocument *doc)
 Invokes all registered callbacks on the given document. More...
 
static void removeCallback (Callback *cb)
 Removes the specified callback from the list of registered callbacks. More...
 
static void removeCallback (int index)
 Removes the callback with given index. More...
 

Protected Member Functions

 CallbackRegistry ()
 protected constructor, use the static methods for access. More...
 

Static Protected Member Functions

static CallbackRegistrygetInstance ()
 the static instance of the class More...
 

Constructor & Destructor Documentation

◆ CallbackRegistry()

CallbackRegistry::CallbackRegistry ( )
protected

protected constructor, use the static methods for access.

Member Function Documentation

◆ addCallback()

void CallbackRegistry::addCallback ( Callback cb)
static

Registers a new processing callback that will be called with a newly instantiated ModelDefinition object.

This allows for all post processing on it that needs to happen before integrating it with the target document.

Parameters
cbthe callback.
Examples
validateSBML.cpp.

◆ clearCallbacks()

void CallbackRegistry::clearCallbacks ( )
static

Clears all registered processing callbacks.

◆ getInstance()

CallbackRegistry & CallbackRegistry::getInstance ( )
staticprotected

the static instance of the class

◆ getNumCallbacks()

int CallbackRegistry::getNumCallbacks ( )
static
Returns
the number of registered callbacks.

◆ invokeCallbacks()

int CallbackRegistry::invokeCallbacks ( SBMLDocument doc)
static

Invokes all registered callbacks on the given document.

If the callbacks indicate that processing should be stopped they return a value other than operation success.

Returns
LIBSBML_OPERATION_SUCCESS to indicate that processing should be continued, any other value to stop processing

◆ removeCallback() [1/2]

void CallbackRegistry::removeCallback ( Callback cb)
static

Removes the specified callback from the list of registered callbacks.

Parameters
cbthe callback to be removed.

◆ removeCallback() [2/2]

void CallbackRegistry::removeCallback ( int  index)
static

Removes the callback with given index.

Parameters
indexthe index of the callback to be removed from the list.