zipios::ReferenceCount< Type > Class Template Reference

ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes handled through a SimpleSmartPointer. More...

#include <simplesmartptr.h>

Public Member Functions

const ReferenceCountoperator= (const ReferenceCount &)
 The assignment operator doesn't copy the reference count, it leaves it unchanged. More...
 
 ReferenceCount ()
 Constructor initializes count to zero. More...
 
 ReferenceCount (const ReferenceCount &)
 Copy-constructor initializes count to zero. More...
 

Friends

class Bogus
 
class FileEntry
 Type also needs to be a friend to invoke the private ref() and unref() methods, in case Type doesn't want to inherit ReferenceCount and thus needs to invoke ref() and unref() through forwarding member functions. More...
 
class SimpleSmartPointer< const Type >
 
class SimpleSmartPointer< Type >
 SimpleSmartPointer needs to be a friend to invoke the private ref() and unref() methods. More...
 

Detailed Description

template<class Type>
class zipios::ReferenceCount< Type >

ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes handled through a SimpleSmartPointer.

Subclassing ReferenceCount is all a class needs to become ready for being handled by SimpleSmartPointer. Another way is to add a ReferenceCount member variable to a class and write two methods 'void ref() const' and 'unsigned int unref() const' that invoke the same methods in the ReferenceCount variable.

Constructor & Destructor Documentation

◆ ReferenceCount() [1/2]

template<class Type >
zipios::ReferenceCount< Type >::ReferenceCount ( )

Constructor initializes count to zero.

◆ ReferenceCount() [2/2]

template<class Type >
zipios::ReferenceCount< Type >::ReferenceCount ( const ReferenceCount< Type > &  )

Copy-constructor initializes count to zero.

It doesn't copy it from src.

Member Function Documentation

◆ operator=()

template<class Type >
const ReferenceCount & zipios::ReferenceCount< Type >::operator= ( const ReferenceCount< Type > &  )

The assignment operator doesn't copy the reference count, it leaves it unchanged.


Friends And Related Function Documentation

◆ Bogus

template<class Type >
friend class Bogus
friend

◆ FileEntry

template<class Type >
friend class FileEntry
friend

Type also needs to be a friend to invoke the private ref() and unref() methods, in case Type doesn't want to inherit ReferenceCount and thus needs to invoke ref() and unref() through forwarding member functions.

◆ SimpleSmartPointer< const Type >

template<class Type >
friend class SimpleSmartPointer< const Type >
friend

◆ SimpleSmartPointer< Type >

template<class Type >
friend class SimpleSmartPointer< Type >
friend

SimpleSmartPointer needs to be a friend to invoke the private ref() and unref() methods.



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