A reference counting-managed pointer for classes derived from TGeoExtension which can be used as C pointer.
Based on CodeProject implementation example
Event if one forgets to call ptr2 = 0, the object gets delete when the method using ptr2 gets out of scope.
Definition at line 65 of file TGeoRCPtr.h.
Public Member Functions | |
TGeoRCPtr (const TGeoRCPtr &ptr) | |
TGeoRCPtr (T *ptr=nullptr) | |
~TGeoRCPtr () | |
T * | Get () const |
operator bool () const | |
operator T* () const | |
T & | operator* () const |
T * | operator-> () const |
TGeoRCPtr & | operator= (const TGeoRCPtr &ptr) |
TGeoRCPtr & | operator= (T *ptr) |
bool | operator== (const T *ptr) |
bool | operator== (const TGeoRCPtr &ptr) |
Private Attributes | |
T * | fPtr |
#include <TGeoRCPtr.h>
|
inline |
Definition at line 68 of file TGeoRCPtr.h.
|
inline |
Definition at line 75 of file TGeoRCPtr.h.
Definition at line 81 of file TGeoRCPtr.h.
Definition at line 102 of file TGeoRCPtr.h.
|
inline |
Definition at line 109 of file TGeoRCPtr.h.
|
inline |
Definition at line 108 of file TGeoRCPtr.h.
|
inline |
Definition at line 107 of file TGeoRCPtr.h.
|
inline |
Definition at line 106 of file TGeoRCPtr.h.
Definition at line 99 of file TGeoRCPtr.h.
|
inline |
Definition at line 88 of file TGeoRCPtr.h.
|
inline |
Definition at line 111 of file TGeoRCPtr.h.
Definition at line 110 of file TGeoRCPtr.h.
Definition at line 114 of file TGeoRCPtr.h.