ROOT logo
Gled » GLEDCORE » SRefCounted

class SRefCounted


 A reference-counted stone.
 Note that the ref-count is not serialized -- so rebuild it in
 post-streaming function when necessary.
 When zero ref count is reached in DecRefCount(),
   virtual void OnZeroRefCount();
 is called. Default action is to destroy the object. Note, mutex is NOT
 unlocked in this case ... so if you keep the object alive in OnZeroRefCnt()
 also unlock the mutex.

Function Members (Methods)

public:
SRefCounted()
SRefCounted(const SRefCounted&)
virtual~SRefCounted()
static TClass*Class()
virtual Int_tDecRefCount(Int_t rc = 1)
virtual Int_tIncRefCount(Int_t rc = 1)
virtual TClass*IsA() const
virtual voidOnZeroRefCount()
SRefCounted&operator=(const SRefCounted&)
virtual voidSetRefCount(Int_t rc)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)

Data Members

protected:
GMutexmRCMutex!
Int_tmRefCount!

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

SRefCounted()
{}
~SRefCounted()
{}
void SetRefCount(Int_t rc)
Int_t IncRefCount(Int_t rc = 1)
Int_t DecRefCount(Int_t rc = 1)
void OnZeroRefCount()
SRefCounted()