GG::PluginManager Class Reference

this singleton class is essentially a very thin wrapper around a map of PluginInterface smart pointers, keyed on std::string plugin names. More...

#include <PluginInterface.h>

List of all members.

Mutators

boost::shared_ptr< PluginInterfaceGetPlugin (const std::string &name)
void FreePlugin (const std::string &name)

Static Public Member Functions

static void InitDynamicLoader ()
static void AddSearchDirectory (const std::string &dir)
static void CleanupDynamicLoader ()

Friends

GG_API PluginManagerGetPluginManager ()


Detailed Description

this singleton class is essentially a very thin wrapper around a map of PluginInterface smart pointers, keyed on std::string plugin names.

The user need only request a plugin through GetPlugin(); if the plugin is not already resident, it will be loaded.

Definition at line 122 of file PluginInterface.h.


Member Function Documentation

boost::shared_ptr<PluginInterface> GG::PluginManager::GetPlugin ( const std::string &  name  ) 

returns a shared_ptr to the plugin interface created from plugin name.

If the plugin is not present in the manager's pool, it will be loaded from disk.

void GG::PluginManager::FreePlugin ( const std::string &  name  ) 

removes the manager's shared_ptr to the plugin created from file name, if it exists.

Note:
Due to shared_ptr semantics, the plugin may not be deleted until much later.

static void GG::PluginManager::InitDynamicLoader (  )  [static]

initializes the dynamic loader system that loads and unloads plugins.

This is available as a convenience only; it will be called automatically as needed.

static void GG::PluginManager::AddSearchDirectory ( const std::string &  dir  )  [static]

adds a directory which should be searched for plugins.

static void GG::PluginManager::CleanupDynamicLoader (  )  [static]

cleans up the dynamic loader system that loads and unloads plugins.

This should be called manually when desiredl it will never be called by other PluginInterface code.


Friends And Related Function Documentation

GG_API PluginManager& GetPluginManager (  )  [friend]

Returns the singleton PluginManager instance.


The documentation for this class was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2