32 #include "../translator/Translator.h" 37 #include <boost/format.hpp> 41 std::map<std::string, std::shared_ptr<AbstractPluginEngine> >
engines;
51 const std::string& engine_id = engine->id();
55 boost::format err_msg(
TE_TR(
"There is already a plugin engine registered with name: %1%."));
60 std::shared_ptr<AbstractPluginEngine> new_engine(engine.release());
68 std::map<std::string, std::shared_ptr<AbstractPluginEngine> >::iterator it =
m_pimpl->
engines.find(engine_id);
72 boost::format err_msg(
TE_TR(
"Could not remove plugin engine '%1%': not found."));
83 std::map<std::string, std::shared_ptr<AbstractPluginEngine> >::iterator it =
m_pimpl->
engines.find(engine_id);
87 boost::format err_msg(
TE_TR(
"Could not retrieve plugin engine '%1%': not found."));
void insert(std::unique_ptr< AbstractPluginEngine > engine)
Register a new plugin engine.
std::map< std::string, std::shared_ptr< AbstractPluginEngine > > engines
A singleton that can be used to register plugin engines.
#define TE_TR(message)
It marks a string in order to get translated.
void remove(const std::string &engine_id)
Unregister the plugin engine.
void clear()
Unregister every plugin engine.
boost::error_info< struct tag_error_description, std::string > ErrorDescription
The base type for error report messages.
The base class for plugin engines.
A singleton that can be used to register plugin engines.
AbstractPluginEngine & get(const std::string &engine_id) const
Find a plugin engine with the given id.
The base class for plugin engines.
~PluginEngineManager()
Destructor.
An exception indicating that a given item was not found in a collection (or range).
PluginEngineManager()
Consructor.
An exception indicating that a given argument is not valid, for instance if a given item already exis...
static PluginEngineManager & instance()
Access the singleton.