OpenDDS::DCPS::container_supported_unique_ptr< T > Class Template Reference

#include <unique_ptr.h>

Collaboration diagram for OpenDDS::DCPS::container_supported_unique_ptr< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 container_supported_unique_ptr ()
 container_supported_unique_ptr (T *p)
template<typename U >
 container_supported_unique_ptr (unique_ptr< U > p)
template<typename U >
 container_supported_unique_ptr (const container_supported_unique_ptr< U > &other)
 container_supported_unique_ptr (const container_supported_unique_ptr &b)
 ~container_supported_unique_ptr ()
template<typename U >
void reset (U *p)
void reset (T *p=0)
container_supported_unique_ptroperator= (const container_supported_unique_ptr &b)
template<class U >
container_supported_unique_ptroperator= (const container_supported_unique_ptr< U > &b)
template<typename U >
container_supported_unique_ptroperator= (unique_ptr< U > b)
void swap (container_supported_unique_ptr &rhs)
T * operator-> () const
T & operator* () const
T * get () const
T * release ()
 operator bool () const
bool operator== (const container_supported_unique_ptr &rhs) const
bool operator!= (const container_supported_unique_ptr &rhs) const
bool operator< (const container_supported_unique_ptr &rhs) const

Private Member Functions

void bump_up ()
void bump_down ()

Private Attributes

T * ptr_
 The actual "unsmart" pointer to the T object.

Detailed Description

template<typename T>
class OpenDDS::DCPS::container_supported_unique_ptr< T >

Definition at line 155 of file unique_ptr.h.


Constructor & Destructor Documentation

Definition at line 159 of file unique_ptr.h.

00160     : ptr_(0)
00161   {}

template<typename T>
OpenDDS::DCPS::container_supported_unique_ptr< T >::container_supported_unique_ptr ( T *  p  )  [inline, explicit]

Definition at line 163 of file unique_ptr.h.

00164     : ptr_(p)
00165   {
00166   }

template<typename T>
template<typename U >
OpenDDS::DCPS::container_supported_unique_ptr< T >::container_supported_unique_ptr ( unique_ptr< U >  p  )  [inline]

Definition at line 169 of file unique_ptr.h.

00170     : ptr_(p.release())
00171   {
00172   }

template<typename T>
template<typename U >
OpenDDS::DCPS::container_supported_unique_ptr< T >::container_supported_unique_ptr ( const container_supported_unique_ptr< U > &  other  )  [inline]

Definition at line 175 of file unique_ptr.h.

00176     : ptr_(other.get())
00177   {
00178     this->bump_up();
00179   }

Definition at line 181 of file unique_ptr.h.

00182     : ptr_(b.ptr_)
00183   {
00184     this->bump_up();
00185   }

Definition at line 187 of file unique_ptr.h.

00188   {
00189     this->bump_down();
00190   }


Member Function Documentation

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::bump_down (  )  [inline, private]

Definition at line 286 of file unique_ptr.h.

Referenced by OpenDDS::DCPS::container_supported_unique_ptr< DCPS_IR_Subscription >::~container_supported_unique_ptr().

00287   {
00288     if (this->ptr_ != 0) {
00289       this->ptr_->_remove_ref();
00290       this->ptr_ = 0;
00291     }
00292   }

Here is the caller graph for this function:

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::bump_up (  )  [inline, private]

Definition at line 279 of file unique_ptr.h.

Referenced by OpenDDS::DCPS::container_supported_unique_ptr< DCPS_IR_Subscription >::container_supported_unique_ptr().

00280   {
00281     if (this->ptr_ != 0) {
00282       this->ptr_->_add_ref();
00283     }
00284   }

Here is the caller graph for this function:

template<typename T>
T* OpenDDS::DCPS::container_supported_unique_ptr< T >::get ( void   )  const [inline]
template<typename T>
OpenDDS::DCPS::container_supported_unique_ptr< T >::operator bool ( void   )  const [inline]

Definition at line 257 of file unique_ptr.h.

00258   {
00259     return get() != 0;
00260   }

