A structure used in the implementation of GNet::Server. More...
#include <gserver.h>
Public Member Functions | |
ServerPeerHandle () | |
Default constructor. More... | |
void | set (ServerPeer *p) |
Sets the pointer. More... | |
void | reset () |
Resets the pointer. More... | |
ServerPeer * | peer () |
Returns the pointer. More... | |
ServerPeer * | old () |
Returns the pointer value before it was reset(). More... | |
A structure used in the implementation of GNet::Server.
The server holds a list of handles which refer to all its peer objects. When a peer object deletes itself it resets the handle, without changing the server's list. The server uses its list to delete all peer objects from within its destructor. The server does garbage collection occasionally, deleting handles which have been reset.
GNet::ServerPeerHandle::ServerPeerHandle | ( | ) |
Default constructor.
Definition at line 328 of file gserver.cpp.
GNet::ServerPeer * GNet::ServerPeerHandle::old | ( | ) |
Returns the pointer value before it was reset().
Used in debugging.
Definition at line 344 of file gserver.cpp.
GNet::ServerPeer * GNet::ServerPeerHandle::peer | ( | ) |
Returns the pointer.
Definition at line 339 of file gserver.cpp.
void GNet::ServerPeerHandle::reset | ( | ) |
Resets the pointer.
Definition at line 334 of file gserver.cpp.
void GNet::ServerPeerHandle::set | ( | ServerPeer * | p | ) |
Sets the pointer.
Definition at line 349 of file gserver.cpp.