Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

TupleQueue Class Reference

#include <TupleQueue.h>

List of all members.


Detailed Description

A tuple queue with a single EnqIterator (for writing into the queue) and a single DeqIterator (for reading from the queue).

The iterators need not be used from the same thread.


Public Member Functions

 TupleQueue (PagePool &pool, unsigned int tuple_size)
 Constructor.
 ~TupleQueue ()
 Destructor.
void setStream (Stream *stream)
 Associated stream (for bookkeeping).
StreamgetStream ()
void empty ()
void enqueueMultiple (vector< char * > tuples)
vector< char * > dequeueAll ()
RSeekIterator rseek_iterator ()
SeekIterator seek_iterator ()
EnqIterator enq_iterator ()
 Obtains an enqueue iterator for the TupleQueue.
DeqIterator deq_iterator ()
 Obtains an dequeue iterator for the TupleQueue.
void dump () const
 Dumps information about the queue to standard error.
int size () const
 Returns the number of tuples currently contained within the queue.
size_t getNumTuplesDequeued () const
 Returns the number of tuples that have ever been dequeued from this TupleQueue.
size_t getNumTuplesEnqueued () const
 Returns the number of tuples that have ever been enqueued to this TupleQueue.
void addListener (TupleQueueListener *listener)
 Adds a listener to the queue.
void removeListener (TupleQueueListener *listener)
 Removes a listener from the queue.
unsigned int getTupleSize () const
 Returns the size of tuples in this queue.
void setEnqNotifyTarget (TuplesAvailableMailbox *pMailbox)
 Sets the mailbox whose onNonEmpty() method will be called whenever this TupleQueue's notifyEnq() method is called.
void notifyEnq ()
 Calls the mailbox's onNonEmpty() method and each listener's notify() method.


Constructor & Destructor Documentation

TupleQueue::TupleQueue PagePool pool,
unsigned int  tuple_size
 

Constructor.

The pool's page size must be at least big enough to hold a tuple plus a small amount of accounting data.

TupleQueue::~TupleQueue  ) 
 

Destructor.


Member Function Documentation

void TupleQueue::addListener TupleQueueListener listener  ) 
 

Adds a listener to the queue.

The listener's notify() method will be invoked whenever notifyEnq() is called.

DeqIterator TupleQueue::deq_iterator  ) 
 

Obtains an dequeue iterator for the TupleQueue.

Only a single DeqIterator (and a single EnqIterator, not necessarily in the same thread) should ever be outstanding.

vector< char * > TupleQueue::dequeueAll  ) 
 

void TupleQueue::dump  )  const
 

Dumps information about the queue to standard error.

void TupleQueue::empty  ) 
 

EnqIterator TupleQueue::enq_iterator  ) 
 

Obtains an enqueue iterator for the TupleQueue.

Only a single EnqIterator (and a single DeqIterator, not necessarily in the same thread) should ever be outstanding.

void TupleQueue::enqueueMultiple vector< char * >  tuples  ) 
 

size_t TupleQueue::getNumTuplesDequeued  )  const
 

Returns the number of tuples that have ever been dequeued from this TupleQueue.

THREAD SAFETY NOTE: This method must not be run concurrently with the dequeueing of tuples from this TupleQueue. (This is fixable, but I saw no need to write that code yet. -cjc)

size_t TupleQueue::getNumTuplesEnqueued  )  const
 

Returns the number of tuples that have ever been enqueued to this TupleQueue.

(presumably the above safety note applies to this as well -alexr) THREAD SAFETY NOTE: This method must not be run concurrently with the dequeueing of tuples from this TupleQueue. (This is fixable, but I saw no need to write that code yet. -cjc)

Stream* TupleQueue::getStream  ) 
 

unsigned int TupleQueue::getTupleSize  )  const
 

Returns the size of tuples in this queue.

void TupleQueue::notifyEnq  ) 
 

Calls the mailbox's onNonEmpty() method and each listener's notify() method.

void TupleQueue::removeListener TupleQueueListener listener  ) 
 

Removes a listener from the queue.

RSeekIterator TupleQueue::rseek_iterator  ) 
 

SeekIterator TupleQueue::seek_iterator  ) 
 

void TupleQueue::setEnqNotifyTarget TuplesAvailableMailbox pMailbox  ) 
 

Sets the mailbox whose onNonEmpty() method will be called whenever this TupleQueue's notifyEnq() method is called.

Passing a NULL pointer to this method terminates the notification mechanism.

void TupleQueue::setStream Stream stream  ) 
 

Associated stream (for bookkeeping).

int TupleQueue::size  )  const
 

Returns the number of tuples currently contained within the queue.


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:24 2004 for Borealis by doxygen 1.3.8