PionNetworkLibrary
|
#include <plugin_manager.hpp>
Classes | |
class | map_type |
data type that maps identifiers to plug-in objects More... | |
Public Types | |
typedef boost::function1< void, PluginType * > | PluginRunFunction |
data type for a function that may be called by the run() method More... | |
typedef boost::function1 < boost::uint64_t, const PluginType * > | PluginStatFunction |
data type for a function that may be called by the getStat() method More... | |
Public Member Functions | |
plugin_manager (void) | |
default constructor More... | |
virtual | ~plugin_manager () |
default destructor More... | |
void | clear (void) |
clears all the plug-in objects being managed More... | |
bool | empty (void) const |
returns true if there are no plug-in objects being managed More... | |
void | add (const std::string &plugin_id, PluginType *plugin_object_ptr) |
void | remove (const std::string &plugin_id) |
void | replace (const std::string &plugin_id, PluginType *plugin_ptr) |
PluginType * | clone (const std::string &plugin_id) |
PluginType * | load (const std::string &plugin_id, const std::string &plugin_type) |
PluginType * | get (const std::string &plugin_id) |
const PluginType * | get (const std::string &plugin_id) const |
plugin_ptr< PluginType > | get_lib_ptr (const std::string &plugin_id) const |
PluginType * | find (const std::string &resource) |
void | run (PluginRunFunction run_func) |
void | run (const std::string &plugin_id, PluginRunFunction run_func) |
boost::uint64_t | get_statistic (PluginStatFunction stat_func) const |
boost::uint64_t | get_statistic (const std::string &plugin_id, PluginStatFunction stat_func) const |
Protected Attributes | |
map_type | m_plugin_map |
collection of plug-in objects being managed More... | |
boost::mutex | m_plugin_mutex |
mutex to make class thread-safe More... | |
plugin_manager: used to manage a collection of plug-in objects
typedef boost::function1<void, PluginType*> pion::plugin_manager< PluginType >::PluginRunFunction |
data type for a function that may be called by the run() method
typedef boost::function1<boost::uint64_t, const PluginType*> pion::plugin_manager< PluginType >::PluginStatFunction |
data type for a function that may be called by the getStat() method
|
inline |
default constructor
|
inlinevirtual |
default destructor
|
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 |
Referenced by pion::http::plugin_server::add_service().
|
inline |
clears all the plug-in objects being managed
|
inline |
clones an existing plug-in object (creates a new one of the same type)
plugin_id | unique identifier associated with the plug-in |
References pion::plugin_manager< PluginType >::find().
|
inline |
returns true if there are no plug-in objects being managed
Referenced by pion::plugin_manager< PluginType >::map_type::clear().
|
inline |
finds the plug-in object associated with a particular resource (fuzzy match)
resource | resource identifier (uri-stem) to search for |
Referenced by pion::plugin_manager< PluginType >::clone(), pion::plugin_manager< PluginType >::get(), pion::plugin_manager< PluginType >::get_lib_ptr(), pion::plugin_manager< PluginType >::remove(), and pion::plugin_manager< PluginType >::replace().
|
inline |
gets the plug-in object associated with a particular plugin_id (exact match)
plugin_id | unique identifier associated with the plug-in |
References pion::plugin_manager< PluginType >::find().
|
inline |
gets the plug-in object associated with a particular plugin_id (exact match)
plugin_id | unique identifier associated with the plug-in |
References pion::plugin_manager< PluginType >::find().
|
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 |
References pion::plugin_manager< PluginType >::find().
|
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 |
|
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 |
|
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) |
References pion::plugin_ptr< InterfaceClassType >::create(), and pion::plugin::open().
Referenced by pion::http::plugin_server::load_service().
|
inline |
removes a plug-in object
plugin_id | unique identifier associated with the plug-in |
References pion::plugin_manager< PluginType >::find().
|
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 |
References pion::plugin_manager< PluginType >::find().
|
inline |
runs a method for every plug-in being managed
run_func | the function to execute for each plug-in object |
Referenced by pion::http::plugin_server::set_service_option().
|
inline |
runs a method for a particular plug-in
plugin_id | unique identifier associated with the plug-in |
run_func | the function to execute |
|
protected |
collection of plug-in objects being managed
Referenced by pion::plugin_manager< http::plugin_service >::clear(), and pion::plugin_manager< http::plugin_service >::empty().
|
mutableprotected |
mutex to make class thread-safe
Referenced by pion::plugin_manager< http::plugin_service >::clear(), and pion::plugin_manager< http::plugin_service >::empty().