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

Queue class that provides a means to reset the underlying ACE_Allocator. More...

#include <DurabilityQueue.h>

List of all members.

Public Member Functions

 DurabilityQueue (ACE_Allocator *allocator)
 DurabilityQueue (DurabilityQueue< T > const &rhs)
 ~DurabilityQueue ()
void operator= (DurabilityQueue< T > const &rhs)
void set_allocator (ACE_Allocator *allocator)
 Reset allocator.
void swap (DurabilityQueue< T > &rhs)
typedef OPENDDS_VECTOR (OPENDDS_STRING) fs_path_t

Public Attributes

fs_path_t fs_path_


Detailed Description

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

Queue class that provides a means to reset the underlying ACE_Allocator.

This class only exists to provide a means to reset the allocator used by the ACE_Unbounded_Queue base class. It has a specific use case, namely to correctly support instances created by a persistent allocator. The allocator address may change between process runs, meaning the allocator address stored in the persistent ACE_Unbounded_Queue instance will be invalid. Use the set_allocator() method to reset the allocator address before performing any operations that will require use of the allocator (e.g. enqueuing new items).

Definition at line 36 of file DurabilityQueue.h.


Constructor & Destructor Documentation

template<typename T>
OpenDDS::DCPS::DurabilityQueue< T >::DurabilityQueue ( ACE_Allocator allocator  )  [inline]

Definition at line 39 of file DurabilityQueue.h.

00040     : ACE_Unbounded_Queue<T> (allocator)
00041   {}

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

Definition at line 43 of file DurabilityQueue.h.

00044     : ACE_Unbounded_Queue<T> (rhs.allocator_)
00045     , fs_path_(rhs.fs_path_)
00046   {
00047     // Copied from ACE_Unbounded_Queue<>::copy_nodes().
00048     for (ACE_Node<T> *curr = rhs.head_->next_;
00049          curr != rhs.head_;
00050          curr = curr->next_)
00051       if (this->enqueue_tail(curr->item_) == -1)
00052         this->delete_nodes();
00053   }

template<typename T>
OpenDDS::DCPS::DurabilityQueue< T >::~DurabilityQueue (  )  [inline]

Definition at line 55 of file DurabilityQueue.h.

00055 {}


Member Function Documentation

template<typename T>
typedef OpenDDS::DCPS::DurabilityQueue< T >::OPENDDS_VECTOR ( OPENDDS_STRING   ) 

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

Definition at line 57 of file DurabilityQueue.h.

References OpenDDS::DCPS::DurabilityQueue< T >::swap().

00057                                                   {
00058     DurabilityQueue tmp(rhs);
00059     this->swap(rhs);
00060   }

template<typename T>
void OpenDDS::DCPS::DurabilityQueue< T >::set_allocator ( ACE_Allocator allocator  )  [inline]

Reset allocator.

Definition at line 63 of file DurabilityQueue.h.

References allocator_.

00063                                                 {
00064     if (allocator == 0)
00065       allocator = ACE_Allocator::instance();
00066 
00067     this->allocator_ = allocator;
00068   }

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

Definition at line 70 of file DurabilityQueue.h.

References OpenDDS::DCPS::DurabilityQueue< T >::fs_path_, and OpenDDS::DCPS::swap().

Referenced by OpenDDS::DCPS::DurabilityQueue< T >::operator=().

00070                                       {
00071     std::swap(this->head_, rhs.head_);
00072     std::swap(this->cur_size_, rhs.current_size_);
00073     std::swap(this->allocator_, rhs.allocator_);
00074     std::swap(this->fs_path_, rhs.fs_path_);
00075   }


Member Data Documentation

template<typename T>
fs_path_t OpenDDS::DCPS::DurabilityQueue< T >::fs_path_

Definition at line 79 of file DurabilityQueue.h.

Referenced by OpenDDS::DCPS::DurabilityQueue< T >::swap().


The documentation for this class was generated from the following file:
Generated on Fri Feb 12 20:06:17 2016 for OpenDDS by  doxygen 1.4.7