shared_ptr Class Template Reference
[Smart Pointers library]

#include <stlsoft/smartptr/shared_ptr.hpp>

List of all members.


Detailed Description

template<typename T>
class stlsoft::shared_ptr< T >

This class enables sharing of arbitrary types.

Remarks:
The functionality is based in concept on the Boost shared_ptr, which is set for inclusion in the next instalment of the C++ standard. The implementation is entirely original.
Parameters:
T The value type

Public Types

Types
typedef T value_type
typedef value_type * pointer
typedef value_type const * const_pointer
typedef value_type & reference
typedef value_type const & const_reference
typedef shared_ptr< T > class_type
typedef pointer resource_type
typedef const_pointer const_resource_type

Public Member Functions

Construction
 shared_ptr ()
 shared_ptr (T *p)
 shared_ptr (class_type const &rhs)
template<typename T2>
 shared_ptr (shared_ptr< T2 > const &rhs)
 ~shared_ptr () throw ()
class_typeoperator= (class_type const &rhs)
template<typename T2>
class_typeoperator= (shared_ptr< T2 > const &rhs)
Operations
void close ()
pointer detach ()
void swap (class_type &rhs)
Accessors
const_pointer operator-> () const
pointer operator-> ()
pointer get () const
const_reference operator* () const
reference operator* ()
Attributes
long count () const
long use_count () const
 Returns count().

Constructor & Destructor Documentation

shared_ptr ( T *  p  )  [inline, explicit]

Note:
If exception handling is not enabled and memory cannot be acquired to hold the sharing resource the object represented by p will be deleted, and get() will return NULL
Exceptions:
std::bad_alloc If exception support is enabled, an instance of std::bad_alloc will be thrown if memory cannot be acquired to hold the sharing resource. In this case, the object represented by p will be deleted

References STLSOFT_ASSERT.


Member Function Documentation

long use_count (  )  const [inline]

Returns count().

References STLSOFT_ASSERT.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:56 2010 for STLSoft by  doxygen 1.5.6