![]() |
Public API Reference |
![]() |
This utility class helps to load plugins based on request, config file, and commandline. More...
#include <csutil/plugldr.h>
Public Member Functions | |
void | AddCommandLinePlugins (iCommandLineParser *commandLine) |
Add plugins from command line. | |
void | AddConfigurationPlugins (iConfigFile *config, const char *prefix) |
Add plugins from configuration. | |
csPluginLoader (iObjectRegistry *object_reg) | |
Initialize. | |
bool | LoadPlugins () |
Load the plugins. | |
bool | ReplaceRequestedPlugin (const char *pluginName, const char *tagName) |
Replace a tag that was requested earlier with the given plugin, or add the plugin and tag. | |
void | RequestPlugin (const char *pluginName, const char *tagName) |
A shortcut for requesting to load a plugin (before LoadPlugins()). | |
virtual | ~csPluginLoader () |
Deinitialize. |
This utility class helps to load plugins based on request, config file, and commandline.
csPluginLoader::csPluginLoader | ( | iObjectRegistry * | object_reg | ) |
Initialize.
virtual csPluginLoader::~csPluginLoader | ( | ) | [virtual] |
Deinitialize.
void csPluginLoader::AddCommandLinePlugins | ( | iCommandLineParser * | commandLine | ) |
Add plugins from command line.
Handles the -video
, -canvas
and -plugin
command line parameters. Previously requested plugins with the tags for these parameters are replaced.
void csPluginLoader::AddConfigurationPlugins | ( | iConfigFile * | config, |
const char * | prefix | ||
) |
Add plugins from configuration.
prefix is the prefix of the configuration keys to scan. The tag name is the key name (minus the prefix), the plugin ID is the associated value. Previously requested plugins with the same tag are replaced.
bool csPluginLoader::LoadPlugins | ( | ) |
Load the plugins.
bool csPluginLoader::ReplaceRequestedPlugin | ( | const char * | pluginName, |
const char * | tagName | ||
) |
Replace a tag that was requested earlier with the given plugin, or add the plugin and tag.
pluginName | Plugin ID of the plugin to load for the tag. |
tagName | Tag to change the plugin of. |
true
if a plugin was requested for tagName and replaced with pluginName; false
if a new request was added. void csPluginLoader::RequestPlugin | ( | const char * | pluginName, |
const char * | tagName | ||
) |
A shortcut for requesting to load a plugin (before LoadPlugins()).
If you want this class to register the plugin as a default for some interface then you should use the interface name as the tag name (e.g. 'iGraphics3D').