Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Namespace Members   Compound Members   File Members  

arg::body_part_ptr Class Reference

A const-qualified smart pointer that takes ownership of the referenced object and implements copy construction/assignment by copying the referenced object. More...

#include <arg_deep_copy.h>

List of all members.


Public Members

 body_part_ptr ()
Default 0 initialisation.

explicit body_part_ptr (pointee_type* p) throw ()
Construct owining p.

const pointee_type* get () const
Return contents (const).

pointee_type* get ()
Return contents (non-const).

const pointee_type* operator-> () const
Indirection operator(const).

pointee_type* operator-> ()
Indirection operator (non-const).

const pointee_type& operator * () const
Dereference operator(const).

pointee_type& operator * ()
Dereference operator (non-const).

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<pointee_type>& with) throw ()
Swaps contents with "with".

 operator deep_copy_ptr ()
Conversion to a non-const deep_copy_ptr.


Detailed Description

template<class pointee_type> class arg::body_part_ptr

A const-qualified smart pointer that takes ownership of the referenced object and implements copy construction/assignment by copying the referenced object.

(A non-const body_part_ptr behaves as a deep_copy_ptr while a const one provides const access to the referenced object.)

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.

Author(s):
Alan Griffiths

Member Function Documentation

template<class pointee_type>
arg::body_part_ptr<pointee_type>::body_part_ptr<pointee_type> ()

Default 0 initialisation.

template<class pointee_type>
explicit arg::body_part_ptr<pointee_type>::body_part_ptr<pointee_type> (pointee_type * p) throw ()

Construct owining p.

template<class pointee_type>
const pointee_type * arg::body_part_ptr<pointee_type>::get () const [inline]

Return contents (const).

template<class pointee_type>
pointee_type * arg::body_part_ptr<pointee_type>::get () [inline]

Return contents (non-const).

template<class pointee_type>
const pointee_type * arg::body_part_ptr<pointee_type>::operator-> () const [inline]

Indirection operator(const).

template<class pointee_type>
pointee_type * arg::body_part_ptr<pointee_type>::operator-> () [inline]

Indirection operator (non-const).

template<class pointee_type>
const pointee_type & arg::body_part_ptr<pointee_type>::operator * () const [inline]

Dereference operator(const).

template<class pointee_type>
pointee_type & arg::body_part_ptr<pointee_type>::operator * () [inline]

Dereference operator (non-const).

template<class pointee_type>
pointee_type * arg::body_part_ptr<pointee_type>::release () [inline]

Release ownership (and becomes 0).

template<class pointee_type>
void arg::body_part_ptr<pointee_type>::reset (pointee_type * p) throw () [inline]

Delete existing contents (and take ownership of p).

template<class pointee_type>
void arg::body_part_ptr<pointee_type>::swap (deep_copy_ptr<pointee_type>& with) throw () [inline]

Swaps contents with "with".

template<class pointee_type>
arg::body_part_ptr<pointee_type>::operator deep_copy_ptr<pointee_type>& () [inline]

Conversion to a non-const deep_copy_ptr.


The documentation for this class was generated from the following file:
Copyright 1999-2000 Alan Griffiths