|
pion-net
4.0.9
|
#include <PluginManager.hpp>
Classes | |
| class | DuplicatePluginException |
| exception thrown if we try to add or load a duplicate plug-in More... | |
| class | PluginMap |
| data type that maps identifiers to plug-in objects More... | |
| class | PluginNotFoundException |
| exception thrown if a plug-in cannot be found More... | |
Public Types | |
| typedef boost::function1< void, PLUGIN_TYPE * > | PluginRunFunction |
| data type for a function that may be called by the run() method | |
| typedef boost::function1< boost::uint64_t, const PLUGIN_TYPE * > | PluginStatFunction |
| data type for a function that may be called by the getStat() method | |
Public Member Functions | |
| PluginManager (void) | |
| default constructor | |
| virtual | ~PluginManager () |
| default destructor | |
| void | clear (void) |
| clears all the plug-in objects being managed | |
| bool | empty (void) const |
| returns true if there are no plug-in objects being managed | |
| void | add (const std::string &plugin_id, PLUGIN_TYPE *plugin_object_ptr) |
| void | remove (const std::string &plugin_id) |
| void | replace (const std::string &plugin_id, PLUGIN_TYPE *plugin_ptr) |
| PLUGIN_TYPE * | clone (const std::string &plugin_id) |
| PLUGIN_TYPE * | load (const std::string &plugin_id, const std::string &plugin_type) |
| PLUGIN_TYPE * | get (const std::string &plugin_id) |
| const PLUGIN_TYPE * | get (const std::string &plugin_id) const |
| PionPluginPtr< PLUGIN_TYPE > | getLibPtr (const std::string &plugin_id) const |
| PLUGIN_TYPE * | find (const std::string &resource) |
| void | run (PluginRunFunction run_func) |
| void | run (const std::string &plugin_id, PluginRunFunction run_func) |
| boost::uint64_t | getStatistic (PluginStatFunction stat_func) const |
| boost::uint64_t | getStatistic (const std::string &plugin_id, PluginStatFunction stat_func) const |
Protected Attributes | |
| PluginMap | m_plugin_map |
| collection of plug-in objects being managed | |
| boost::mutex | m_plugin_mutex |
| mutex to make class thread-safe | |
PluginManager: used to manage a collection of plug-in objects
Definition at line 30 of file PluginManager.hpp.
|
inline |
adds a new plug-in object
| plugin_id | unique identifier associated with the plug-in |
| plugin_object_ptr | pointer to the plug-in object to add |
Definition at line 201 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::net::WebServer::addService(), and pion::PluginManager< WebService >::empty().
|
inline |
clones an existing plug-in object (creates a new one of the same type)
| plugin_id | unique identifier associated with the plug-in |
Definition at line 242 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty().
|
inline |
finds the plug-in object associated with a particular resource (fuzzy match)
| resource | resource identifier (uri-stem) to search for |
Definition at line 319 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty().
|
inline |
gets the plug-in object associated with a particular plugin_id (exact match)
| plugin_id | unique identifier associated with the plug-in |
Definition at line 286 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
|
inline |
gets the plug-in object associated with a particular plugin_id (exact match)
| plugin_id | unique identifier associated with the plug-in |
Definition at line 297 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
|
inline |
gets a smart pointer to the plugin shared library for a particular plugin_id (exact match)
| plugin_id | unique identifier associated with the plug-in |
Definition at line 308 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty().
|
inline |
returns a total statistic value summed for every plug-in being managed
| stat_func | the statistic function to execute for each plug-in object |
Definition at line 383 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty().
|
inline |
returns a statistic value for a particular plug-in
| plugin_id | unique identifier associated with the plug-in |
| stat_func | the statistic function to execute |
Definition at line 396 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::empty().
|
inline |
loads a new plug-in object
| plugin_id | unique identifier associated with the plug-in |
| plugin_type | the name or type of the plug-in to load (searches plug-in directories and appends extensions) |
Definition at line 252 of file PluginManager.hpp.
References pion::PionPluginPtr< InterfaceClassType >::create(), pion::PionPlugin::findStaticEntryPoint(), pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex, pion::PionPlugin::open(), and pion::PionPlugin::openStaticLinked().
Referenced by pion::PluginManager< WebService >::empty(), and pion::net::WebServer::loadService().
|
inline |
removes a plug-in object
| plugin_id | unique identifier associated with the plug-in |
Definition at line 211 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
|
inline |
replaces an existing plug-in object with a new one
| plugin_id | unique identifier associated with the plug-in |
| plugin_ptr | pointer to the new plug-in object which will replace the old one |
Definition at line 226 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty().
|
inline |
runs a method for every plug-in being managed
| run_func | the function to execute for each plug-in object |
Definition at line 361 of file PluginManager.hpp.
References pion::PluginManager< PLUGIN_TYPE >::m_plugin_map, and pion::PluginManager< PLUGIN_TYPE >::m_plugin_mutex.
Referenced by pion::PluginManager< WebService >::empty(), and pion::net::WebServer::setServiceOption().
|
inline |
runs a method for a particular plug-in
| plugin_id | unique identifier associated with the plug-in |
| run_func | the function to execute |
Definition at line 372 of file PluginManager.hpp.
1.8.11