Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

OOF_mixRefCountWithCopy Class Reference
[OOFILE utility classes and functions.]

#include <oof1.h>

Inheritance diagram for OOF_mixRefCountWithCopy:

Inheritance graph
[legend]
List of all members.

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=.


Public Member Functions

void incRefs ()
void decRefs ()

Protected Member Functions

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

Protected Attributes

unsigned int * mSharedReferences
unsigned int mTimesDecCalled


Constructor & Destructor Documentation

OOF_mixRefCountWithCopy::OOF_mixRefCountWithCopy unsigned long  initialRefs = 1  )  [protected]
 

OOF_mixRefCountWithCopy::OOF_mixRefCountWithCopy const OOF_mixRefCountWithCopy  )  [inline, protected]
 

OOF_mixRefCountWithCopy::~OOF_mixRefCountWithCopy  )  [protected, virtual]
 


Member Function Documentation

virtual void OOF_mixRefCountWithCopy::CleanupOnLastDereference  )  [protected, pure virtual]
 

Implemented in OOF_mixFreeImageOwner.

void OOF_mixRefCountWithCopy::decRefs  ) 
 

void OOF_mixRefCountWithCopy::incRefs  )  [inline]
 

const OOF_mixRefCountWithCopy & OOF_mixRefCountWithCopy::operator= const OOF_mixRefCountWithCopy  )  [protected]
 


Member Data Documentation

unsigned int* OOF_mixRefCountWithCopy::mSharedReferences [protected]
 

unsigned int OOF_mixRefCountWithCopy::mTimesDecCalled [protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Jan 1 21:41:31 2004 for OOFILE by doxygen 1.3.5