#include <pluginmanager.hh>
Public Types | |
typedef utilmm::singleton::use < PluginManager > | self |
Public Member Functions | |
bool | add (ExportPlugin *plugin) |
bool | add (ImportPlugin *plugin) |
void | add (TypeDefinitionPlugin *plugin) |
Exporter * | exporter (std::string const &name) const |
Importer * | importer (std::string const &name) const |
void | registerPluginTypes (Registry ®istry) |
Static Public Member Functions | |
static Registry * | load (std::string const &kind, std::istream &stream) |
static void | load (std::string const &kind, std::istream &stream, Registry &into) |
static Registry * | load (std::string const &kind, std::string const &file) |
static void | load (std::string const &kind, std::string const &file, Registry &into) |
static Registry * | load (std::string const &kind, std::istream &stream, utilmm::config_set const &config) |
static void | load (std::string const &kind, std::istream &stream, utilmm::config_set const &config, Registry &into) |
static Registry * | load (std::string const &kind, std::string const &file, utilmm::config_set const &config) |
static void | load (std::string const &kind, std::string const &file, utilmm::config_set const &config, Registry &into) |
static std::string | save (std::string const &kind, Registry const ®istry) |
static std::string | save (std::string const &kind, utilmm::config_set const &config, Registry const ®istry) |
static void | save (std::string const &kind, Registry const ®istry, std::ostream &into) |
static void | save (std::string const &kind, utilmm::config_set const &config, Registry const ®istry, std::ostream &into) |
Private Types | |
typedef void(* | PluginEntryPoint )(PluginManager &) |
Private Member Functions | |
bool | loadPlugin (std::string const &path) |
bool | loadPluginFromDirectory (std::string const &directory) |
PluginManager () | |
~PluginManager () | |
Private Attributes | |
std::vector < TypeDefinitionPlugin * > | m_definition_plugins |
std::map< std::string, ExportPlugin * > | m_exporters |
std::map< std::string, ImportPlugin * > | m_importers |
std::vector< void * > | m_library_handles |
Friends | |
class | utilmm::singleton::wrapper< PluginManager > |
The plugin manager
It is a singleton, using utilmm::singleton You have to access it using PluginManager::self manager;
manager->importer()
The object is destroyed when the last of the use<> objects is, and created back when a new use<> object is built.
Definition at line 48 of file pluginmanager.hh.
typedef void(* Typelib::PluginManager::PluginEntryPoint)(PluginManager &) [private] |
Definition at line 57 of file pluginmanager.hh.
The one PluginManager object. See main PluginManager documentation for its use.
Definition at line 188 of file pluginmanager.hh.
PluginManager::PluginManager | ( | ) | [private] |
Definition at line 40 of file pluginmanager.cc.
PluginManager::~PluginManager | ( | ) | [private] |
Definition at line 71 of file pluginmanager.cc.
bool PluginManager::add | ( | ExportPlugin * | plugin | ) |
Registers a new exporter
Definition at line 135 of file pluginmanager.cc.
bool PluginManager::add | ( | ImportPlugin * | plugin | ) |
Registers a new importer
Definition at line 137 of file pluginmanager.cc.
void PluginManager::add | ( | TypeDefinitionPlugin * | plugin | ) |
Adds a type definition plugin. A type definition plugin defines a set of "default" types that gets added automatically to new registries
Definition at line 139 of file pluginmanager.cc.
Exporter * PluginManager::exporter | ( | std::string const & | name | ) | const |
Build a new export plugin from its plugin name
PluginNotFound |
Definition at line 153 of file pluginmanager.cc.
Importer * PluginManager::importer | ( | std::string const & | name | ) | const |
Build a new import plugin from its plugin name
PluginNotFound |
Definition at line 151 of file pluginmanager.cc.
Registry * PluginManager::load | ( | std::string const & | kind, |
std::istream & | stream | ||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 180 of file pluginmanager.cc.
void PluginManager::load | ( | std::string const & | kind, |
std::istream & | stream, | ||
Registry & | into | ||
) | [static] |
Imports types from a istream object to an already existing registry
Definition at line 185 of file pluginmanager.cc.
Registry * PluginManager::load | ( | std::string const & | kind, |
std::string const & | file | ||
) | [static] |
Creates a registry from a file
Definition at line 190 of file pluginmanager.cc.
void PluginManager::load | ( | std::string const & | kind, |
std::string const & | file, | ||
Registry & | into | ||
) | [static] |
Imports types from a file into an already existing registry
Definition at line 195 of file pluginmanager.cc.
Registry * PluginManager::load | ( | std::string const & | kind, |
std::istream & | stream, | ||
utilmm::config_set const & | config | ||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 201 of file pluginmanager.cc.
void PluginManager::load | ( | std::string const & | kind, |
std::istream & | stream, | ||
utilmm::config_set const & | config, | ||
Registry & | into | ||
) | [static] |
Imports types from a istream object to an already existing registry
Definition at line 207 of file pluginmanager.cc.
Registry * PluginManager::load | ( | std::string const & | kind, |
std::string const & | file, | ||
utilmm::config_set const & | config | ||
) | [static] |
Creates a registry from a file
Definition at line 213 of file pluginmanager.cc.
void PluginManager::load | ( | std::string const & | kind, |
std::string const & | file, | ||
utilmm::config_set const & | config, | ||
Registry & | into | ||
) | [static] |
Imports types from a file into an already existing registry
Definition at line 219 of file pluginmanager.cc.
bool PluginManager::loadPlugin | ( | std::string const & | path | ) | [private] |
Definition at line 113 of file pluginmanager.cc.
bool PluginManager::loadPluginFromDirectory | ( | std::string const & | directory | ) | [private] |
uses "loadPlugin" to try to load all "*.so" or "*.dylib" files in the given directory
directory | place to look for "*.so" or "*.dylib" dynamic libraries |
Definition at line 91 of file pluginmanager.cc.
void PluginManager::registerPluginTypes | ( | Registry & | registry | ) |
Adds the types from the type definition plugins to registry
Definition at line 142 of file pluginmanager.cc.
std::string PluginManager::save | ( | std::string const & | kind, |
Registry const & | registry | ||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This is provided for backward compatibility only
Definition at line 157 of file pluginmanager.cc.
std::string PluginManager::save | ( | std::string const & | kind, |
utilmm::config_set const & | config, | ||
Registry const & | registry | ||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 163 of file pluginmanager.cc.
void PluginManager::save | ( | std::string const & | kind, |
Registry const & | registry, | ||
std::ostream & | into | ||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This is provided for backward compatibility only
Definition at line 169 of file pluginmanager.cc.
void PluginManager::save | ( | std::string const & | kind, |
utilmm::config_set const & | config, | ||
Registry const & | registry, | ||
std::ostream & | into | ||
) | [static] |
Exports a registry to an ostream object
PluginNotFound | if kind is invalid |
UnsupportedType | if a specific type cannot be exported into this format |
ExportError | if another error occured during the export |
Definition at line 174 of file pluginmanager.cc.
friend class utilmm::singleton::wrapper< PluginManager > [friend] |
Definition at line 191 of file pluginmanager.hh.
std::vector<TypeDefinitionPlugin*> Typelib::PluginManager::m_definition_plugins [private] |
Definition at line 52 of file pluginmanager.hh.
std::map<std::string, ExportPlugin*> Typelib::PluginManager::m_exporters [private] |
Definition at line 50 of file pluginmanager.hh.
std::map<std::string, ImportPlugin*> Typelib::PluginManager::m_importers [private] |
Definition at line 51 of file pluginmanager.hh.
std::vector<void*> Typelib::PluginManager::m_library_handles [private] |
Definition at line 53 of file pluginmanager.hh.