|
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={}, 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 | |
| Monitor & | operator= (const Monitor &)=delete |
| Monitor & | 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 43 of file gmonitor.h.
| GNet::Monitor::Monitor | ( | ) |
Default constructor.
Definition at line 82 of file gmonitor.cpp.
| GNet::Monitor::~Monitor | ( | ) |
Destructor.
Definition at line 89 of file gmonitor.cpp.
|
static |
Adds a client connection.
Definition at line 104 of file gmonitor.cpp.
|
static |
Adds a server.
Definition at line 141 of file gmonitor.cpp.
|
static |
Adds a server connection.
Definition at line 122 of file gmonitor.cpp.
|
static |
Returns the singleton pointer. Returns nullptr if none.
Definition at line 94 of file gmonitor.cpp.
|
staticnoexcept |
Removes a client connection.
Definition at line 113 of file gmonitor.cpp.
|
staticnoexcept |
Removes a server.
Definition at line 150 of file gmonitor.cpp.
|
staticnoexcept |
Removes a server connection.
Definition at line 132 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 165 of file gmonitor.cpp.
| void GNet::Monitor::report | ( | std::ostream & | stream, |
| const std::string & | line_prefix = {}, |
||
| const std::string & | eol = std::string("\n") |
||
| ) | const |
Reports itself onto a stream.
Definition at line 159 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 99 of file gmonitor.cpp.