All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
blaze::SharedCountBase Class Referenceabstract

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

blaze::SharedCountBase::SharedCountBase ( )
inlineexplicit

Default constructor for SharedCountBase().

The reference counter is initialized to 1.

Member Function Documentation

void blaze::SharedCountBase::addReference ( )
inline

Registers a new reference to the memory resource and increases the reference counter.

Returns
void
void blaze::SharedCountBase::release ( )
inline

Deregisters a reference and decreasing the reference counter.

Returns
void

In case the reference counter drops to zero, the memory resource is released and the shared counter destroys itself.


The documentation for this class was generated from the following file: