Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cbThreadPool::CountedPtr< T > Class Template Reference

Josuttis' implementation of CountedPtr. More...

Collaboration diagram for cbThreadPool::CountedPtr< T >:

Public Member Functions

 CountedPtr (T *p=nullptr)
 
 CountedPtr (const CountedPtr< T > &p)
 
 ~CountedPtr ()
 
CountedPtr< T > & operator= (const CountedPtr< T > &p)
 assignment (unshare old and share new value) More...
 
T & operator* () const
 access the value to which the pointer refers More...
 
T * operator-> () const
 

Private Member Functions

void dispose ()
 decrease the counter, and if it get 0, destroy both counter and value More...
 

Private Attributes

T * ptr
 
long * count
 

Detailed Description

template<typename T>
class cbThreadPool::CountedPtr< T >

Josuttis' implementation of CountedPtr.

Definition at line 95 of file cbthreadpool.h.

Constructor & Destructor Documentation

◆ CountedPtr() [1/2]

template<typename T>
cbThreadPool::CountedPtr< T >::CountedPtr ( T *  p = nullptr)
inlineexplicit

Definition at line 104 of file cbthreadpool.h.

◆ CountedPtr() [2/2]

template<typename T>
cbThreadPool::CountedPtr< T >::CountedPtr ( const CountedPtr< T > &  p)
inline

Definition at line 106 of file cbthreadpool.h.

◆ ~CountedPtr()

template<typename T>
cbThreadPool::CountedPtr< T >::~CountedPtr ( )
inline

Definition at line 112 of file cbthreadpool.h.

Member Function Documentation

◆ dispose()

template<typename T>
void cbThreadPool::CountedPtr< T >::dispose ( )
inlineprivate

decrease the counter, and if it get 0, destroy both counter and value

Definition at line 143 of file cbthreadpool.h.

◆ operator*()

template<typename T>
T& cbThreadPool::CountedPtr< T >::operator* ( ) const
inline

access the value to which the pointer refers

Definition at line 131 of file cbthreadpool.h.

◆ operator->()

template<typename T>
T* cbThreadPool::CountedPtr< T >::operator-> ( ) const
inline

Definition at line 136 of file cbthreadpool.h.

◆ operator=()

template<typename T>
CountedPtr<T>& cbThreadPool::CountedPtr< T >::operator= ( const CountedPtr< T > &  p)
inline

assignment (unshare old and share new value)

Definition at line 117 of file cbthreadpool.h.

Member Data Documentation

◆ count

template<typename T>
long* cbThreadPool::CountedPtr< T >::count
private

Definition at line 99 of file cbthreadpool.h.

Referenced by cbThreadPool::CountedPtr< wxSemaphore >::operator=().

◆ ptr

template<typename T>
T* cbThreadPool::CountedPtr< T >::ptr
private

Definition at line 98 of file cbthreadpool.h.

Referenced by cbThreadPool::CountedPtr< wxSemaphore >::operator=().


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