| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes
SPL::slaPluginServer Class Reference

Abstract plugin server class. More...

`#include <spl_pluginserver.h>`

Inheritance diagram for SPL::slaPluginServer:

List of all members.

## 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.

## Detailed Description

Abstract plugin server class.

## Constructor & Destructor Documentation

slaPluginServer::slaPluginServer | ( | void |  | ) |

Default constructor.

slaPluginServer::~slaPluginServer | ( | void |  | ) | `[virtual]`

Default destructor.

## Member Function Documentation

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.

Remarks:
  Index is 0-based.

Parameters:

  a_lIndex | [in] The plugin's index.

Return values:

  A | slcPluginInfo structure containing the plugin's information.

See also:
  slcPluginInfo

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.

Remarks:
  Index is 0-based.

Parameters:

  a_lIndex | [in] The plugin's index.

Return values:

  A | slcPluginInfo structure containing the plugin's information.

See also:
  slcPluginInfo

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.

Parameters:

  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.

Returns:
  Number of successfully loaded plugins.

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.

Parameters:

  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.

Returns:
  The method returns one of the following values:

Return values:

  -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.

Parameters:

  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.

Returns:
  Number of successfully loaded plugins.

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.

Parameters:

  a_pPluginArgs | [in] Pointer to plugin's run function arguments.

Returns:
  Number of successfully executed plugins.

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.

Parameters:

  a_lIndex | [in] The plugin's index.
  a_pPluginArgs | [in] Pointer to plugin's run function arguments.

Returns:
  The method returns one of the following values:

Return values:

  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.

Parameters:

  a_lIndex | [in] The plugin's index.
  a_pPluginArgs | [in] Pointer to plugin's run function arguments.

Returns:
  The method returns one of the following values:

Return values:

  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.

Parameters:

  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).

Parameters:

  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.

Returns:
  The method returns one of the following values:

Return values:

  true | | The plugin was unloaded successfully.
  false | | Could not unload plugin.

Implemented in SPL::slcPluginServer, SPL::slcPluginServer, and SPL::slcPluginServer.

## Member Data Documentation

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.

The documentation for this class was generated from the following files:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/libspl/include/spl_pluginserver.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/libspl/source/spl_pluginserver.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines