#include <DeepCopyPointer.h>
Public Member Functions | |
DeepCopyPointer () | |
DeepCopyPointer (const DeepCopyPointer &other) | |
DeepCopyPointer (DeepCopyPointer &&other) | |
DeepCopyPointer (T *t) | |
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 15 of file DeepCopyPointer.h.
|
inline |
|
inline |
Definition at line 19 of file DeepCopyPointer.h.
|
inline |
Definition at line 21 of file DeepCopyPointer.h.
|
inline |
Definition at line 23 of file DeepCopyPointer.h.
References trackingPlots::other, and DeepCopyPointer< T >::theData.
|
inline |
Definition at line 42 of file DeepCopyPointer.h.
References trackingPlots::other.
|
inline |
to allow test like " if (p) {...}"
Definition at line 71 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 30 of file DeepCopyPointer.h.
References trackingPlots::other, and DeepCopyPointer< T >::theData.
|
inline |
Definition at line 43 of file DeepCopyPointer.h.
References trackingPlots::other, std::swap(), and DeepCopyPointer< T >::theData.
|
inline |
to allow test like " if (p == &someT) {...}"
Definition at line 74 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
inline |
|
inline |
Assing a new bare pointer to this DeepCopyPointer, taking ownership of it. The old content of this DeepCopyPointer is deleted
Definition at line 50 of file DeepCopyPointer.h.
References DeepCopyPointer< T >::theData.
|
private |
Definition at line 77 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().