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 69 of file TGeoRCPtr.h.
|
inline |
Definition at line 76 of file TGeoRCPtr.h.
Definition at line 82 of file TGeoRCPtr.h.
|
inline |
Definition at line 103 of file TGeoRCPtr.h.
Definition at line 113 of file TGeoRCPtr.h.
|
inline |
Definition at line 112 of file TGeoRCPtr.h.
|
inline |
Definition at line 111 of file TGeoRCPtr.h.
|
inline |
Definition at line 110 of file TGeoRCPtr.h.
Definition at line 97 of file TGeoRCPtr.h.
Definition at line 88 of file TGeoRCPtr.h.
Definition at line 115 of file TGeoRCPtr.h.
Definition at line 114 of file TGeoRCPtr.h.
|
private |
Definition at line 118 of file TGeoRCPtr.h.