OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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]

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. More...
 

Detailed Description

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

Definition at line 154 of file unique_ptr.h.

Constructor & Destructor Documentation

◆ container_supported_unique_ptr() [1/5]

Definition at line 158 of file unique_ptr.h.

159  : ptr_(0)
160  {}
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ container_supported_unique_ptr() [2/5]

template<typename T>
OpenDDS::DCPS::container_supported_unique_ptr< T >::container_supported_unique_ptr ( T *  p)
inlineexplicit

Definition at line 162 of file unique_ptr.h.

163  : ptr_(p)
164  {
165  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ container_supported_unique_ptr() [3/5]

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 168 of file unique_ptr.h.

169  : ptr_(p.release())
170  {
171  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ container_supported_unique_ptr() [4/5]

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 174 of file unique_ptr.h.

175  : ptr_(other.get())
176  {
177  bump_up();
178  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ container_supported_unique_ptr() [5/5]

Definition at line 180 of file unique_ptr.h.

181  : ptr_(b.ptr_)
182  {
183  bump_up();
184  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ ~container_supported_unique_ptr()

Definition at line 186 of file unique_ptr.h.

187  {
188  bump_down();
189  }

Member Function Documentation

◆ bump_down()

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::bump_down ( )
inlineprivate

Definition at line 285 of file unique_ptr.h.

286  {
287  if (ptr_ != 0) {
288  ptr_->_remove_ref();
289  ptr_ = 0;
290  }
291  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ bump_up()

template<typename T>
void OpenDDS::DCPS::container_supported_unique_ptr< T >::bump_up ( )
inlineprivate

Definition at line 278 of file unique_ptr.h.

279  {
280  if (ptr_ != 0) {
281  ptr_->_add_ref();
282  }
283  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ get()

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

◆ operator bool()

template<typename T>
OpenDDS::DCPS::container_supported_unique_ptr< T >::operator bool ( ) const
inline

Definition at line 256 of file unique_ptr.h.

257  {
258  return get() != 0;
259  }

◆ operator!=()

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

Definition at line 266 of file unique_ptr.h.

267  {
268  return get() != rhs.get();
269  }

◆ operator*()

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

Definition at line 239 of file unique_ptr.h.

240  {
241  return *ptr_;
242  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ operator->()

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

Definition at line 234 of file unique_ptr.h.

235  {
236  return ptr_;
237  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ operator<()

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

Definition at line 271 of file unique_ptr.h.

272  {
273  return get() < rhs.get();
274  }

◆ operator=() [1/3]

Definition at line 204 of file unique_ptr.h.

205  {
207  swap(tmp);
208  return *this;
209  }
void swap(container_supported_unique_ptr &rhs)
Definition: unique_ptr.h:227

◆ operator=() [2/3]

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 212 of file unique_ptr.h.

213  {
214  container_supported_unique_ptr<T> tmp(b);
215  swap(tmp);
216  return *this;
217  }
void swap(container_supported_unique_ptr &rhs)
Definition: unique_ptr.h:227

◆ operator=() [3/3]

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 220 of file unique_ptr.h.

221  {
222  container_supported_unique_ptr<T> tmp(b.release());
223  swap(tmp);
224  return *this;
225  }
void swap(container_supported_unique_ptr &rhs)
Definition: unique_ptr.h:227

◆ operator==()

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

Definition at line 261 of file unique_ptr.h.

262  {
263  return get() == rhs.get();
264  }

◆ release()

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

Definition at line 249 of file unique_ptr.h.

250  {
251  T* retval = ptr_;
252  ptr_ = 0;
253  return retval;
254  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

◆ reset() [1/2]

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

Definition at line 192 of file unique_ptr.h.

193  {
195  swap(tmp);
196  }
void swap(container_supported_unique_ptr &rhs)
Definition: unique_ptr.h:227

◆ reset() [2/2]

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

Definition at line 198 of file unique_ptr.h.

199  {
201  swap(tmp);
202  }
void swap(container_supported_unique_ptr &rhs)
Definition: unique_ptr.h:227

◆ swap()

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

Definition at line 227 of file unique_ptr.h.

Referenced by OpenDDS::DCPS::swap().

228  {
229  T* t = ptr_;
230  ptr_ = rhs.ptr_;
231  rhs.ptr_ = t;
232  }
T * ptr_
The actual "unsmart" pointer to the T object.
Definition: unique_ptr.h:294

Member Data Documentation

◆ ptr_

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

The actual "unsmart" pointer to the T object.

Definition at line 294 of file unique_ptr.h.

Referenced by OpenDDS::DCPS::container_supported_unique_ptr< OpenDDS::DCPS::DataReaderImpl_T::MessageTypeWithAllocator >::swap().


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