![]() |
Base reference counting instance for a particular memory resource.The SharedCountBase class is the shared reference counting instance for a particular memory resource. Once the reference count drops to zero, the memory resource is released and the SharedCountBase instance destroys itself. More...
#include <SharedPtr.h>
Inherits blaze::NonCopyable.
Inherited by blaze::SharedCountImpl< Type >.
Public Member Functions | |
Constructors | |
SharedCountBase () | |
Default constructor for SharedCountBase(). More... | |
Destructor | |
virtual | ~SharedCountBase () |
The destructor for SharedCountBase(). | |
Counting functions | |
void | addReference () |
Registers a new reference to the memory resource and increases the reference counter. More... | |
void | release () |
Deregisters a reference and decreasing the reference counter. More... | |
Protected Member Functions | |
Utility functions | |
virtual void | destroy ()=0 |
Private Attributes | |
Member variables | |
std::size_t | counter_ |
Reference counter. | |
Base reference counting instance for a particular memory resource.
The SharedCountBase class is the shared reference counting instance for a particular memory resource. Once the reference count drops to zero, the memory resource is released and the SharedCountBase instance destroys itself.
|
inlineexplicit |
Default constructor for SharedCountBase().
The reference counter is initialized to 1.
|
inline |
Registers a new reference to the memory resource and increases the reference counter.
|
inline |
Deregisters a reference and decreasing the reference counter.
In case the reference counter drops to zero, the memory resource is released and the shared counter destroys itself.