#include <DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointer.h>
Public Member Functions | |
DeepCopyPointer (const DeepCopyPointer &other) | |
DeepCopyPointer (T *t) | |
DeepCopyPointer () | |
const T & | operator * () const |
T & | operator * () |
operator bool () const | |
to allow test like " if (p) {...}" | |
const T * | operator-> () const |
T * | operator-> () |
DeepCopyPointer & | operator= (const DeepCopyPointer &other) |
bool | operator== (const T *otherP) const |
to allow test like " if (p == &someT) {...}" | |
void | replaceWith (T *otherP) |
Assing a new bare pointer to this DeepCopyPointer, taking ownership of it. | |
~DeepCopyPointer () | |
Private Attributes | |
T * | theData |
In other words, when the pointer is copied it copies the object it points to using "new". It also deletes the object it points to when it is deleted. Very useful for use as private data member of a class: it handles the copy construction, assignment, and destruction.
Definition at line 13 of file DeepCopyPointer.h.
DeepCopyPointer< T >::DeepCopyPointer | ( | ) | [inline] |
DeepCopyPointer< T >::DeepCopyPointer | ( | T * | t | ) | [inline] |
DeepCopyPointer< T >::DeepCopyPointer | ( | const DeepCopyPointer< T > & | other | ) | [inline] |
DeepCopyPointer< T >::~DeepCopyPointer | ( | ) | [inline] |
const T& DeepCopyPointer< T >::operator * | ( | ) | const [inline] |
T& DeepCopyPointer< T >::operator * | ( | ) | [inline] |
DeepCopyPointer< T >::operator bool | ( | ) | const [inline] |
to allow test like " if (p) {...}"
Definition at line 51 of file DeepCopyPointer.h.
00051 { return theData != 0;}
const T* DeepCopyPointer< T >::operator-> | ( | ) | const [inline] |
T* DeepCopyPointer< T >::operator-> | ( | ) | [inline] |
DeepCopyPointer& DeepCopyPointer< T >::operator= | ( | const DeepCopyPointer< T > & | other | ) | [inline] |
bool DeepCopyPointer< T >::operator== | ( | const T * | otherP | ) | const [inline] |
to allow test like " if (p == &someT) {...}"
Definition at line 54 of file DeepCopyPointer.h.
00054 { return theData == otherP;}
void DeepCopyPointer< T >::replaceWith | ( | T * | otherP | ) | [inline] |
Assing a new bare pointer to this DeepCopyPointer, taking ownership of it.
The old content of this DeepCopyPointer is deleted
Definition at line 36 of file DeepCopyPointer.h.
Referenced by BasicSingleTrajectoryState::checkGlobalParameters().
00036 { 00037 if ( theData != otherP ) { 00038 delete theData; 00039 theData = otherP; 00040 } 00041 }
T* DeepCopyPointer< T >::theData [private] |
Definition at line 57 of file DeepCopyPointer.h.
Referenced by DeepCopyPointer< KFStripUpdator >::DeepCopyPointer(), DeepCopyPointer< KFStripUpdator >::operator *(), DeepCopyPointer< KFStripUpdator >::operator bool(), DeepCopyPointer< KFStripUpdator >::operator->(), DeepCopyPointer< KFStripUpdator >::operator=(), DeepCopyPointer< KFStripUpdator >::operator==(), DeepCopyPointer< KFStripUpdator >::replaceWith(), and DeepCopyPointer< KFStripUpdator >::~DeepCopyPointer().