Smart Pointers

smart_ptr_base Class Template Reference

#include <smart_ptr.hpp>

Inheritance diagram for smart_ptr_base:

smart_ptr List of all members.

Detailed Description

template<class T, class ALLOCATOR_POLICY>
class smart_ptr_base< T, ALLOCATOR_POLICY >

smart_ptr_base is the base class for smart_ptr. The main purpose for the smart_ptr_base is to make smart_ptr exception safe. When an exception is thrown, only objects that have been constructed gets their destructor's called. A base class gets constructed before the derived class members. If the base class gets constructed, and a the derived class member throws an exception, the base class destructor is guaranteed to be called. If no exception is thrown, than the base class destructor does nothing, because smart_ptr will nullify the pointer in it's destructor. This insures that a memory leak does not occur if smart_ptr's members throw an exception in their constructor.

Definition at line 993 of file smart_ptr.hpp.

Protected Types

typedef T *(* clone_fct_Type )(const T *, bool, void *, ALLOCATOR_POLICY *, void *)

Protected Member Functions

 smart_ptr_base (T *type, clone_fct_Type clone_fct)
 ~smart_ptr_base () throw ()

Protected Attributes

T * m_type
clone_fct_Type m_clone_fct


The documentation for this class was generated from the following file:
Generated on Wed Mar 29 21:58:59 2006 for Smart Pointers by  doxygen 1.4.6.Axter [Axter-Extended-Version]