#include <arg_deep_copy.h>
Public Members | |||
deep_copy_ptr () | |||
"0 initialised" pointer. | |||
explicit | deep_copy_ptr (pointee_type* p) throw () | ||
Takes ownership of p. | |||
deep_copy_ptr (const deep_copy_ptr& rhs) | |||
Creates a "deep copy" of rhs. | |||
~deep_copy_ptr () throw () | |||
pointee_type* | get () const | ||
Returns contents. | |||
pointee_type* | operator-> () const | ||
Indirection operator. | |||
pointee_type& | operator * () const | ||
Dereference operator. | |||
deep_copy_ptr& | operator= (const deep_copy_ptr& rhs) | ||
Becomes a "deep copy" of rhs. | |||
pointee_type* | release () | ||
Release ownership (and becomes 0). | |||
void | reset (pointee_type* p) throw () | ||
Delete existing contents (and take ownership of p). | |||
void | swap (deep_copy_ptr& with) throw () | ||
Swaps contents with "with". |
The correct algorithm for copying is resolved by using the arg::deep_copy() template. This means that the referenced object will be copied using the copy construction unless it is tagged by inheriting from arg::cloneable or an overload of arg::deep_copy() is provided.
All methods support the strong exception safety guarantee with the proviso that the referenced type must have a non-throwing destructor.
template<class pointee_type> arg::deep_copy_ptr<pointee_type>::deep_copy_ptr<pointee_type> () [inline]
|
"0 initialised" pointer.
template<class pointee_type> arg::deep_copy_ptr<pointee_type>::deep_copy_ptr<pointee_type> (pointee_type * p) throw () [inline]
|
Takes ownership of p.
template<class pointee_type> arg::deep_copy_ptr<pointee_type>::deep_copy_ptr<pointee_type> (const deep_copy_ptr<pointee_type> & rhs) [inline]
|
Creates a "deep copy" of rhs.
template<class pointee_type> arg::deep_copy_ptr<pointee_type>::~deep_copy_ptr<pointee_type> () throw () [inline]
|
template<class pointee_type> pointee_type * arg::deep_copy_ptr<pointee_type>::get () const |
Returns contents.
template<class pointee_type> pointee_type * arg::deep_copy_ptr<pointee_type>::operator-> () const [inline]
|
Indirection operator.
template<class pointee_type> pointee_type & arg::deep_copy_ptr<pointee_type>::operator * () const [inline]
|
Dereference operator.
template<class pointee_type> deep_copy_ptr<pointee_type>& arg::deep_copy_ptr<pointee_type>::operator= (const deep_copy_ptr<pointee_type> & rhs) [inline]
|
Becomes a "deep copy" of rhs.
template<class pointee_type> pointee_type * arg::deep_copy_ptr<pointee_type>::release () [inline]
|
Release ownership (and becomes 0).
template<class pointee_type> void arg::deep_copy_ptr<pointee_type>::reset (pointee_type * p) throw () [inline]
|
Delete existing contents (and take ownership of p).
template<class pointee_type> void arg::deep_copy_ptr<pointee_type>::swap (deep_copy_ptr<pointee_type> & with) throw () [inline]
|
Swaps contents with "with".