template<typename T>
bool OpenDDS::DCPS::container_supported_unique_ptr< T >::operator!= ( const container_supported_unique_ptr< T > &  rhs  )  const [inline]

Definition at line 267 of file unique_ptr.h.

00268   {
00269     return get() != rhs.get();
00270   }

template<typename T>
T& OpenDDS::DCPS::container_supported_unique_ptr< T >::operator* ( void   )  const [inline]

Definition at line 240 of file unique_ptr.h.

00241   {
00242     return *this->ptr_;
00243   }

template<typename T>
T* OpenDDS::DCPS::container_supported_unique_ptr< T >::operator-> ( void   )  const [inline]

Definition at line 235 of file unique_ptr.h.

00236   {
00237     return this->ptr_;
00238   }

template<typename T>
bool OpenDDS::DCPS::container_supported_unique_ptr< T >::operator< ( const container_supported_unique_ptr< T > &  rhs  )  const [inline]

Definition at line 272 of file unique_ptr.h.

00273   {
00274     return get() < rhs.get();
00275   }

template<typename T>
template<typename U >
container_supported_unique_ptr& OpenDDS::DCPS::container_supported_unique_ptr< T >::operator= ( unique_ptr< U >  b  )  [inline]

Definition at line 221 of file unique_ptr.h.

00222   {
00223     container_supported_unique_ptr<T> tmp(b.release());
00224     swap(tmp);
00225     return *this;
00226   }

template<typename T>
template<class U >
container_supported_unique_ptr& OpenDDS::DCPS::container_supported_unique_ptr< T >::operator= ( const container_supported_unique_ptr< U > &  b  )  [inline]

Definition at line 213 of file unique_ptr.h.

00214   {
00215     container_supported_unique_ptr<T> tmp(b);
00216     swap(tmp);
00217     return *this;
00218   }

template<typename T>
container_supported_unique_ptr& OpenDDS::DCPS::container_supported_unique_ptr< T >::operator= ( const container_supported_unique_ptr< T > &  b  )  [inline]

Definition at line 205 of file unique_ptr.h.

00206   {
00207     container_supported_unique_ptr tmp(b);
00208     swap(tmp);
00209     return *this;
00210   }

template<typename T>
bool OpenDDS::DCPS::container_supported_unique_ptr< T >::operator== ( const container_supported_unique_ptr< T > &  rhs  )  const [inline]

Definition at line 262 of file unique_ptr.h.

00263   {
00264     return get() == rhs.get();
00265   }

template<typename T>
T* OpenDDS::DCPS::container_supported_unique_ptr< T >::release ( void   )  [inline]

Definition at line 250 of file unique_ptr.h.

00251   {
00252     T* retval = this->ptr_;
00253     this->ptr_ = 0;
00254     return retval;
00255   }

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::reset ( T *  p = 0  )  [inline]

Definition at line 199 of file unique_ptr.h.

00200   {
00201     container_supported_unique_ptr tmp(p);
00202     swap(tmp);
00203   }

template<typename T>
template<typename U >
void OpenDDS::DCPS::container_supported_unique_ptr< T >::reset ( U *  p  )  [inline]

Definition at line 193 of file unique_ptr.h.

00194   {
00195     container_supported_unique_ptr tmp(p);
00196     swap(tmp);
00197   }

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::swap ( container_supported_unique_ptr< T > &  rhs  )  [inline]

Definition at line 228 of file unique_ptr.h.

Referenced by OpenDDS::DCPS::container_supported_unique_ptr< DCPS_IR_Subscription >::operator=(), OpenDDS::DCPS::container_supported_unique_ptr< DCPS_IR_Subscription >::reset(), and OpenDDS::DCPS::swap().

00229   {
00230     T* t = this->ptr_;
00231     this->ptr_ = rhs.ptr_;
00232     rhs.ptr_ = t;
00233   }

Here is the caller graph for this function:


Member Data Documentation

template<typename T>
T* OpenDDS::DCPS::container_supported_unique_ptr< T >::ptr_ [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1