#include <ReferenceCount.h>
Public Methods | |
Constructors and Destructor | |
ReferenceCount () | |
Create a ReferenceCount with a count of 1. | |
ReferenceCount (const ReferenceCount& other) | |
Copy constructor. More... | |
~ReferenceCount () | |
Calls Decrement(). | |
Public Methods | |
bool | IsUnique () const |
This method return true if the reference count has a value of 1. | |
Operators | |
ReferenceCount& | operator= (const ReferenceCount& other) |
Increment other's count, decrease the current reference count by calling Decrement(), and assign other's mCount to this object. | |
Private Methods | |
Privated Methods | |
void | Decrement () |
Decrease the count by one and delete mCount if its value goes to zero. | |
Private Attributes | |
Private Data Members | |
unsigned int* | mCount |
The pointer to the actual count. |
The count itself is implemented as a pointer in this class. This allows ReferenceCount objects be copied using the compiler generator copy constructors for classes which use ReferenceCount objects.
Definition at line 24 of file ReferenceCount.h.
|
|
Copy constructor.
Create a copy of the specified ReferenceCount object and increase the reference count by one.
Definition at line 131 of file ReferenceCount.h.
|
|
Decrease the count by one and delete mCount if its value goes to zero.
Definition at line 165 of file ReferenceCount.h.
|
This method return true if the reference count has a value of 1.
Definition at line 143 of file ReferenceCount.h.
|
Increment other's count, decrease the current reference count by calling Decrement(), and assign other's mCount to this object.
Definition at line 149 of file ReferenceCount.h.
|