ImFusion C++ SDK 4.4.0
ImFusion::ImFusionLibPlugin Class Reference

#include <ImFusion/Base/ImFusionLibPlugin.h>

Specialized interface for a plugin for the ImFusionLib. More...

Inheritance diagram for ImFusion::ImFusionLibPlugin:

Detailed Description

Specialized interface for a plugin for the ImFusionLib.

In addition to the base interface it provides the setApplicationController() member function that can be called by host applications with an ApplicationController so that plugins get access to it.

Note
In contrast to the legacy ImFusionPlugin interface, you must conduct license checks and factory registration yourself in init(). A typical plugin initialization function has the following structure: ``` PluginBase::Status MyPlugin::init() { // conduct license check if necessary at the beginning if (!isLicensed("<entitlement ID for plugin>")) return Status::LicenseCheckFailed;

// instantiate necessary factories and register them with FactoryRegistry m_algFactory = std::make_unique<MyAlgorithmFactory>(); m_algCtrlFactory = std::make_unique<MyAlgorithmControllerFactory>(); registerFactories(m_algFactory.get(), m_algCtrlFactory.get(), nullptr);

// perform registration of further factories etc. [...]

return Status::Success; } ```

See also

Public Member Functions

virtual void setApplicationController (ApplicationController &)
 Gives the plugin access to the application controller.
Public Member Functions inherited from ImFusion::PluginBase
std::string pluginId () const
 Convenience function to query the plugin ID of a concrete instance at runtime.
PluginManager::PluginStatus pluginStatus () const
 Convenience function to query the plugin status of a concrete instance at runtime.
virtual std::string author () const =0
 Name of the author of the plugin for informative purposes.
virtual std::string description () const =0
 Description of the plugin purpose/functionality for informative purposes.
Utils::Version version () const
 Convenience function to query the version number of the plugin for informative purposes.
virtual std::vector< std::stringdependencies () const
 Optional list of plugin IDs on which this plugin depends.

Protected Member Functions

bool isLicensed (const std::string &entitlementName) const
 Helper function to check whether entitlementName is included in the currently activated license.
void registerFactories (std::unique_ptr< AlgorithmFactory > algorithmFactory, std::unique_ptr< AlgorithmControllerFactory > controllerFactory, std::unique_ptr< DataAnnotationFactory > annotationFactory)
 Helper function to register the given factories with the FactoryRegistry.
Protected Member Functions inherited from ImFusion::PluginBase
virtual Status init ()=0
 Perform plugin initialization, for instance by populating factories and registering custom types with the host application.

Additional Inherited Members

Public Types inherited from ImFusion::PluginBase
enum class  Status { Success = 0 , LicenseCheckFailed , Unsupported , UnknownError }
 Enumeration of status codes for plugin initialization. More...

Member Function Documentation

◆ setApplicationController()

virtual void ImFusion::ImFusionLibPlugin::setApplicationController ( ApplicationController & )
inlinevirtual

Gives the plugin access to the application controller.

Plugins should not rely on this method being called in all setups.

Reimplemented in ImFusion::PythonPlugin.


The documentation for this class was generated from the following file:
  • ImFusion/Base/ImFusionLibPlugin.h
Search Tab / S to search, Esc to close