#include <DeepCopyPointer.h>
Public Member Functions | |
DeepCopyPointer () | |
DeepCopyPointer (T *t) | |
DeepCopyPointer (const DeepCopyPointer &other) | |
DeepCopyPointer (DeepCopyPointer &&other) | |
operator bool () const | |
to allow test like " if (p) {...}" More... | |
T & | operator* () |
const T & | operator* () const |
T * | operator-> () |
const T * | operator-> () const |
DeepCopyPointer & | operator= (const DeepCopyPointer &other) |
DeepCopyPointer & | operator= (DeepCopyPointer &&other) |
bool | operator== (const T *otherP) const |
to allow test like " if (p == &someT) {...}" More... | |
T * | replaceInplace () |
void | replaceWith (T *otherP) |
~DeepCopyPointer () | |
Private Attributes | |
T * | theData |
A "smart" pointer that implements deep copy and ownership. 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 16 of file DeepCopyPointer.h.
|
inline |
|
inline |
Definition at line 21 of file DeepCopyPointer.h.
|
inline |
Definition at line 23 of file DeepCopyPointer.h.
|
inline |
|
inline |
|
inline |
to allow test like " if (p) {...}"
Definition at line 73 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 41 of file DeepCopyPointer.h.
References trackingPlots::other, std::swap(), and DeepCopyPointer< T >::theData.
|
inline |
to allow test like " if (p == &someT) {...}"
Definition at line 76 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
inline |
Definition at line 61 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
inline |
Assing a new bare pointer to this DeepCopyPointer, taking ownership of it. The old content of this DeepCopyPointer is deleted
Definition at line 49 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
private |
Definition at line 79 of file DeepCopyPointer.h.
Referenced by DeepCopyPointer< T >::DeepCopyPointer(), DeepCopyPointer< T >::operator bool(), DeepCopyPointer< T >::operator*(), DeepCopyPointer< T >::operator->(), DeepCopyPointer< T >::operator=(), DeepCopyPointer< T >::operator==(), DeepCopyPointer< T >::replaceInplace(), DeepCopyPointer< T >::replaceWith(), and DeepCopyPointer< T >::~DeepCopyPointer().