GNet::Monitor Class Reference

A singleton for monitoring SimpleClient and ServerPeer connections. More...

#include <gmonitor.h>

Inheritance diagram for GNet::Monitor:

G::noncopyable

List of all members.

Public Member Functions

 Monitor ()
 Default constructor.
virtual ~Monitor ()
 Destructor.
void add (const SimpleClient &client)
 Adds a client.
void remove (const SimpleClient &client)
 Removes a client.
void add (const ServerPeer &peer)
 Adds a server peer.
void remove (const ServerPeer &peer)
 Removes a server peer.
void report (std::ostream &stream, const std::string &line_prefix=std::string(), const std::string &eol=std::string("\n"))
 Reports itself onto a stream.
G::Signal2< std::string,
std::string > & 
signal ()
 Provides a callback signal which can be connect()ed to a slot.

Static Public Member Functions

static Monitorinstance ()
 Returns the singleton pointer. Returns null if none.


Detailed Description

A singleton for monitoring SimpleClient and ServerPeer connections.

See also:
GNet::SimpleClient, GNet::ServerPeer

Definition at line 43 of file gmonitor.h.


Constructor & Destructor Documentation

GNet::Monitor::Monitor (  ) 

Default constructor.

Definition at line 68 of file gmonitor.cpp.

References G_ASSERT.

GNet::Monitor::~Monitor (  )  [virtual]

Destructor.

Definition at line 75 of file gmonitor.cpp.


Member Function Documentation

GNet::Monitor * GNet::Monitor::instance (  )  [static]

Returns the singleton pointer. Returns null if none.

Definition at line 81 of file gmonitor.cpp.

Referenced by GNet::ServerPeer::ServerPeer(), GNet::SimpleClient::SimpleClient(), GNet::ServerPeer::~ServerPeer(), and GNet::SimpleClient::~SimpleClient().

void GNet::Monitor::add ( const SimpleClient client  ) 

void GNet::Monitor::remove ( const SimpleClient client  ) 

void GNet::Monitor::add ( const ServerPeer peer  ) 

void GNet::Monitor::remove ( const ServerPeer peer  ) 

void GNet::Monitor::report ( std::ostream &  stream,
const std::string &  line_prefix = std::string(),
const std::string &  eol = std::string("\n") 
)

G::Signal2< std::string, std::string > & GNet::Monitor::signal (  ) 

Provides a callback signal which can be connect()ed to a slot.

The signal emits events with two string parameters: the first is "in" or "out", and the second is "start" or "stop".

Definition at line 145 of file gmonitor.cpp.


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5