Countable Class Reference

Common base class used by the reference counting pointer implementation (GCPtr). More...

#include <GCPtr.hxx>

Inheritance diagram for Countable:

AuthInfo Channel CVector< T, increment > DiffCommonSequence DiffLine DiffToken EntityCache Filter FilterSet ObDict ObDictEntry ObStore OpenDir Repository Resolution Serializable Session StrSet URI WorkSpace XDeltaArchive XDirent List of all members.

Public Member Functions

 Countable ()
 Constructor for a countable object.
 Countable (const Countable &)
virtual ~Countable ()
Countableoperator= (const Countable &)

Detailed Description

Common base class used by the reference counting pointer implementation (GCPtr).

It may seem surprising that the IncrementRefCount() and DecrementRefCount() methods are implemented here. This is because of a bug in g++ wherein it is impossible for Counter to declare:

///   template<class T> friend class GCPtr;
/// 

Definition at line 71 of file GCPtr.hxx.


Constructor & Destructor Documentation

Countable::Countable  )  [inline]
 

Constructor for a countable object.

This is mildly tricky. The problem is that for statically allocated objects we need to arrange for the reference count to be incremented by 1 extra to guarantee that the expiration of any GcPtr that points to it does not cause an attempt to deallocate a statically declared object. The following test assumes that the stack grows downwards.

Definition at line 84 of file GCPtr.hxx.

Countable::Countable const Countable  )  [inline]
 

Definition at line 89 of file GCPtr.hxx.

Countable::~Countable  )  [virtual]
 

Definition at line 43 of file GCPtr.cxx.


Member Function Documentation

Countable& Countable::operator= const Countable  )  [inline]
 

Definition at line 95 of file GCPtr.hxx.


The documentation for this class was generated from the following files:
Generated on Sun Apr 23 22:42:40 2006 for OpenCM by  doxygen 1.4.6