This is Unofficial EPICS BASE Doxygen Site
autoPtrFreeList< T, N, MUTEX > Class Template Reference

#include "autoPtrFreeList.h"

Public Member Functions

 autoPtrFreeList (tsFreeList< T, N, MUTEX > &, T *)
 
 ~autoPtrFreeList ()
 
T & operator* () const
 
T * operator-> () const
 
T * get () const
 
T * release ()
 

Detailed Description

template<class T, unsigned N = 0x400, class MUTEX = epicsMutex>
class autoPtrFreeList< T, N, MUTEX >

Definition at line 32 of file autoPtrFreeList.h.

Constructor & Destructor Documentation

template<class T , unsigned N, class MUTEX >
autoPtrFreeList< T, N, MUTEX >::autoPtrFreeList ( tsFreeList< T, N, MUTEX > &  freeListIn,
T *  pIn 
)
inline

Definition at line 49 of file autoPtrFreeList.h.

50  :
51  p ( pIn ), freeList ( freeListIn ) {}
template<class T , unsigned N, class MUTEX >
autoPtrFreeList< T, N, MUTEX >::~autoPtrFreeList ( )
inline

Definition at line 54 of file autoPtrFreeList.h.

55 {
56  if ( this->p ) {
57  this->p->~T();
58  // its probably a good idea to require that the class has placement delete
59  // by calling it during cleanup if the compiler supports it
60 # if defined ( CXX_PLACEMENT_DELETE )
61  T::operator delete ( this->p, this->freeList );
62 # else
63  this->freeList.release ( this->p );
64 # endif
65  }
66 }

Member Function Documentation

template<class T , unsigned N, class MUTEX >
T * autoPtrFreeList< T, N, MUTEX >::get ( ) const
inline

Definition at line 81 of file autoPtrFreeList.h.

82 {
83  return this->p;
84 }
template<class T , unsigned N, class MUTEX >
T & autoPtrFreeList< T, N, MUTEX >::operator* ( ) const
inline

Definition at line 69 of file autoPtrFreeList.h.

70 {
71  return * this->p;
72 }
template<class T , unsigned N, class MUTEX >
T * autoPtrFreeList< T, N, MUTEX >::operator-> ( ) const
inline

Definition at line 75 of file autoPtrFreeList.h.

76 {
77  return this->p;
78 }
template<class T , unsigned N, class MUTEX >
T * autoPtrFreeList< T, N, MUTEX >::release ( )
inline

Definition at line 87 of file autoPtrFreeList.h.

88 {
89  T *pTmp = this->p;
90  this->p = 0;
91  return pTmp;
92 }

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