This exists once per object managed by a group of shared pointer to track items in memory. More...
#include <countedptr.h>
Public Member Functions | |
ReferenceCount (TypePointedTo *InitialPointer=0, unsigned InitialCount=0) | |
Constructor. More... | |
virtual | ~ReferenceCount () |
Destructor, cleans up the object when the last reference deletes this. | |
Whole | DecrementReferenceCount () |
Decrease the reference count by one and return the updated count. More... | |
virtual TypePointedTo * | GetMostDerived () |
Get a pointer to the Target as a The most derived type in of this object*. More... | |
Whole | GetReferenceCount () |
Get the current amount of references. More... | |
TypePointedTo * | GetReferenceCountTargetAsPointer () |
Gets the actual pointer to the target. More... | |
Whole | IncrementReferenceCount () |
Increase the reference count by one and return the updated count. More... | |
This exists once per object managed by a group of shared pointer to track items in memory.
This exists to track the pointer to the managed object, and stores the single counter of existing references. Only one of these should be created for each group of pointers managing the same object.
Definition at line 96 of file countedptr.h.
|
inline |
Constructor.
InitialPointer | A pointer to the type of this template. This defaults to 0 if not provided |
InitialCount | The number of references to default to this defaults to 1 if not provided. |
Definition at line 109 of file countedptr.h.
|
inline |
Decrease the reference count by one and return the updated count.
Definition at line 124 of file countedptr.h.
|
inlinevirtual |
Get a pointer to the Target as a The most derived type in of this object*.
Definition at line 139 of file countedptr.h.
|
inline |
Get the current amount of references.
Definition at line 134 of file countedptr.h.
|
inline |
Gets the actual pointer to the target.
Definition at line 129 of file countedptr.h.
|
inline |
Increase the reference count by one and return the updated count.
Definition at line 119 of file countedptr.h.