ThePEG::Pointer::ReferenceCounted Class Reference

ReferenceCounted must be the (virtual) base class of all classes which may be pointed to by the RCPtr smart pointer class. More...

#include <ReferenceCounted.h>

Inheritance diagram for ThePEG::Pointer::ReferenceCounted:

ThePEG::Base ThePEG::Collision ThePEG::ColourLine ThePEG::ColourLines ThePEG::DiagramBase ThePEG::Event ThePEG::EventInfoBase ThePEG::Hint ThePEG::InterfacedBase ThePEG::Main ThePEG::Particle ThePEG::PartonBin ThePEG::PartonBinInstance ThePEG::RemInfoBase ThePEG::Step ThePEG::SubProcess ThePEG::XComb

List of all members.

Public Types

typedef unsigned int CounterType
 The integer type used for counting.

Public Member Functions

CounterType referenceCount () const
 Return the reference count.

Public Attributes

const unsigned long uniqueId
 The unique ID.

Protected Member Functions

Standard constructors and assignment.
 ReferenceCounted ()
 Default constructor.
 ReferenceCounted (const ReferenceCounted &)
 Copy-constructor.
ReferenceCountedoperator= (const ReferenceCounted &)
 Assignment.

Private Member Functions

void incrementReferenceCount () const
 Increment the reference count.
bool decrementReferenceCount () const
 Decrement with the reference count.

Private Attributes

CounterType theReferenceCounter
 The reference count.

Static Private Attributes

static unsigned long objectCounter
 A counter for issuing unique IDs.

Friends

class RCPtrBase
 The RCPtrBase class needs to acces the private parts of ReferenceCounted.
class ThePEG::PersistentIStream


Detailed Description

ReferenceCounted must be the (virtual) base class of all classes which may be pointed to by the RCPtr smart pointer class.

It keeps track of all RCPtr and ConstRCPtr pointers which are currently pointing to an object.

See also:
RCPtr

ConstRCPtr

Definition at line 30 of file ReferenceCounted.h.


Friends And Related Function Documentation

friend class RCPtrBase [friend]

The RCPtrBase class needs to acces the private parts of ReferenceCounted.

Definition at line 33 of file ReferenceCounted.h.


Member Data Documentation

The unique ID.

Can be used as sorting criterion, e.g. for set<> and map<>.

Definition at line 104 of file ReferenceCounted.h.

unsigned long ThePEG::Pointer::ReferenceCounted::objectCounter [static, private]

A counter for issuing unique IDs.

It will overflow back to 0 eventually, but it is very unlikely that two identical IDs show up in the same event.

Definition at line 112 of file ReferenceCounted.h.


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

Generated on Thu Apr 29 12:43:34 2010 for ThePEG by  doxygen 1.5.5