GG::PluginManager Class Reference

A singleton that loads and stores textures for use by GG. More...

#include <PluginInterface.h>

List of all members.

Static Public Member Functions

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

Friends

GG_API PluginManagerGetPluginManager ()

Mutators



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


Detailed Description

A singleton that loads and stores textures for use by GG.

This 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 140 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 Sat Mar 26 07:08:38 2011 for GG by  doxygen 1.5.9