S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_fifo_base Class Template Reference

Abstract Base Class (ABC) used to derive FIFO queue classes. More...

#include <s3_fifo_base.h>

Inheritance diagram for s3_fifo_base:

Inheritance graph
[legend]
Collaboration diagram for s3_fifo_base:

Collaboration graph
[legend]
List of all members.

Public Types

typedef T s3_queue_data_t

Public Methods

virtual ~s3_fifo_base ()
 Destructor: virtual. More...

virtual void push (const T &t)=0
 Insert object at the head of the queue. More...

virtual T pop ()=0
 Remove and return object at the tail of the queue. More...

virtual bool empty () const=0
 Check if queue is empty. More...

virtual bool full () const=0
 Check whether queue is full. More...

virtual unsigned int size () const=0
 Return number of elements in queue. More...


Static Protected Methods

void unlock_mutex (void *p)
 INTERNAL helper (i.e. More...


Detailed Description

template<typename T>
class s3_fifo_base< T >

Abstract Base Class (ABC) used to derive FIFO queue classes.

It provides an interface to atomically insert and remove elements from the queue as well as determining whether the queue if full or empty and the number of elements in the queue.

Any number of producers or consumers can subscribe to a queue to be notified when the producer- or consumer-side of a queue changes. This is signalled by post() 'ing to a semaphore.

Definition at line 135 of file s3_fifo_base.h.


Member Typedef Documentation

template<typename T>
typedef T s3_fifo_base::s3_queue_data_t
 

Definition at line 140 of file s3_fifo_base.h.


Constructor & Destructor Documentation

template<typename T>
virtual s3_fifo_base< T >::~s3_fifo_base   [inline, virtual]
 

Destructor: virtual.

Definition at line 145 of file s3_fifo_base.h.


Member Function Documentation

template<typename T>
virtual bool s3_fifo_base< T >::empty   const [pure virtual]
 

Check if queue is empty.

Implemented in s3_fifo_queue.

template<typename T>
virtual bool s3_fifo_base< T >::full   const [pure virtual]
 

Check whether queue is full.

Implemented in s3_fifo_queue.

template<typename T>
virtual T s3_fifo_base< T >::pop   [pure virtual]
 

Remove and return object at the tail of the queue.

Returns:
Copy of the object at the end of the queue.

Implemented in s3_growable_fifo_queue.

template<typename T>
virtual void s3_fifo_base< T >::push const T &    t [pure virtual]
 

Insert object at the head of the queue.

Parameters:
t  Object to be inserted at end.

Implemented in s3_growable_fifo_queue.

template<typename T>
virtual unsigned int s3_fifo_base< T >::size   const [pure virtual]
 

Return number of elements in queue.

Returns:
Number of elements in queue.

Implemented in s3_fifo_queue.

template<typename T>
void s3_fifo_base< T >::unlock_mutex void *    p [inline, static, protected]
 

INTERNAL helper (i.e.

no future interface guarantees) function. Convert the void* argument to a pthread_mutex_t* and unlock this mutex. Use this as the first argument to the pthread_cleanup_push() function to set a handler that automatically unlocks a mutex if a cancellation request is honoured in a critical section. The handler should be set prior to locking the mutex. It is imperative that all critical sections containing cancellation points use cleanup push/pop protection.

Definition at line 183 of file s3_fifo_base.h.

Referenced by s3_fifo_queue< s3_txport_data< s3_message > >::open_input, s3_fifo_queue< s3_txport_data< s3_message > >::open_output, s3_growable_fifo_queue< s3_txport_event >::pop, and s3_growable_fifo_queue< s3_txport_event >::push.


The documentation for this class was generated from the following file:
Send comments to: s3fc@stonethree.com SourceForge Logo