A simple shared_ptr class. More...
#include <shared_ptr.h>
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) |
A simple shared_ptr class.
Definition at line 11 of file shared_ptr.h.
Dv::shared_ptr< T >::shared_ptr | ( | T * | t = 0 |
) | [inline, explicit] |
Definition at line 13 of file shared_ptr.h.
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_.
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_.
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_.
unsigned int* Dv::shared_ptr< T >::n | ( | ) | const [inline] |
Definition at line 30 of file shared_ptr.h.
References Dv::shared_ptr< T >::cnt_.
T* Dv::shared_ptr< T >::ptr | ( | ) | const [inline] |
Definition at line 32 of file shared_ptr.h.
References Dv::shared_ptr< T >::ptr_.
Dv::shared_ptr< T >::operator bool | ( | ) | const [inline] |
Definition at line 33 of file shared_ptr.h.
References Dv::shared_ptr< T >::ptr_.
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_.
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_.
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_.
Dv::shared_ptr< T >::operator shared_ptr< X > | ( | ) | const [inline] |
Definition at line 81 of file shared_ptr.h.
bool operator== | ( | const shared_ptr< T > & | p1, | |
const shared_ptr< T > & | p2 | |||
) | [friend] |
Definition at line 60 of file shared_ptr.h.
bool operator!= | ( | const shared_ptr< T > & | p1, | |
const shared_ptr< T > & | p2 | |||
) | [friend] |
Definition at line 65 of file shared_ptr.h.
bool operator> | ( | const shared_ptr< T > & | p1, | |
const shared_ptr< T > & | p2 | |||
) | [friend] |
Definition at line 70 of file shared_ptr.h.
bool operator< | ( | const shared_ptr< T > & | p1, | |
const shared_ptr< T > & | p2 | |||
) | [friend] |
Definition at line 75 of file shared_ptr.h.
T* Dv::shared_ptr< T >::ptr_ [private] |
Definition at line 84 of file shared_ptr.h.
Referenced by Dv::shared_ptr< T >::operator bool(), Dv::shared_ptr< T >::operator*(), Dv::shared_ptr< T >::operator->(), Dv::shared_ptr< T >::operator=(), Dv::shared_ptr< T >::ptr(), and Dv::shared_ptr< T >::~shared_ptr().
unsigned int* Dv::shared_ptr< T >::cnt_ [private] |
Definition at line 85 of file shared_ptr.h.
Referenced by Dv::shared_ptr< T >::n(), Dv::shared_ptr< T >::operator=(), Dv::shared_ptr< T >::shared_ptr(), and Dv::shared_ptr< T >::~shared_ptr().
dvutil-1.0.10 | [ 5 December, 2009] |