19#ifndef _TREFERENCE_HXX_
20#define _TREFERENCE_HXX_
82 if (
ptr)
ptr -> AddReference();
87 ptr -> AddReference();
91 if(
ptr &&
ptr -> DelReference() == 0)
delete ptr;
112 if(
ptr &&
ptr -> DelReference() == 0)
delete ptr;
114 if (
ptr)
ptr -> AddReference();
124 if(
ptr &&
ptr -> DelReference() == 0)
delete ptr;
126 if (
ptr)
ptr -> AddReference();
Handle dynamical object creation and pointer affectation.
Definition TReference.hxx:74
Reference_ptr & operator=(const Reference_ptr &r)
Affectation ; destroy old ptr if is no more referenced.
Definition TReference.hxx:108
T * operator->() const
Definition TReference.hxx:98
T * ptr
Pointer to the template class T.
Definition TReference.hxx:76
bool operator==(T *p)
Definition TReference.hxx:131
T * Get() const
Definition TReference.hxx:102
bool operator!=(T *p)
Definition TReference.hxx:135
Reference_ptr(const Reference_ptr &r)
Definition TReference.hxx:84
~Reference_ptr()
Definition TReference.hxx:89
Reference_ptr(T *p=nullptr)
Definition TReference.hxx:79
T & operator*() const
Definition TReference.hxx:94
Base class to reference all Shape objects and some nucleus.
Definition TReference.hxx:38
void AddReference(unsigned n=1)
Definition TReference.hxx:46
unsigned fNbReferences
Number of references to an object.
Definition TReference.hxx:60
TReference()
Definition TReference.hxx:40
virtual ~TReference()=default
Destructor.
unsigned Reference()
Definition TReference.hxx:55
unsigned DelReference(unsigned n=1)
Definition TReference.hxx:50