Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
Typelib::PluginManager Class Reference

#include <pluginmanager.hh>

List of all members.

Public Types

typedef utilmm::singleton::use
< PluginManager
self

Public Member Functions

bool add (ExportPlugin *plugin)
bool add (ImportPlugin *plugin)
void add (TypeDefinitionPlugin *plugin)
Exporterexporter (std::string const &name) const
Importerimporter (std::string const &name) const
void registerPluginTypes (Registry &registry)

Static Public Member Functions

static Registryload (std::string const &kind, std::istream &stream)
static void load (std::string const &kind, std::istream &stream, Registry &into)
static Registryload (std::string const &kind, std::string const &file)
static void load (std::string const &kind, std::string const &file, Registry &into)
static Registryload (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 Registryload (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 &registry)
static std::string save (std::string const &kind, utilmm::config_set const &config, Registry const &registry)
static void save (std::string const &kind, Registry const &registry, std::ostream &into)
static void save (std::string const &kind, utilmm::config_set const &config, Registry const &registry, 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 >

Detailed Description

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

Definition at line 41 of file pluginmanager.cc.

Definition at line 60 of file pluginmanager.cc.


Member Function Documentation

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.

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

Exceptions:
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

Exceptions:
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

See also:
Importer::load

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

See also:
Importer::load

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

See also:
Importer::load

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

See also:
Importer::load

Definition at line 178 of file pluginmanager.cc.

bool PluginManager::loadPlugin ( std::string const &  path) [private]

Definition at line 72 of file pluginmanager.cc.

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

  • kind the output format. It has to be a valid exporter name
  • config format-specific configuration. See each exporter documentation for details.
  • registry the registry to export
  • into the ostream object to export to
    Exceptions:
    PluginNotFoundif kind is invalid
    UnsupportedTypeif a specific type cannot be exported into this format
    ExportErrorif another error occured during the export

Definition at line 133 of file pluginmanager.cc.


Friends And Related Function Documentation

friend class utilmm::singleton::wrapper< PluginManager > [friend]

Definition at line 190 of file pluginmanager.hh.


Member Data Documentation

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.


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


typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Sep 14 2015 15:08:18