#include <RefCount.h>
Inheritance diagram for RefCountable:

Public Member Functions | |
| RefCountable () | |
| Default constructor. | |
| RefCountable (const RefCountable &) | |
| Copy constructor -- ref count and manager settings are deliberately not copied over! | |
| virtual | ~RefCountable () |
| Virtual destructor, to keep C++ honest. | |
| RefCountable & | operator= (const RefCountable &) |
| Assigment operator. | |
| 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. | |
Note that any object that can be reference counted can also be pooled and recycled.
Definition at line 16 of file RefCount.h.
| RefCountable::RefCountable | ( | ) | [inline] |
| virtual RefCountable::~RefCountable | ( | ) | [inline, virtual] |
Virtual destructor, to keep C++ honest.
Don't remove this unless you like crashing
Definition at line 26 of file RefCount.h.
| RefCountable& RefCountable::operator= | ( | const RefCountable & | ) | [inline] |
| void RefCountable::IncrementRefCount | ( | ) | const [inline] |
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] |
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] |
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] |
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