![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/PluginFramework/ctkPluginActivator.h>
Public Member Functions | |
virtual void | start (ctkPluginContext *context)=0 |
virtual void | stop (ctkPluginContext *context)=0 |
virtual | ~ctkPluginActivator () |
Customizes the starting and stopping of a plugin.
ctkPluginActivator
is an interface that must be implemented by every plugin in the Framework. The Framework can create instances of a plugin's ctkPluginActivator
as required. If an instance's ctkPluginActivator::start
method executes successfully, it is guaranteed that the same instance's ctkPluginActivator::stop
method will be called when the plugin is to be stopped. The Framework must not concurrently call a ctkPluginActivator
object.
ctkPluginActivator
is a Qt interface which must be implemented using the standard Qt Plugin facilities:
And in your implementation file:
where mypluginlib
is the basename of your shared plugin library.
See the Qt Documentation about How to Create Qt Plugins for details.
The class implementing the ctkPluginActivator
interface must have a public constructor that takes no parameters so that a ctkPluginActivator
object can be created by QPluginLoader::instance
.
Definition at line 71 of file ctkPluginActivator.h.
|
inlinevirtual |
Definition at line 75 of file ctkPluginActivator.h.
|
pure virtual |
Called when this plugin is started so the Framework can perform the plugin-specific activities necessary to start this plugin. This method can be used to register services or to allocate any resources that this plugin needs.
This method must complete and return to its caller in a timely manner.
context | The execution context of the plugin being started. |
std::exception | If this method throws an exception, this plugin is marked as stopped and the Framework will remove this plugin's listeners, unregister all services registered by this plugin, and release all services used by this plugin. |
|
pure virtual |
Called when this plugin is stopped so the Framework can perform the plugin-specific activities necessary to stop the plugin. In general, this method should undo the work that the ctkPluginActivator::start
method started. There should be no active threads that were started by this plugin when this plugin returns. A stopped plugin must not call any Framework objects.
This method must complete and return to its caller in a timely manner.
context | The execution context of the plugin being stopped. |
std::exception | If this method throws an exception, the plugin is still marked as stopped, and the Framework will remove the plugin's listeners, unregister all services registered by the plugin, and release all services used by the plugin. |