![]() |
ImFusion C++ SDK 4.4.0
|
Infrastructure and functionality to dynamically extend application functionality via shared libraries. More...
Infrastructure and functionality to dynamically extend application functionality via shared libraries.
Plugins are a mechanism to dynamically extend an application with functionality without the application a-priori knowing all plugins that will be available at runtime. On the OS/filesystem level, they correspond to a dynamically linked shared library (on Windows: DLL).
In the context of the ImFusion SDK a library implementing an ImFusion plugin must meet a set of certain requirements to be considered a plugin:
For most use cases you should not implement the last 4 items manually as an SDK user. Instead you shall use the IMFUSION_REGISTER_PLUGIN() macro implementing them for you.
During the execution of the host application each ImFusion SDK plugin goes through a series of states:
In order to use plugins in your application you must make sure to load and initialize them via the PluginManager. If the default behavior and plugin seach paths (cf. PluginManager::defaultPluginSearchDirectories()) are sufficient for your use case, you can do so with a single function call:
Alternatively, you can customize the behavior and split the registration of plugins and their initialization into separate steps. For instance, by scanning a directory for suitable plugin libraries and then initializing all that were found.
Alternatively, if you can enumerate the list of plugins at build time, you can explicitly register and initialize each plugin individually.
If your application explicitly links against plugin libraries and those libraries use the default IMFUSION_REGISTER_PLUGIN() macro, then these plugins should automatically register themselves with PluginManager once loaded by the OS. In this case you can call PluginManager::initAllRegisteredPlugins() to initialize them without explicit enumeration.
Classes | |
| class | ImFusion::PluginBase |
| Base interface to interact with a plugin that can be loaded into an application at runtime. More... | |
| class | ImFusion::PluginManager |
| Global singleton for loading ImFusion plugins from shared libraries and initializing them. More... | |
| class | ImFusion::AlgorithmControllerFactory |
| Interface for algorithm controller factories. More... | |
| class | ImFusion::AlgorithmFactory |
| Interface for algorithm factories. More... | |
| class | ImFusion::CustomImage |
| Base interface for custom Image types that can be converted from/to MemImages and are supported by SharedImage. More... | |
| class | ImFusion::DataAnnotationFactory |
| Interface for data annotation factories. More... | |
| class | ImFusion::DataComponentFactory |
| Factory singleton for creating DataComponents from string IDs. More... | |
| class | ImFusion::ImFusionLibPlugin |
| Specialized interface for a plugin for the ImFusionLib. More... | |
| class | ImFusion::ImFusionPlugin |
| Base class for plugins that can be loaded by the ImFusion SDK. More... | |
| class | ImFusion::GlObjectFactory |
| Factory singleton for creating GlObject from string IDs. More... | |
| class | ImFusion::RendererFactory |
| Static factory class to manage registered slice and volume renderers to be used in views. More... | |
| class | ImFusion::DataDisplayHandlerFactory |
| Factory class to maintain the list of registered DataDisplayHandlers ,. More... | |
| class | ImFusion::Dicom::IOD_Registry |
| A registry that assigns a IOD implementation to a SOP class UID. More... | |
| class | ImFusion::SimilarityMeasureFactory |
| The SimilarityMeasureFactory class provides a generic interface to any kind of SimilarityMeasure. More... | |
Macros | |
| #define | IMFUSION_REGISTER_PLUGIN_NO_AUTO(...) |
| Helper macro to conveniently define and export the necessary functions and symbols for an ImFusion plugin but not implementing automatic self-registration of the plugin on OS library load. | |
| #define | IMFUSION_REGISTER_PLUGIN(...) |
| Helper macro to conveniently define and export the necessary functions and symbols for an ImFusion plugin and also implement automatic self-registration of the plugin on OS library load. | |
| #define | IMFUSION_REGISTER_LEGACY_PLUGIN(PluginClassName, PluginID) |
| Convenience macro to DLL-export a legacy ImFusionPlugin. | |
| #define IMFUSION_REGISTER_PLUGIN_NO_AUTO | ( | ... | ) |
#include <ImFusion/Core/Plugin.h>
Helper macro to conveniently define and export the necessary functions and symbols for an ImFusion plugin but not implementing automatic self-registration of the plugin on OS library load.
| #define IMFUSION_REGISTER_PLUGIN | ( | ... | ) |
#include <ImFusion/Core/Plugin.h>
Helper macro to conveniently define and export the necessary functions and symbols for an ImFusion plugin and also implement automatic self-registration of the plugin on OS library load.
The PluginVersion argument is optional and can be omitted.
| #define IMFUSION_REGISTER_LEGACY_PLUGIN | ( | PluginClassName, | |
| PluginID ) |
#include <ImFusion/Base/ImFusionPlugin.h>
Convenience macro to DLL-export a legacy ImFusionPlugin.
Legacy plugins will not self-register them on library load. They usually performed their initialization during class construction and therefore would be prone to deadlock otherwise.