A sample class that implements a minimal intrusive reference counting scheme. More...
#include <countedptr.h>
Public Member Functions | |
IntrusiveRefCount () | |
Constructor for instatiating the Reference Count. | |
virtual | ~IntrusiveRefCount () |
Virtual Deconstructor to prevent issues with deletion with incomplete type information. | |
Whole | DecrementReferenceCount () |
Decrease the reference count by one and return the updated count. More... | |
virtual IntrusiveRefCount * | GetMostDerived () |
Get a pointer to the most Derived type of this class. More... | |
Whole | GetReferenceCount () const |
Get the current amount of references. More... | |
IntrusiveRefCount * | GetReferenceCountTargetAsPointer () |
Gets the actual pointer to the target. More... | |
Whole | IncrementReferenceCount () |
Increase the reference count by one and return the updated count. More... | |
A sample class that implements a minimal intrusive reference counting scheme.
It might work to inherit from this, however on some platforms multiple inheritance comes with the exact same cost intrusive pointers are designed to avoid. This should be used as an example of how to implement a reference counted object.
Definition at line 147 of file countedptr.h.
|
inline |
Decrease the reference count by one and return the updated count.
Definition at line 165 of file countedptr.h.
|
inlinevirtual |
Get a pointer to the most Derived type of this class.
Reimplemented in Mezzanine::Scripting::ScriptArgumentGeneric< NullArgument >, Mezzanine::Scripting::ScriptArgumentGeneric< Boole >, Mezzanine::Scripting::ScriptArgumentGeneric< Real >, Mezzanine::Scripting::ScriptArgumentGeneric< String >, Mezzanine::Scripting::ScriptArgumentGeneric< Whole >, Mezzanine::Scripting::ScriptArgumentGeneric< Integer >, Mezzanine::Scripting::Lua::Lua51NilArgument, Mezzanine::Scripting::Lua::Lua51BoolArgument, Mezzanine::Scripting::ScriptArgumentGeneric< T >, Mezzanine::Scripting::Lua::Lua51StringArgument, Mezzanine::Scripting::Lua::Lua51WholeArgument, Mezzanine::Scripting::Lua::Lua51RealArgument, Mezzanine::Scripting::Lua::Lua51IntegerArgument, and Mezzanine::Scripting::iScriptArgument.
Definition at line 180 of file countedptr.h.
|
inline |
Get the current amount of references.
Definition at line 175 of file countedptr.h.
|
inline |
Gets the actual pointer to the target.
Definition at line 170 of file countedptr.h.
|
inline |
Increase the reference count by one and return the updated count.
Definition at line 160 of file countedptr.h.