#include <WOscNetReturn.h>
Inherited by TheNetReturnAddress.
Protected Member Functions | |
WOscNetReturn () | |
virtual | ~WOscNetReturn () |
void | AddParent () |
void | RemoveParent () |
Friends | |
class | WOscQueueItem |
class | WOscReceiver |
System independent network-address base-class. Required to pass a return address of the client which send the message to the method handling the message. Inherit a new class from this base class and your system-specific network address-class.
All address-object-references passed to networkReceive of WOscReceiver (and inherited classes) will be managed and deleted internally.
WOscNetReturn features a garbage-collector like memory-management which keeps the object alive as long there are parents. Each parent has to register and unregister itself by calling addParent() and removeParent() resp..
If the last object unregisters itself, the object gets deleted.
In this library the WOscQueueItem and WOscReceiver are the only users of objects of this kind.
All return-address management in this library is handled through references, thus the library does not have to be recompiled or even changed when using external internet-(or similar for different transport layers) addresses. Simply inherit.
WOscClient.cpp, WOscServer.cpp, WOscStreamingClient.cpp, and WOscStreamingServer.cpp.
Definition at line 81 of file WOscNetReturn.h.
WOscNetReturn::WOscNetReturn | ( | ) | [protected] |
Constructor. Resets the parent counter (no parents yet).
Definition at line 46 of file WOscNetReturn.cpp.
WOscNetReturn::~WOscNetReturn | ( | ) | [protected, virtual] |
void WOscNetReturn::AddParent | ( | ) | [protected] |
An owner (user) of this object increases the parent counter to request an ongoing existence. To unregister call WOscNetReturn::removeParent() .
Definition at line 57 of file WOscNetReturn.cpp.
void WOscNetReturn::RemoveParent | ( | ) | [protected] |
An owner (user) of this object decreases the parent counter to announce, that it isn't interested in this object anymore. If the parent counter reaches zero, the object destructs itself.
Definition at line 67 of file WOscNetReturn.cpp.
Referenced by WOscReceiver::ManagePriorityQueue(), and WOscReceiver::NetworkReceive().
friend class WOscQueueItem [friend] |
The parent object (WOscQueueItem) determines if a network-return address is an orphan by adding and removing itself as a parent.
Definition at line 89 of file WOscNetReturn.h.
friend class WOscReceiver [friend] |
When receiving a message, the network-return-address has to be deleted in receiver.
Definition at line 92 of file WOscNetReturn.h.