![]() |
TerraLib 4.1
|
Abstract plugin server class. More...
#include <spl_pluginserver.h>
Public Member Functions | |
| SPL_API | slaPluginServer (void) |
| Default constructor. | |
| virtual SPL_API | ~slaPluginServer (void) |
| Default destructor. | |
| virtual long SPL_API | GetLoadedPlugins (void) |
| Returns the current number of loaded plugins. | |
| virtual slcPluginInfo SPL_API | GetSafedPluginInfo (const long a_lIndex) |
| Returns information about a plugin from internal plugin info map. | |
| virtual slcPluginInfo SPL_API | GetPluginInfo (const long a_lIndex)=0 |
| Returns information about a plugin, use this to safe the info to info map. | |
| virtual void SPL_API | GetAllPluginInfos (void)=0 |
| Automatically retrieves information about all loaded plugins. | |
| virtual long SPL_API | LoadAllPlugins (const string &a_strPath, const string &a_strWildcard, bool init_plugin, const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Loads all plugins with a given wildcard in a specified path. | |
| virtual long SPL_API | LoadPlugin (const string &a_strFileName, bool init_plugin, const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Loads a plugin with the specified file name. | |
| virtual bool SPL_API | UnloadPlugin (const long a_lIndex, bool shutdown_plugin, const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Unloads a plugin with the given index (0-based). | |
| virtual void SPL_API | UnloadAllPlugins (const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Unloads all plugins. | |
| virtual bool SPL_API | RunPluginInit (const long a_lIndex, const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Runs the plugin's init function. | |
| virtual bool SPL_API | RunPlugin (const long a_lIndex, const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Runs a plugin with the given index (0-based) and arguments. | |
| virtual long SPL_API | RunAllPlugins (const slcPluginArgs *a_pPluginArgs=NULL)=0 |
| Runs all plugins with the given arguments. | |
| virtual long SPL_API | Refresh (const string &a_strPath, const string &a_strWildcard, const slcPluginArgs *a_pPluginShutdownArgs=NULL, const slcPluginArgs *a_pPluginInitArgs=NULL)=0 |
| Unloads all plugins and looks for new plugins in the given path. | |
Protected Member Functions | |
| virtual void SPL_API | Clear (void) |
| Cleanup all internal maps. | |
Protected Attributes | |
| map< long, SPL_BITTYPE > | m_mapPluginIds |
| Map containing the plugin IDs. | |
| map< long, SPL_BITTYPE >::iterator | itIds |
| Iterator for plugin IDs. | |
| map< long, slcPluginInfo > | m_mapPluginInfos |
| Map containing the plugin infos. | |
| map< long, slcPluginInfo > ::iterator | itInfos |
| Iterator for plugin infos. | |
| slcPluginArgs | m_nullArgs |
| Dummy argument for internal use. | |
| slcPluginInfo | m_nullInfo |
| Dummy argument for internal use. | |
Abstract plugin server class.
| slaPluginServer::slaPluginServer | ( | void | ) |
Default constructor.
| slaPluginServer::~slaPluginServer | ( | void | ) | [virtual] |
Default destructor.
| virtual void SPL_API SPL::slaPluginServer::Clear | ( | void | ) | [protected, virtual] |
Cleanup all internal maps.
| virtual void SPL_API SPL::slaPluginServer::GetAllPluginInfos | ( | void | ) | [pure virtual] |
Automatically retrieves information about all loaded plugins.
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| long slaPluginServer::GetLoadedPlugins | ( | void | ) | [virtual] |
Returns the current number of loaded plugins.
| virtual slcPluginInfo SPL_API SPL::slaPluginServer::GetPluginInfo | ( | const long | a_lIndex | ) | [pure virtual] |
Returns information about a plugin, use this to safe the info to info map.
| a_lIndex | [in] The plugin's index. |
| A | slcPluginInfo structure containing the plugin's information. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| slcPluginInfo slaPluginServer::GetSafedPluginInfo | ( | const long | a_lIndex | ) | [virtual] |
Returns information about a plugin from internal plugin info map.
| a_lIndex | [in] The plugin's index. |
| A | slcPluginInfo structure containing the plugin's information. |
| virtual long SPL_API SPL::slaPluginServer::LoadAllPlugins | ( | const string & | a_strPath, |
| const string & | a_strWildcard, | ||
| bool | init_plugin, | ||
| const slcPluginArgs * | a_pPluginArgs = NULL |
||
| ) | [pure virtual] |
Loads all plugins with a given wildcard in a specified path.
| a_strPath | [in] Valid path for searching the plugins. |
| a_strWildcard | [in] File wildcard (e.g. *.*, *.dll) for the plugins. |
| init_plugin | After plugin loading, run the init function. |
| a_pPluginArgs | [in] Pointer to arguments for initializing all plugins after they have been loaded. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual long SPL_API SPL::slaPluginServer::LoadPlugin | ( | const string & | a_strFileName, |
| bool | init_plugin, | ||
| const slcPluginArgs * | a_pPluginArgs = NULL |
||
| ) | [pure virtual] |
Loads a plugin with the specified file name.
| a_strFileName | [in] The plugin's file name. |
| init_plugin | After plugin loading, run the init function. |
| a_pPluginArgs | [in] Pointer to plugin's start function arguments. |
| -2 | | Plugin was not found. |
| -1 | | Plugin's initialize function was not found. |
| 0 | | Error while executing the intialisation function. |
| 1 | | Plugin was successfully loaded. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual long SPL_API SPL::slaPluginServer::Refresh | ( | const string & | a_strPath, |
| const string & | a_strWildcard, | ||
| const slcPluginArgs * | a_pPluginShutdownArgs = NULL, |
||
| const slcPluginArgs * | a_pPluginInitArgs = NULL |
||
| ) | [pure virtual] |
Unloads all plugins and looks for new plugins in the given path.
| a_strPath | [in] Valid path for searching the plugins. |
| a_strWildcard | [in] File wildcard (e.g. *.*, *.dll) for the plugins. |
| a_pPluginShutdownArgs | [in] Pointer to arguments for shutting down all plugins before they will be unloaded. |
| a_pPluginInitArgs | [in] Pointer to arguments for initializing all plugins after they have been loaded. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual long SPL_API SPL::slaPluginServer::RunAllPlugins | ( | const slcPluginArgs * | a_pPluginArgs = NULL | ) | [pure virtual] |
Runs all plugins with the given arguments.
| a_pPluginArgs | [in] Pointer to plugin's run function arguments. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual bool SPL_API SPL::slaPluginServer::RunPlugin | ( | const long | a_lIndex, |
| const slcPluginArgs * | a_pPluginArgs = NULL |
||
| ) | [pure virtual] |
Runs a plugin with the given index (0-based) and arguments.
| a_lIndex | [in] The plugin's index. |
| a_pPluginArgs | [in] Pointer to plugin's run function arguments. |
| true | | The plugin execution was successful. |
| false | | An error occured while executing the plugin. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual bool SPL_API SPL::slaPluginServer::RunPluginInit | ( | const long | a_lIndex, |
| const slcPluginArgs * | a_pPluginArgs = NULL |
||
| ) | [pure virtual] |
Runs the plugin's init function.
| a_lIndex | [in] The plugin's index. |
| a_pPluginArgs | [in] Pointer to plugin's run function arguments. |
| true | | The plugin execution was successful. |
| false | | An error occured while executing the plugin. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual void SPL_API SPL::slaPluginServer::UnloadAllPlugins | ( | const slcPluginArgs * | a_pPluginArgs = NULL | ) | [pure virtual] |
Unloads all plugins.
| a_pPluginArgs | [in] Pointer to arguments for shutting down all plugins after they have been unloaded. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
| virtual bool SPL_API SPL::slaPluginServer::UnloadPlugin | ( | const long | a_lIndex, |
| bool | shutdown_plugin, | ||
| const slcPluginArgs * | a_pPluginArgs = NULL |
||
| ) | [pure virtual] |
Unloads a plugin with the given index (0-based).
| a_lIndex | [in] The plugin's index. |
| shutdown_plugin | Run the plugin's shutdown function before unloading it. |
| a_pPluginArgs | [in] Pointer to plugin's shutdown function arguments. |
| true | | The plugin was unloaded successfully. |
| false | | Could not unload plugin. |
Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.
map< long, SPL_BITTYPE >::iterator SPL::slaPluginServer::itIds [protected] |
Iterator for plugin IDs.
map< long, slcPluginInfo >::iterator SPL::slaPluginServer::itInfos [protected] |
Iterator for plugin infos.
map< long, SPL_BITTYPE > SPL::slaPluginServer::m_mapPluginIds [protected] |
Map containing the plugin IDs.
map< long, slcPluginInfo > SPL::slaPluginServer::m_mapPluginInfos [protected] |
Map containing the plugin infos.
slcPluginArgs SPL::slaPluginServer::m_nullArgs [protected] |
Dummy argument for internal use.
slcPluginInfo SPL::slaPluginServer::m_nullInfo [protected] |
Dummy argument for internal use.