#include <xap_ModuleManager.h>
Public Member Functions | |
~XAP_ModuleManager () | |
bool | loadModule (const char *szFilename) |
bool | loadPreloaded (XAP_Plugin_Registration fnRegister, XAP_Plugin_Registration fnDeregister, XAP_Plugin_VersionCheck fnSupportsVersion) |
void | unloadModule (XAP_Module *module) |
void | unloadAllPlugins () |
const UT_GenericVector < XAP_Module * > * | enumModules () const |
Static Public Member Functions | |
static XAP_ModuleManager & | instance () |
Private Member Functions | |
XAP_ModuleManager () | |
void | unloadModule (UT_sint32 ndx) |
XAP_ModuleManager (const XAP_ModuleManager &) | |
void | operator= (const XAP_ModuleManager &) |
Private Attributes | |
UT_GenericVector< XAP_Module * > * | m_modules |
Friends | |
class | XAP_Module |
XAP_ModuleManager::XAP_ModuleManager | ( | ) | [private] |
Protected destructor creates an instance of this module class
References m_modules.
XAP_ModuleManager::~XAP_ModuleManager | ( | ) |
Private destructor
References m_modules, MODULE_CLASS, and UT_VECTOR_PURGEALL.
XAP_ModuleManager::XAP_ModuleManager | ( | const XAP_ModuleManager & | ) | [private] |
const UT_GenericVector< XAP_Module * > * XAP_ModuleManager::enumModules | ( | ) | const |
Enumerate the modules loaded thus far
References m_modules.
Referenced by loadModule(), and XAP_Win32Dialog_PluginManager::refreshPluginInfo().
XAP_ModuleManager & XAP_ModuleManager::instance | ( | void | ) | [static] |
Acquire a handle to an instance of this module loader class
Referenced by XAP_UnixDialog_PluginManager::_refresh(), XAP_UnixDialog_PluginManager::event_Deactivate(), AP_UnixApp::loadAllPlugins(), and XAP_Win32Dialog_PluginManager::refreshPluginInfo().
bool XAP_ModuleManager::loadModule | ( | const char * | szFilename | ) |
Request that the ModuleManager load the module represented by szFilename.
szFilename | - the .dll or .so on your system that you wish to load |
References UT_GenericVector< T >::addItem(), enumModules(), FREEP, XAP_Module::getErrorMsg(), XAP_Module::getModuleName(), UT_GenericVector< T >::getNthItem(), XAP_Module::load(), m_modules, XAP_Module::registerThySelf(), XAP_Module::setCreator(), XAP_Module::setLoaded(), UT_GenericVector< T >::size(), XAP_Module::unload(), XAP_Module::unregisterThySelf(), UT_ASSERT, UT_basename(), UT_CATCH, UT_DEBUGMSG, UT_TRY, and XAP_MODULE_MANAGER_LOAD_LOG.
bool XAP_ModuleManager::loadPreloaded | ( | XAP_Plugin_Registration | fnRegister, | |
XAP_Plugin_Registration | fnDeregister, | |||
XAP_Plugin_VersionCheck | fnSupportsVersion | |||
) |
Load builtin plugins.
References UT_GenericVector< T >::addItem(), m_modules, XAP_Module::registerThySelf(), XAP_Module::setCreator(), XAP_Module::setLoaded(), XAP_Module::setSymbols(), XAP_Module::unregisterThySelf(), UT_ASSERT, UT_CATCH, UT_DEBUGMSG, and UT_TRY.
void XAP_ModuleManager::operator= | ( | const XAP_ModuleManager & | ) | [private] |
void XAP_ModuleManager::unloadAllPlugins | ( | ) |
Unload all currently loaded plugins, in order of last added to first
References UT_GenericVector< T >::getItemCount(), m_modules, unloadModule(), UT_ASSERT, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
void XAP_ModuleManager::unloadModule | ( | XAP_Module * | pModule | ) |
Unload a module
pModule | - a valid module that you want to unload |
WARNING: zero or more plugins/modules may be unloaded as a result of calling XAP_ModuleManager::unloadModule since the plugin may be unloaded already or other plugins may depend on this one and be unloaded automatically.
Don't assume anything, therefore, about the UT_Vector returned by XAP_ModuleManager::enumModules
References UT_GenericVector< T >::findItem(), XAP_Module::getCreator(), m_modules, UT_ASSERT, UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
Referenced by unloadAllPlugins().
void XAP_ModuleManager::unloadModule | ( | UT_sint32 | ndx | ) | [private] |
friend class XAP_Module [friend] |
UT_GenericVector<XAP_Module*>* XAP_ModuleManager::m_modules [private] |
Referenced by enumModules(), loadModule(), loadPreloaded(), unloadAllPlugins(), unloadModule(), XAP_ModuleManager(), and ~XAP_ModuleManager().