Dv::shared_ptr< T > Class Template Reference

A simple shared_ptr class. More...

#include <shared_ptr.h>

List of all members.

Public Member Functions

 shared_ptr (T *t=0)
 shared_ptr (const shared_ptr< T > &r)
template<typename X >
 shared_ptr (const shared_ptr< X > &r)
 ~shared_ptr ()
unsigned int * n () const
T * ptr () const
 operator bool () const
T * operator-> () const throw (std::logic_error)
T & operator* () const throw (std::logic_error)
shared_ptr< T > & operator= (const shared_ptr< T > &r)
template<typename X >
 operator shared_ptr< X > () const

Private Attributes

T * ptr_
unsigned int * cnt_

Friends

bool operator== (const shared_ptr< T > &p1, const shared_ptr< T > &p2)
bool operator!= (const shared_ptr< T > &p1, const shared_ptr< T > &p2)
bool operator> (const shared_ptr< T > &p1, const shared_ptr< T > &p2)
bool operator< (const shared_ptr< T > &p1, const shared_ptr< T > &p2)

Detailed Description

template<class T>
class Dv::shared_ptr< T >

A simple shared_ptr class.

Definition at line 11 of file shared_ptr.h.


Constructor & Destructor Documentation

template<class T>
Dv::shared_ptr< T >::shared_ptr ( T *  t = 0  )  [inline, explicit]

Definition at line 13 of file shared_ptr.h.

template<class T>
Dv::shared_ptr< T >::shared_ptr ( const shared_ptr< T > &  r  )  [inline]

Definition at line 15 of file shared_ptr.h.

References Dv::shared_ptr< T >::cnt_.

template<class T>
template<typename X >
Dv::shared_ptr< T >::shared_ptr ( const shared_ptr< X > &  r  )  [inline, explicit]

Definition at line 20 of file shared_ptr.h.

References Dv::shared_ptr< T >::cnt_.

template<class T>
Dv::shared_ptr< T >::~shared_ptr (  )  [inline]

Definition at line 23 of file shared_ptr.h.

References Dv::shared_ptr< T >::cnt_, and Dv::shared_ptr< T >::ptr_.


Member Function Documentation

template<class T>
unsigned int* Dv::shared_ptr< T >::n (  )  const [inline]

Definition at line 30 of file shared_ptr.h.

References Dv::shared_ptr< T >::cnt_.

template<class T>
T* Dv::shared_ptr< T >::ptr (  )  const [inline]

Definition at line 32 of file shared_ptr.h.

References Dv::shared_ptr< T >::ptr_.

template<class T>
Dv::shared_ptr< T >::operator bool (  )  const [inline]

Definition at line 33 of file shared_ptr.h.

References Dv::shared_ptr< T >::ptr_.

template<class T>
T* Dv::shared_ptr< T >::operator-> (  )  const throw (std::logic_error) [inline]

Definition at line 35 of file shared_ptr.h.

References FUNCTION_S, and Dv::shared_ptr< T >::ptr_.

template<class T>
T& Dv::shared_ptr< T >::operator* (  )  const throw (std::logic_error) [inline]

Definition at line 41 of file shared_ptr.h.

References FUNCTION_S, and Dv::shared_ptr< T >::ptr_.

template<class T>
shared_ptr<T>& Dv::shared_ptr< T >::operator= ( const shared_ptr< T > &  r  )  [inline]

Definition at line 47 of file shared_ptr.h.

References Dv::shared_ptr< T >::cnt_, and Dv::shared_ptr< T >::ptr_.

template<class T>
template<typename X >
Dv::shared_ptr< T >::operator shared_ptr< X > (  )  const [inline]

Definition at line 81 of file shared_ptr.h.


Friends And Related Function Documentation

template<class T>
bool operator== ( const shared_ptr< T > &  p1,
const shared_ptr< T > &  p2 
) [friend]

Definition at line 60 of file shared_ptr.h.

template<class T>
bool operator!= ( const shared_ptr< T > &  p1,
const shared_ptr< T > &  p2 
) [friend]

Definition at line 65 of file shared_ptr.h.

template<class T>
bool operator> ( const shared_ptr< T > &  p1,
const shared_ptr< T > &  p2 
) [friend]

Definition at line 70 of file shared_ptr.h.

template<class T>
bool operator< ( const shared_ptr< T > &  p1,
const shared_ptr< T > &  p2 
) [friend]

Definition at line 75 of file shared_ptr.h.


Member Data Documentation

template<class T>
T* Dv::shared_ptr< T >::ptr_ [private]
template<class T>
unsigned int* Dv::shared_ptr< T >::cnt_ [private]

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

dvutil-1.0.10 [ 5 December, 2009]