_shared_ptr Class Template Reference

#include <shared_ptr.h>

Inheritance diagram for _shared_ptr:

Inheritance graph
[legend]
Collaboration diagram for _shared_ptr:

Collaboration graph
[legend]
List of all members.

Public Types

typedef bool(_shared_ptr::* implicit_bool_type )() const

Public Member Functions

 _shared_ptr (T *p=0)
 _shared_ptr (const _shared_ptr< T > &s)
 ~_shared_ptr ()
const _shared_ptr< T > & operator= (const _shared_ptr< T > &s)
bool operator!= (const T *p) const
bool operator== (const T *p) const
bool operator!= (const _shared_ptr &p) const
bool operator== (const _shared_ptr &p) const
bool operator! () const
 operator implicit_bool_type () const

Protected Member Functions

void delete_this ()
bool valid () const
 false if the pointer is null.
UINT use_count () const
bool unique () const

Protected Attributes

T * ptr
UINTpcnt

Detailed Description

template<typename T>
class _shared_ptr< T >

Warning:
Do not use this class. Use const_shared_ptr or var_shared_ptr.
Note:
I guess it is not thread-safe.

See boost.org for a better and more complicated implementation.

Definition at line 16 of file shared_ptr.h.


Member Typedef Documentation

typedef bool(_shared_ptr::* implicit_bool_type)() const
 

Definition at line 57 of file shared_ptr.h.


Constructor & Destructor Documentation

_shared_ptr T *  p = 0  )  [inline, explicit]
 

Definition at line 38 of file shared_ptr.h.

References pcnt, and valid().

_shared_ptr const _shared_ptr< T > &  s  )  [inline]
 

Definition at line 40 of file shared_ptr.h.

References valid().

~_shared_ptr  )  [inline]
 

Definition at line 42 of file shared_ptr.h.

References delete_this().


Member Function Documentation

void delete_this  )  [inline, protected]
 

Definition at line 21 of file shared_ptr.h.

References pcnt, ptr, and valid().

Referenced by operator=(), and ~_shared_ptr().

operator implicit_bool_type  )  const [inline]
 

Definition at line 58 of file shared_ptr.h.

References ptr, and valid().

bool operator!  )  const [inline]
 

Definition at line 55 of file shared_ptr.h.

References ptr.

bool operator!= const _shared_ptr< T > &  p  )  const [inline]
 

Definition at line 53 of file shared_ptr.h.

References ptr.

bool operator!= const T *  p  )  const [inline]
 

Definition at line 51 of file shared_ptr.h.

References ptr.

const _shared_ptr<T>& operator= const _shared_ptr< T > &  s  )  [inline]
 

Definition at line 44 of file shared_ptr.h.

References delete_this(), pcnt, ptr, and valid().

Referenced by var_shared_ptr::operator=(), and const_shared_ptr::operator=().

bool operator== const _shared_ptr< T > &  p  )  const [inline]
 

Definition at line 54 of file shared_ptr.h.

References ptr.

bool operator== const T *  p  )  const [inline]
 

Definition at line 52 of file shared_ptr.h.

References ptr.

bool unique  )  const [inline, protected]
 

Definition at line 35 of file shared_ptr.h.

References use_count().

UINT use_count  )  const [inline, protected]
 

Definition at line 34 of file shared_ptr.h.

References pcnt, and valid().

Referenced by unique().

bool valid  )  const [inline, protected]
 

false if the pointer is null.

Definition at line 29 of file shared_ptr.h.

References pcnt, and ptr.

Referenced by _shared_ptr(), delete_this(), var_shared_ptr::operator *(), const_shared_ptr::operator *(), operator implicit_bool_type(), var_shared_ptr::operator->(), const_shared_ptr::operator->(), operator=(), and use_count().


Member Data Documentation

UINT* pcnt [protected]
 

Definition at line 19 of file shared_ptr.h.

Referenced by _shared_ptr(), delete_this(), operator=(), use_count(), and valid().

T* ptr [protected]
 

Definition at line 18 of file shared_ptr.h.

Referenced by delete_this(), var_shared_ptr::operator *(), const_shared_ptr::operator *(), operator implicit_bool_type(), operator!(), operator!=(), var_shared_ptr::operator->(), const_shared_ptr::operator->(), operator=(), operator==(), and valid().


The documentation for this class was generated from the following file:
Generated on Wed Nov 8 08:16:24 2006 for LEMGA by  doxygen 1.4.6