#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) |
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 56 of file pluginmanager.hh.
The one PluginManager object. See main PluginManager documentation for its use.
Definition at line 187 of file pluginmanager.hh.
PluginManager::PluginManager | ( | ) | [private] |
Definition at line 41 of file pluginmanager.cc.
PluginManager::~PluginManager | ( | ) | [private] |
Definition at line 60 of file pluginmanager.cc.
bool PluginManager::add | ( | ExportPlugin * | plugin | ) |
Registers a new exporter
Definition at line 94 of file pluginmanager.cc.
bool PluginManager::add | ( | ImportPlugin * | plugin | ) |
Registers a new importer
Definition at line 96 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 98 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 112 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 110 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 139 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 144 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 149 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 154 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 160 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 166 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 172 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 178 of file pluginmanager.cc.
bool PluginManager::loadPlugin | ( | std::string const & | path | ) | [private] |
Definition at line 72 of file pluginmanager.cc.
void PluginManager::registerPluginTypes | ( | Registry & | registry | ) |
Adds the types from the type definition plugins to registry
Definition at line 101 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 116 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 122 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 128 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 133 of file pluginmanager.cc.
friend class utilmm::singleton::wrapper< PluginManager > [friend] |
Definition at line 190 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.