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

#include <BasicQueueLinkPool_T.h>

List of all members.

Public Types

typedef BasicQueueLink< T > LinkType

Public Member Functions

 BasicQueueLinkPool (size_t links_per_pool, size_t num_pools)
 ~BasicQueueLinkPool ()
LinkTypeobtain (T *elem)
void release (LinkType *link)

Private Types

typedef BasicQueueLinkAllocator<
T > 
AllocatorType

Private Attributes

ACE_Allocatorallocator_


Detailed Description

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

Definition at line 19 of file BasicQueueLinkPool_T.h.


Member Typedef Documentation

template<typename T>
typedef BasicQueueLinkAllocator<T> OpenDDS::DCPS::BasicQueueLinkPool< T >::AllocatorType [private]

Definition at line 22 of file BasicQueueLinkPool_T.h.

template<typename T>
typedef BasicQueueLink<T> OpenDDS::DCPS::BasicQueueLinkPool< T >::LinkType

Definition at line 26 of file BasicQueueLinkPool_T.h.


Constructor & Destructor Documentation

template<typename T>
OpenDDS::DCPS::BasicQueueLinkPool< T >::BasicQueueLinkPool ( size_t  links_per_pool,
size_t  num_pools 
) [inline]

Definition at line 30 of file BasicQueueLinkPool_T.h.

References OpenDDS::DCPS::BasicQueueLinkPool< T >::allocator_.

00030                                                               {
00031     this->allocator_ = new AllocatorType(links_per_pool, num_pools);
00032   }

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

Definition at line 34 of file BasicQueueLinkPool_T.h.

References OpenDDS::DCPS::BasicQueueLinkPool< T >::allocator_.

00034                         {
00035     delete this->allocator_;
00036   }


Member Function Documentation

template<typename T>
LinkType* OpenDDS::DCPS::BasicQueueLinkPool< T >::obtain ( T *  elem  )  [inline]

Definition at line 38 of file BasicQueueLinkPool_T.h.

Referenced by OpenDDS::DCPS::BasicQueue< OpenDDS::DCPS::TransportQueueElement >::put().

00038                             {
00039     LinkType* link;
00040 
00041     ACE_NEW_MALLOC_RETURN(
00042       link,
00043       (LinkType*)this->allocator_->malloc(sizeof(LinkType)),
00044       LinkType(elem),
00045       0);
00046 
00047     return link;
00048   }

template<typename T>
void OpenDDS::DCPS::BasicQueueLinkPool< T >::release ( LinkType link  )  [inline]

Definition at line 50 of file BasicQueueLinkPool_T.h.

References OpenDDS::DCPS::BasicQueueLinkPool< T >::allocator_, and OpenDDS::DCPS::BasicQueueLink< T >::reset().

Referenced by OpenDDS::DCPS::BasicQueue< OpenDDS::DCPS::TransportQueueElement >::get(), and OpenDDS::DCPS::BasicQueue< OpenDDS::DCPS::TransportQueueElement >::remove_next().

00050                                {
00051     link->reset();
00052     this->allocator_->free(link);
00053   }


Member Data Documentation

template<typename T>
ACE_Allocator* OpenDDS::DCPS::BasicQueueLinkPool< T >::allocator_ [private]

Definition at line 57 of file BasicQueueLinkPool_T.h.

Referenced by OpenDDS::DCPS::BasicQueueLinkPool< T >::BasicQueueLinkPool(), OpenDDS::DCPS::BasicQueueLinkPool< T >::release(), and OpenDDS::DCPS::BasicQueueLinkPool< T >::~BasicQueueLinkPool().


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