#include <Handle.h>
Public Member Functions | |
| Handle () | |
| Handle (T *ptr) | |
| Handle (const Handle &rhs) | |
| ~Handle () | |
| Handle & | operator= (const Handle &rhs) |
| T * | operator-> () const |
| T & | operator * () const |
| void | release () |
| bool | operator== (const Handle &rhs) |
| bool | operator!= (const Handle &rhs) |
Private Member Functions | |
| void | init () |
Private Attributes | |
| T * | p |
_____________________________________________________________________________
It's a smart pointer for objects with "built-in" reference count. Such implemetation makes the smallest possible smart pointer - its size is equivalent to just a single raw pointer.
_____________________________________________________________________________
Definition at line 18 of file CandFitTrackSA/Handle.h.
|
|||||||||
|
default ctor Definition at line 79 of file CandFitTrackSA/Handle.h. 00079 : p(0) 00080 {}
|
|
||||||||||
|
ctor from a raw pointer Definition at line 86 of file CandFitTrackSA/Handle.h. References Handle< T >::init().
|
|
||||||||||
|
copy ctor Definition at line 95 of file CandFitTrackSA/Handle.h. References Handle< T >::init().
|
|
|||||||||
|
dtor Definition at line 136 of file CandFitTrackSA/Handle.h. References Handle< T >::p, and Handle< T >::release(). 00137 {
00138 if (p) p->release();
00139 }
|
|
|||||||||
|
init Definition at line 123 of file CandFitTrackSA/Handle.h. References Handle< T >::p. Referenced by Handle< T >::Handle(), and Handle< T >::operator=().
|
|
|||||||||
|
dereference operator Definition at line 156 of file CandFitTrackSA/Handle.h. 00157 {
00158 return *p;
00159 }
|
|
||||||||||
|
!= operator - compares raw pointers Definition at line 188 of file CandFitTrackSA/Handle.h. References Handle< T >::p.
|
|
|||||||||
|
operator-> allows usage with pointer semantics Definition at line 146 of file CandFitTrackSA/Handle.h. 00147 {
00148 return p;
00149 }
|
|
||||||||||
|
assignment operator Definition at line 105 of file CandFitTrackSA/Handle.h. References Handle< T >::init(), Handle< T >::p, and Handle< T >::release(). 00106 {
00107 if (p != rhs.p) {
00108 if (p) {
00109 p->release();
00110 }
00111
00112 p = rhs.p;
00113 init();
00114 }
00115 return *this;
00116 }
|
|
||||||||||
|
== operator - compares raw pointers Definition at line 176 of file CandFitTrackSA/Handle.h. References Handle< T >::p.
|
|
|||||||||
|
release - set pointer to 0 Definition at line 165 of file CandFitTrackSA/Handle.h. References Handle< T >::p. Referenced by Handle< T >::operator=(), and Handle< T >::~Handle().
|
|
|||||
|
Definition at line 72 of file CandFitTrackSA/Handle.h. Referenced by Handle< T >::init(), Handle< T >::operator!=(), Handle< T >::operator=(), Handle< T >::operator==(), Handle< T >::release(), and Handle< T >::~Handle(). |
1.3.9.1