E-MailRelay
|
A singleton for monitoring GNet::Client and GNet::ServerPeer connections. More...
#include <gmonitor.h>
Public Member Functions | |
Monitor () | |
Default constructor. More... | |
~Monitor () | |
Destructor. More... | |
void | report (std::ostream &stream, const std::string &line_prefix=std::string(), const std::string &eol=std::string("\n")) const |
Reports itself onto a stream. More... | |
void | report (G::StringArray &out) const |
Reports itself into a three-column table (ordered with the column index varying fastest). More... | |
G::Slot::Signal< const std::string &, const std::string & > & | signal () |
Provides a callback signal which can be connect()ed to a slot. More... | |
Monitor (const Monitor &)=delete | |
Monitor (Monitor &&)=delete | |
void | operator= (const Monitor &)=delete |
void | operator= (Monitor &&)=delete |
Static Public Member Functions | |
static Monitor * | instance () |
Returns the singleton pointer. Returns nullptr if none. More... | |
static void | addClient (const Connection &client) |
Adds a client connection. More... | |
static void | removeClient (const Connection &client) noexcept |
Removes a client connection. More... | |
static void | addServerPeer (const Connection &server_peer) |
Adds a server connection. More... | |
static void | removeServerPeer (const Connection &server_peer) noexcept |
Removes a server connection. More... | |
static void | addServer (const Listener &server) |
Adds a server. More... | |
static void | removeServer (const Listener &server) noexcept |
Removes a server. More... | |
A singleton for monitoring GNet::Client and GNet::ServerPeer connections.
Definition at line 42 of file gmonitor.h.
GNet::Monitor::Monitor | ( | ) |
Default constructor.
Definition at line 86 of file gmonitor.cpp.
GNet::Monitor::~Monitor | ( | ) |
Destructor.
Definition at line 93 of file gmonitor.cpp.
|
static |
Adds a client connection.
Definition at line 108 of file gmonitor.cpp.
|
static |
Adds a server.
Definition at line 145 of file gmonitor.cpp.
|
static |
Adds a server connection.
Definition at line 126 of file gmonitor.cpp.
|
static |
Returns the singleton pointer. Returns nullptr if none.
Definition at line 98 of file gmonitor.cpp.
|
staticnoexcept |
Removes a client connection.
Definition at line 117 of file gmonitor.cpp.
|
staticnoexcept |
Removes a server.
Definition at line 154 of file gmonitor.cpp.
|
staticnoexcept |
Removes a server connection.
Definition at line 136 of file gmonitor.cpp.
void GNet::Monitor::report | ( | G::StringArray & | out | ) | const |
Reports itself into a three-column table (ordered with the column index varying fastest).
Definition at line 168 of file gmonitor.cpp.
void GNet::Monitor::report | ( | std::ostream & | stream, |
const std::string & | line_prefix = std::string() , |
||
const std::string & | eol = std::string("\n") |
||
) | const |
Reports itself onto a stream.
Definition at line 163 of file gmonitor.cpp.
G::Slot::Signal< const std::string &, const 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", "out" or "listen", and the second is "start" or "stop".
Definition at line 103 of file gmonitor.cpp.