#include <plugin.h>
Public Member Functions | |
~PluginManager () | |
PluginBase * | getPlugin (PluginId id) const |
void | printPlugins (void) |
Protected Member Functions | |
PluginManager (Glass *g, std::map< PluginId, PluginBase * > *pluginmap) | |
bool | processPacket (Packet &p, bool rootOnly=false) |
bool | sendPacket (Packet &p) |
void | unregisterNode (nodeId id) |
Glass * | getGlass (void) const |
Friends | |
class | PluginManagerBase |
class | PluginBase |
class | PluginInterface |
class | Glass |
Definition at line 114 of file plugin.h.
libglass::PluginManager::PluginManager | ( | Glass * | g, | |
std::map< PluginId, PluginBase * > * | pluginmap | |||
) | [protected] |
Private constructor. This class is a pseudo-singleton.
libglass::PluginManager::~PluginManager | ( | ) |
Destructor.
Glass* libglass::PluginManager::getGlass | ( | void | ) | const [protected] |
Returns our owner.
PluginBase* libglass::PluginManager::getPlugin | ( | PluginId | id | ) | const |
Returns a plugin given its id.
id | The plugin id. |
void libglass::PluginManager::printPlugins | ( | void | ) |
bool libglass::PluginManager::processPacket | ( | Packet & | p, | |
bool | rootOnly = false | |||
) | [protected] |
Packet processing.
This function is called only by Glass.
p | The packet to process. | |
rootOnly | Only process root packets; other packets are ignored. |
true | If packet was correctly processed. | |
false | If an error occurred while processing packet or if a non-root packet was ignored. |
bool libglass::PluginManager::sendPacket | ( | Packet & | p | ) | [protected] |
Send a packet. This function is called by PluginBase.
p | The packet to process. |
true | If packet was correctly sent. | |
false | Otherwise. |
void libglass::PluginManager::unregisterNode | ( | nodeId | id | ) | [protected] |
Clean up system.
Guarantees that a node quit event is properly handled by the plugins, avoiding potential deadlocks.
Do not call sendPacket() from this function to send any data to id, since it's quite likely that the connection to the node is already dead. You can send to other nodes or to everybodyId, however.
id | The nodeId of the node. |
friend class PluginBase [friend] |
friend class PluginInterface [friend] |
friend class PluginManagerBase [friend] |