shm_queue_header< T > Class Template Reference

Queue header with head and tail pointer. More...

#include <shm_queue.h>

Collaboration diagram for shm_queue_header< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 shm_queue_header (size_t s=0)
void * operator new (size_t s, shm_allocator &a)
void operator delete (void *p, shm_allocator &a)

Public Attributes

size_t size
shm_ptr< shm_queue_node< T > > head
shm_ptr< shm_queue_node< T > > tail
pthread_mutex_t lock
pthread_mutex_t head_lock
pthread_mutex_t tail_lock
pthread_cond_t ready_for_push
pthread_cond_t ready_for_pop

Detailed Description

template<typename T>
class shm_queue_header< T >

Queue header with head and tail pointer.

The queue header also contains the member variables for the required mutex and condition variables.

Definition at line 54 of file shm_queue.h.


Constructor & Destructor Documentation

template<typename T>
shm_queue_header< T >::shm_queue_header ( size_t  s = 0  )  [inline]

construct a queue header with an initial size.

The queue is constructed with a head and tail with shared memory pointers containing initial offset of zero (indicating NULL). The queue tail is intially locked.

Parameters:
s size of the queue

Definition at line 66 of file shm_queue.h.

References shm_queue_header< T >::head, shm_queue_header< T >::head_lock, shm_queue_header< T >::ready_for_pop, shm_queue_header< T >::ready_for_push, shm_ptr< T >::set(), and shm_queue_header< T >::tail.

Here is the call graph for this function:


Member Function Documentation

template<typename T>
void* shm_queue_header< T >::operator new ( size_t  s,
shm_allocator a 
) [inline]

Definition at line 105 of file shm_queue.h.

References shm_allocator::alloc().

Here is the call graph for this function:

template<typename T>
void shm_queue_header< T >::operator delete ( void *  p,
shm_allocator a 
) [inline]

Definition at line 109 of file shm_queue.h.

References shm_allocator::free().

Here is the call graph for this function:


Member Data Documentation

template<typename T>
size_t shm_queue_header< T >::size

Definition at line 114 of file shm_queue.h.

Referenced by shm_queue< T >::pop(), shm_queue< T >::push(), and shm_queue< T >::size().

template<typename T>
shm_ptr<shm_queue_node<T> > shm_queue_header< T >::head

Definition at line 115 of file shm_queue.h.

Referenced by shm_queue< T >::pop(), shm_queue< T >::push(), and shm_queue_header< T >::shm_queue_header().

template<typename T>
shm_ptr<shm_queue_node<T> > shm_queue_header< T >::tail

Definition at line 116 of file shm_queue.h.

Referenced by shm_queue< T >::pop(), shm_queue< T >::push(), and shm_queue_header< T >::shm_queue_header().

template<typename T>
pthread_mutex_t shm_queue_header< T >::lock

Definition at line 117 of file shm_queue.h.

template<typename T>
pthread_mutex_t shm_queue_header< T >::head_lock

Definition at line 118 of file shm_queue.h.

Referenced by shm_queue< T >::lock_head(), shm_queue< T >::push(), shm_queue_header< T >::shm_queue_header(), and shm_queue< T >::unlock_head().

template<typename T>
pthread_mutex_t shm_queue_header< T >::tail_lock

Definition at line 119 of file shm_queue.h.

Referenced by shm_queue< T >::lock_tail(), shm_queue< T >::pop(), and shm_queue< T >::unlock_tail().

template<typename T>
pthread_cond_t shm_queue_header< T >::ready_for_push

Definition at line 120 of file shm_queue.h.

Referenced by shm_queue< T >::pop(), and shm_queue_header< T >::shm_queue_header().

template<typename T>
pthread_cond_t shm_queue_header< T >::ready_for_pop

Definition at line 121 of file shm_queue.h.

Referenced by shm_queue< T >::pop(), shm_queue< T >::push(), and shm_queue_header< T >::shm_queue_header().


The documentation for this class was generated from the following file:
Project shmq hosted by   SourceForge.net
Documentation generated on Sat Sep 2 10:07:40 2006 for shmq by   doxygen.org 1.4.6