#include <sp_smartpointer.h>
Public Member Functions | |
| unsigned | refs () const |
| gives the reference count of the object | |
| void | addReference () |
| addReference increments the ref count and checks for refCount overflow | |
| void | removeReference () |
| removeReference delete the object when refCount is zero | |
Protected Member Functions | |
| atomic_sp_smartable () | |
| atomic_sp_smartable (const atomic_sp_smartable &) | |
| virtual | ~atomic_sp_smartable () |
| destructor checks for non-zero refCount | |
| atomic_sp_smartable & | operator= (const atomic_sp_smartable &) |
Any object that want to support smart pointers should inherit from the smartable class which provides reference counting and automatic delete when the reference count drops to zero.
| atomic_sp_smartable::atomic_sp_smartable | ( | ) | [inline, protected] |
| atomic_sp_smartable::atomic_sp_smartable | ( | const atomic_sp_smartable & | ) | [inline, protected] |
| virtual atomic_sp_smartable::~atomic_sp_smartable | ( | ) | [inline, protected, virtual] |
destructor checks for non-zero refCount
| void atomic_sp_smartable::addReference | ( | ) |
addReference increments the ref count and checks for refCount overflow
| atomic_sp_smartable& atomic_sp_smartable::operator= | ( | const atomic_sp_smartable & | ) | [inline, protected] |
| unsigned atomic_sp_smartable::refs | ( | ) | const [inline] |
gives the reference count of the object
| void atomic_sp_smartable::removeReference | ( | ) |
removeReference delete the object when refCount is zero
1.5.8