#include <ImFusion/Core/Log.h>
#include <ImFusion/Core/Plugin.h>
#include <ImFusion/Core/PluginManager.h>
{
public:
static const char* id() { return "MyInstitutionName.ExamplePlugin"; }
std::string author()
const override {
return "Institution Name"; }
std::string description()
const override {
return "Examplary implementation of an ImFusion plugin"; }
protected:
{
LOG_DEBUG(
"MyInstitutionName.ExamplePlugin",
"Initializing plugin...");
SomeFactory::get().registerType(...);
SomeOtherFactory::get().register(...);
return Status::Success;
}
};
void applicationInit()
{
{
LOG_ERROR(
"Could not initialized plugin " << pluginId);
}
}
void applicationInit()
{
}
Base interface to interact with a plugin that can be loaded into an application at runtime.
Definition Plugin.h:86
@ Success
Operation succeeded without errors.
Definition PluginManager.h:61
static PluginManager & get()
Return the singleton instance.
void init(std::unique_ptr< Context >=nullptr)
Initializes the OpenGL backend.
#define LOG_DEBUG(...)
Emits a log message of Log::Level::Debug, optionally with a category.
Definition Log.h:242
#define LOG_ERROR(...)
Emits a log message of Log::Level::Error, optionally with a category.
Definition Log.h:257
#define IMFUSION_REGISTER_PLUGIN(...)
Helper macro to conveniently define and export the necessary functions and symbols for an ImFusion pl...
Definition Plugin.h:52
Namespace of the ImFusion SDK.
Definition Changelog.dox:1
Convenience tool for returning error messages together with statuses.
Definition MLCommon.h:115