#include <TupleQueue.h>
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). | |
Stream * | getStream () |
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. The pool's page size must be at least big enough to hold a tuple plus a small amount of accounting data. |
|
Destructor.
|
|
Adds a listener to the queue. The listener's notify() method will be invoked whenever notifyEnq() is called. |
|
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. |
|
|
|
Dumps information about the queue to standard error.
|
|
|
|
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. |
|
|
|
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) |
|
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) |
|
|
|
Returns the size of tuples in this queue.
|
|
Calls the mailbox's onNonEmpty() method and each listener's notify() method.
|
|
Removes a listener from the queue.
|
|
|
|
|
|
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. |
|
Associated stream (for bookkeeping).
|
|
Returns the number of tuples currently contained within the queue.
|