#include <plugin.h>
Inheritance diagram for kore::Plugin::

Public Methods | |
| Plugin () | |
| Default constructor. More... | |
| Plugin (HMODULE handle, const char *libname, const char *libpath, int flags) | |
| Creates a plugin. More... | |
| virtual | ~Plugin () |
| Destructor. More... | |
| virtual void | pluginLoaded () |
| Callback triggered right AFTER the dll has been LOADED. More... | |
| virtual void | unloadingPlugin () |
| Callback triggered right BEFORE UNLOADING the dll. More... | |
| virtual void | initPlugin () |
| Callback triggered when a plugin gets "activated". More... | |
| virtual void | finalizePlugin () |
| Callback triggered when a plugin gets "deactivated". More... | |
| virtual HMODULE | libHandle () const |
| Gets the platform-dependant representation of the dll. More... | |
Private Methods | |
| void | commonInit () |
Private Attributes | |
| const Version * | _pluginVersion |
| const Version * | _pluginAPIVersion |
| const Info * | _pluginInfo |
| const char * | _libName |
| const char * | _libPath |
| int | _libFlags |
| HMODULE | _libHandle |
One or more Kore Modules can be bundled into a dll and dynamically loaded at run-time using the PluginLoader. The kore::Plugin class provides the cross-platform abstraction for dll's, as well as a few usefull callbacks related to dynamic loading. The future versions of kore::Plugin will also provide introspective methods (similar to rtti), such as hints about modules/services provided by the ddl.
Definition at line 53 of file plugin.h.
|
|
Default constructor. Creates an empty plugin instance. Definition at line 20 of file plugin.cpp. References _libFlags, _libHandle, _libName, _libPath, and commonInit().
00021 {
00022 commonInit();
00023 _libHandle = 0;
00024 _libName = 0;
00025 _libPath = 0;
00026 _libFlags = 0;
00027 }
|
|
||||||||||||||||||||
|
Creates a plugin. This constructor is usually invoked by the plugin(...) function exported by the dll: Plugin* plugin(HMODULE handle, const char* name, const char* path, int flags) { return new MyPlugin(handle,name,path,flags); }
Definition at line 28 of file plugin.cpp. References _libFlags, _libHandle, _libName, _libPath, commonInit(), and HMODULE.
00029 {
00030 commonInit();
00031 _libHandle = libhandle;
00032 _libName = libname;
00033 _libPath = libpath;
00034 _libFlags = flags;
00035 //cout << "HMODULE: " << libhandle << endl;
00036 }
|
|
|
Destructor.
Definition at line 37 of file plugin.cpp. References _pluginAPIVersion, _pluginInfo, and _pluginVersion.
00038 {
00039 delete _pluginInfo;
00040 delete _pluginVersion;
00041 delete _pluginAPIVersion;
00042 }
|
|
|
Definition at line 43 of file plugin.cpp. References _pluginAPIVersion, _pluginInfo, _pluginVersion, PLUGIN_API_MAJOR, PLUGIN_API_MINOR, PLUGIN_API_REVISION, PLUGIN_API_VERSION, PLUGIN_DESCRIPTION, PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_NAME, PLUGIN_REVISION, PLUGIN_TYPE, PLUGIN_VERSION, and kore::Module::setInfo(). Referenced by Plugin().
00044 {
00045 _pluginVersion = new Version(PLUGIN_MAJOR,PLUGIN_MINOR,PLUGIN_REVISION,PLUGIN_VERSION);
00046 _pluginAPIVersion = new Version(PLUGIN_API_MAJOR,PLUGIN_API_MINOR,PLUGIN_API_REVISION,PLUGIN_API_VERSION);
00047 _pluginInfo = new Info(this, PLUGIN_NAME, PLUGIN_TYPE, PLUGIN_DESCRIPTION, _pluginVersion, _pluginAPIVersion);
00048 setInfo(_pluginInfo);
00049 }
|
|
|
Callback triggered when a plugin gets "deactivated". Here is the right place to do cleanup/unregistering the modules/services this plugin might have registered. Definition at line 67 of file plugin.cpp.
00068 {
00069 }
|
|
|
Callback triggered when a plugin gets "activated". Here is the right place for registering any modules/services provided by the dll. DO NOT use pluginLoaded() for that. Definition at line 64 of file plugin.cpp.
00065 {
00066 }
|
|
|
Gets the platform-dependant representation of the dll.
Definition at line 50 of file plugin.cpp. References _libHandle, and HMODULE.
00051 {
00052 return _libHandle;
00053 }
|
|
|
Callback triggered right AFTER the dll has been LOADED.
Definition at line 55 of file plugin.cpp.
00056 {
00057 //cout << "Plugin::pluginLoaded()" << endl;
00058 }
|
|
|
Callback triggered right BEFORE UNLOADING the dll.
Definition at line 59 of file plugin.cpp.
00060 {
00061 //cout << "Plugin::unloadingPlugin()" << endl;
00062 }
|
|
|
Definition at line 117 of file plugin.h. Referenced by Plugin(). |
|
|
|
|
|
Definition at line 113 of file plugin.h. Referenced by Plugin(). |
|
|
Definition at line 115 of file plugin.h. Referenced by Plugin(). |
|
|
Definition at line 109 of file plugin.h. Referenced by commonInit(), and ~Plugin(). |
|
|
Definition at line 111 of file plugin.h. Referenced by commonInit(), and ~Plugin(). |
|
|
Definition at line 107 of file plugin.h. Referenced by commonInit(), and ~Plugin(). |
1.2.12 written by Dimitri van Heesch,
© 1997-2001