#include <Socket.h>
Inheritance diagram for Socket:

Public Member Functions | |
| Socket () | |
| Default constructor. | |
| Socket (int fd, bool okayToClose=true) | |
| Constructor. | |
| virtual | ~Socket () |
| Destructor. | |
| int | ReleaseFileDescriptor () |
| Returns and releases our held file descriptor. | |
| int | GetFileDescriptor () const |
| Returns the held socket fd, but does not release ownership of it. | |
| void | SetFileDescriptor (int fd, bool okayToClose=true) |
| Sets our file descriptor. | |
| void | IncrementRefCount () const |
| Increments the counter and returns true iff the new value is zero. | |
| bool | DecrementRefCount () const |
| Decrements the counter and returns true iff the new value is zero. | |
| void | SetManager (AbstractObjectManager *manager) |
| Sets the recycle-pointer for this object. | |
| AbstractObjectManager * | GetManager () const |
| Returns this object's current recyler pointer. | |
| uint32 | GetRefCount () const |
| Returns this object's current reference count. | |
Definition at line 14 of file Socket.h.
| Socket::Socket | ( | int | fd, | |
| bool | okayToClose = true | |||
| ) | [inline, explicit] |
| virtual Socket::~Socket | ( | ) | [virtual] |
Destructor.
Closes our held file descriptor, if we have one.
| int Socket::ReleaseFileDescriptor | ( | ) | [inline] |
| void Socket::SetFileDescriptor | ( | int | fd, | |
| bool | okayToClose = true | |||
| ) |
Sets our file descriptor.
Will close any old one if appropriate.
| void RefCountable::IncrementRefCount | ( | ) | const [inline, inherited] |
Increments the counter and returns true iff the new value is zero.
Thread safe.
Definition at line 32 of file RefCount.h.
References AtomicCounter::AtomicIncrement().
| bool RefCountable::DecrementRefCount | ( | ) | const [inline, inherited] |
Decrements the counter and returns true iff the new value is zero.
Thread safe.
Definition at line 35 of file RefCount.h.
References AtomicCounter::AtomicDecrement().
| void RefCountable::SetManager | ( | AbstractObjectManager * | manager | ) | [inline, inherited] |
Sets the recycle-pointer for this object.
If set to non-NULL, this pointer is used by the ObjectPool class to recycle this object when it is no longer in use, so as to avoid the overhead of having to delete it and re-create it later on. The RefCountable class itself does nothing with this pointer. Default value is NULL.
| manager | Pointer to the new manager object to use, or NULL to use no manager. |
Definition at line 44 of file RefCount.h.
| uint32 RefCountable::GetRefCount | ( | ) | const [inline, inherited] |
Returns this object's current reference count.
Note that the value returned by this method is volatile in multithreaded environments, so it may already be wrong by the time it is returned. Be careful!
Definition at line 54 of file RefCount.h.
References AtomicCounter::GetCount().
1.5.1