libglass::PluginManager Class Reference

#include <plugin.h>

List of all members.

Public Member Functions

 ~PluginManager ()
PluginBasegetPlugin (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)
GlassgetGlass (void) const

Friends

class PluginManagerBase
class PluginBase
class PluginInterface
class Glass


Detailed Description

PluginManager is the bridge between the Glass derived class (server, client, etc) and the plugins, which are responsible for all Glass functionality from the user's point of view. PluginManager guarantees that any message received by Glass is forwarded to the correct plugin. There's only one instance of this class for each Glass instance. This class can only be constructed by PluginManagerBase.
See also:
PluginManagerBase, Glass.

Definition at line 114 of file plugin.h.


Constructor & Destructor Documentation

libglass::PluginManager::PluginManager ( Glass g,
std::map< PluginId, PluginBase * > *  pluginmap 
) [protected]

Private constructor. This class is a pseudo-singleton.

libglass::PluginManager::~PluginManager (  ) 

Destructor.


Member Function Documentation

Glass* libglass::PluginManager::getGlass ( void   )  const [protected]

Returns our owner.

Returns:
The Glass class that owns us.

PluginBase* libglass::PluginManager::getPlugin ( PluginId  id  )  const

Returns a plugin given its id.

Parameters:
id The plugin id.
Returns:
A plugin given its id, or NULL if none found.

void libglass::PluginManager::printPlugins ( void   ) 

bool libglass::PluginManager::processPacket ( Packet p,
bool  rootOnly = false 
) [protected]

Packet processing.

This function is called only by Glass.

Parameters:
p The packet to process.
rootOnly Only process root packets; other packets are ignored.
Return values:
true If packet was correctly processed.
false If an error occurred while processing packet or if a non-root packet was ignored.
See also:
sendPacket().

bool libglass::PluginManager::sendPacket ( Packet p  )  [protected]

Send a packet. This function is called by PluginBase.

Parameters:
p The packet to process.
Return values:
true If packet was correctly sent.
false Otherwise.
See also:
processPacket().

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.

Parameters:
id The nodeId of the node.


Friends And Related Function Documentation

friend class Glass [friend]

Definition at line 141 of file plugin.h.

friend class PluginBase [friend]

Definition at line 139 of file plugin.h.

friend class PluginInterface [friend]

Definition at line 140 of file plugin.h.

friend class PluginManagerBase [friend]

Definition at line 138 of file plugin.h.


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

Generated on Fri May 28 13:19:01 2010 for libGlass by  doxygen 1.5.8