Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

RefCounter Class Reference

#include <RefCounter.h>

Inheritance diagram for RefCounter::

AheadInfoRep AssociationsIteratorRep AssociationsRep CharsRep DiffHistoryRep DiffHistoryVtxRep DListIteratorRep DListRep ListIteratorRep ListRep PureRep QuickAssociationsIteratorRep SetData VectorPtrRep VectorRep WordOrderRep List of all members.

Public Types

typedef unsigned int refCounterType

Public Methods

 RefCounter ()
 Default constructor. More...

 RefCounter (const RefCounter &rc)
 Copy constructor. More...

bool lastRef () const
bool sharedRef () const
void addRef () const
void delRef () const

Private Methods

RefCounter& operator= (const RefCounter &)
 disable assignment: normally representations are never assigned.


Private Attributes

refCounterType xrefs
 extra references (ie 0 means one ref).


Member Typedef Documentation

typedef unsigned int RefCounter::refCounterType
 

Definition at line 51 of file RefCounter.h.


Constructor & Destructor Documentation

RefCounter::RefCounter ( ) [inline]
 

Default constructor.

a new reference counter is initialised with a ref count of 1 (ie 0 extra refs)

Definition at line 59 of file RefCounter.h.

RefCounter::RefCounter ( const RefCounter & rc ) [inline]
 

Copy constructor.

for derived representation classes whose copy constructor is generated by the compiler: a new (copied) representation also has an initial extra ref count of 0

Definition at line 64 of file RefCounter.h.


Member Function Documentation

bool RefCounter::lastRef ( ) const [inline]
 

Returns true if reference counter xrefs is 0

Definition at line 78 of file RefCounter.h.

Referenced by ObjectOf::acquireRep(), ObjectOf::change(), ObjectOf::operator=(), and ObjectOf::~ObjectOf().

bool RefCounter::sharedRef ( ) const [inline]
 

Returns true if reference counter xrefs is not equal to 0

Definition at line 81 of file RefCounter.h.

void RefCounter::addRef ( ) const [inline]
 

Increment the reference counter. addRef is logically constant

Definition at line 85 of file RefCounter.h.

Referenced by ObjectOf::ObjectOf(), EltIdentityRep::inverse(), and EltIdentityRep::operator *().

void RefCounter::delRef ( ) const [inline]
 

Decreement the reference counter. delRef is logically const

Definition at line 90 of file RefCounter.h.

Referenced by ObjectOf::acquireRep(), ObjectOf::change(), ObjectOf::operator=(), and ObjectOf::~ObjectOf().

RefCounter & RefCounter::operator= ( const RefCounter & ) [private]
 

disable assignment: normally representations are never assigned.


Member Data Documentation

refCounterType RefCounter::xrefs [private]
 

extra references (ie 0 means one ref).

Definition at line 106 of file RefCounter.h.


The documentation for this class was generated from the following file:
Generated at Tue Jun 19 09:50:05 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001