All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
blaze::SharedCountImpl< Type > Class Template Reference

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.
 

Detailed Description

template<typename Type>
class blaze::SharedCountImpl< Type >

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.

Constructor & Destructor Documentation

template<typename Type >
blaze::SharedCountImpl< Type >::SharedCountImpl ( Type *  ptr)
inlineexplicit

Initialization constructor for SharedCountImpl.

This constructor binds the given memory resource to the shared counter.

Member Function Documentation

void blaze::SharedCountBase::addReference ( )
inlineinherited

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

Returns
void
template<typename Type >
void blaze::SharedCountImpl< Type >::destroy ( )
privatevirtual

Release of the bound memory resource.

Returns
void

In case the reference counter drops to zero, this function releases the bound memory resource.

Implements blaze::SharedCountBase.

void blaze::SharedCountBase::release ( )
inlineinherited

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: