![]() |
Implementation of a reference counting instance for a particular memory resource.The SharedCountImpl class takes responsibility to release the bound memory resource. In case the reference count of the SharedCountBase base class drops to zero, the SharedCountImpl::Destroy() function is called to release the memory. More...
#include <SharedPtr.h>
Inherits blaze::SharedCountBase.
Public Member Functions | |
Constructors | |
SharedCountImpl (Type *ptr) | |
Initialization constructor for SharedCountImpl. More... | |
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... | |
Private Member Functions | |
Utility functions | |
virtual void | destroy () |
Release of the bound memory resource. More... | |
Private Attributes | |
Member variables | |
Type * | ptr_ |
The bound memory resource. | |
Implementation of a reference counting instance for a particular memory resource.
The SharedCountImpl class takes responsibility to release the bound memory resource. In case the reference count of the SharedCountBase base class drops to zero, the SharedCountImpl::Destroy() function is called to release the memory.
|
inlineexplicit |
Initialization constructor for SharedCountImpl.
This constructor binds the given memory resource to the shared counter.
|
inlineinherited |
Registers a new reference to the memory resource and increases the reference counter.
|
privatevirtual |
Release of the bound memory resource.
In case the reference counter drops to zero, this function releases the bound memory resource.
Implements blaze::SharedCountBase.
|
inlineinherited |
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.