counts the number of smartpointers refering to it More...
#include <reference-count.h>

Public Member Functions | |
| ReferenceCount () | |
| ReferenceCount (const ReferenceCount &) | |
| ReferenceCount & | operator= (const ReferenceCount &o) |
| void | incref () |
| int | decref () |
| virtual | ~ReferenceCount () |
Public Attributes | |
| volatile int | reference_count |
counts the number of smartpointers refering to it
Keeps track of the number of reference floating around to this object. This class is resistent to concurrent access. In other words the reference_count will be atomically increased and decreased
| ReferenceCount::ReferenceCount | ( | ) | [inline] |
| ReferenceCount::ReferenceCount | ( | const ReferenceCount & | ) | [inline] |
| virtual ReferenceCount::~ReferenceCount | ( | ) | [inline, virtual] |
destroys the object. In this case performs a sanity check on the refernce_count.
References assert(), and reference_count.
| int ReferenceCount::decref | ( | ) | [inline] |
decreases the refernce count. Returns the new reference count.
References cmpxchg, and reference_count.
| void ReferenceCount::incref | ( | ) | [inline] |
atomically increases the reference count.
References assert(), cmpxchg, and reference_count.
| ReferenceCount& ReferenceCount::operator= | ( | const ReferenceCount & | o | ) | [inline] |
References assert(), and reference_count.
| volatile int ReferenceCount::reference_count |
The number of smart pointers refering to this object. 0 if none.
Referenced by decref(), incref(), operator=(), and ~ReferenceCount().
1.6.2