bpf::system::PluginLoader class

Utility class to allow easy loading of plugins

Constructors, destructors, conversion operators

PluginLoader(const io::File& modulePath) explicit

Public functions

template<class BaseClass>
auto Load(const String& fileName) -> Plugin<BaseClass>
template<class BaseClass>
auto Load(const String& virtualName, const String& fileName) -> Plugin<BaseClass>

Function documentation

bpf::system::PluginLoader::PluginLoader(const io::File& modulePath) explicit

Parameters
modulePath the path to the folder in which all plugins are located

Constructs a PluginLoader

template<class BaseClass>
Plugin<BaseClass> bpf::system::PluginLoader::Load(const String& fileName)

Template parameters
BaseClass the interface class type
Parameters
fileName the file name without extension, prefixed with modulePath
Returns new plugin
Exceptions
ModuleException in case of system error or plugin incompatibility

Load a plugin with a file name; virtual name is deduced from file name

template<class BaseClass>
Plugin<BaseClass> bpf::system::PluginLoader::Load(const String& virtualName, const String& fileName)

Template parameters
BaseClass the interface class type
Parameters
virtualName the module name
fileName the file name without extension, prefixed with modulePath
Returns new plugin
Exceptions
ModuleException in case of system error or plugin incompatibility

Load a plugin with a file name