OOFILE  1.9
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OOF_mixRefCountWithCopy Class Referenceabstract

Mixin proving shared counter with cleanup and copying logic. More...

#include <oof1.h>

Inheritance diagram for OOF_mixRefCountWithCopy:
Inheritance graph
[legend]

Public Member Functions

void decRefs ()
 
void incRefs ()
 

Protected Member Functions

virtual void CleanupOnLastDereference ()=0
 
 OOF_mixRefCountWithCopy (unsigned long initialRefs=1)
 
 OOF_mixRefCountWithCopy (const OOF_mixRefCountWithCopy &)
 
const OOF_mixRefCountWithCopyoperator= (const OOF_mixRefCountWithCopy &)
 
virtual ~OOF_mixRefCountWithCopy ()
 

Protected Attributes

unsigned int * mSharedReferences
 
unsigned int mTimesDecCalled
 

Detailed Description

Mixin proving shared counter with cleanup and copying logic.

Client classes call incRefs and decRefs. Inherit from this and implement CleanupOnLastDereference if you have shared resources and want to know when to delete them. Makes it possible to avoid writing copy ctor's and operator=.

Definition at line 101 of file oof1.h.

Constructor & Destructor Documentation

OOF_mixRefCountWithCopy::OOF_mixRefCountWithCopy ( unsigned long  initialRefs = 1)
protected

Definition at line 3226 of file oof1.cpp.

References mSharedReferences.

OOF_mixRefCountWithCopy::OOF_mixRefCountWithCopy ( const OOF_mixRefCountWithCopy rhs)
inlineprotected

Definition at line 2685 of file oof1.h.

References incRefs().

OOF_mixRefCountWithCopy::~OOF_mixRefCountWithCopy ( )
protectedvirtual

Definition at line 3244 of file oof1.cpp.

References mTimesDecCalled.

Member Function Documentation

virtual void OOF_mixRefCountWithCopy::CleanupOnLastDereference ( )
protectedpure virtual

Implemented in OOF_mixFreeImageOwner.

Referenced by decRefs().

void OOF_mixRefCountWithCopy::decRefs ( )
void OOF_mixRefCountWithCopy::incRefs ( )
inline

Definition at line 2693 of file oof1.h.

Referenced by OOF_mixRefCountWithCopy(), and operator=().

const OOF_mixRefCountWithCopy & OOF_mixRefCountWithCopy::operator= ( const OOF_mixRefCountWithCopy rhs)
protected

Definition at line 3235 of file oof1.cpp.

References decRefs(), incRefs(), mSharedReferences, and mTimesDecCalled.

Member Data Documentation

unsigned int* OOF_mixRefCountWithCopy::mSharedReferences
protected

Definition at line 112 of file oof1.h.

Referenced by decRefs(), OOF_mixRefCountWithCopy(), and operator=().

unsigned int OOF_mixRefCountWithCopy::mTimesDecCalled
protected

Definition at line 113 of file oof1.h.

Referenced by decRefs(), operator=(), and ~OOF_mixRefCountWithCopy().


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