cubos::core::ecs::DynamicPlugin class

Manages the loading and unloading of a plugin from a shared library.

Public functions

auto load(const std::string& name) -> bool
Loads the plugin from a shared library with the given name.
void unload()
Unloads the plugin.
auto function() const -> Plugin
Gets the plugin function pointer.

Function documentation

bool cubos::core::ecs::DynamicPlugin::load(const std::string& name)

Loads the plugin from a shared library with the given name.

Parameters
name Shared library name.
Returns Whether the plugin was loaded successfully.

void cubos::core::ecs::DynamicPlugin::unload()

Unloads the plugin.

Does nothing if the plugin was not loaded.

Plugin cubos::core::ecs::DynamicPlugin::function() const

Gets the plugin function pointer.

Returns Plugin function pointer.

Aborts if the plugin was not loaded.