eXpress “1.5”

ThreadSafeFragQueue Class Reference

The ThreadSafeFragQueue is a threadsafe queue of Fragment pointers. More...

#include <threadsafety.h>

List of all members.

Public Member Functions

 ThreadSafeFragQueue (size_t max_size)
 ThreadSafeFragQueue Constructor.
Fragmentpop (bool block=true)
 A member function that pops the next Fragment pointer off the queue.
void push (Fragment *frag)
 A member function that pushes the given Fragment pointer onto the queue.
bool is_empty (bool block=false)
 A member function that returns true iff the queue is empty.

Detailed Description

The ThreadSafeFragQueue is a threadsafe queue of Fragment pointers.

Author:
Adam Roberts
Date:
2012 Artistic License 2.0

Definition at line 23 of file threadsafety.h.


Constructor & Destructor Documentation

ThreadSafeFragQueue::ThreadSafeFragQueue ( size_t  max_size)

ThreadSafeFragQueue Constructor.

Parameters:
max_sizea size_t representing the number of Fragments allowed in

the queue before blocking on a push.

Definition at line 12 of file threadsafety.cpp.


Member Function Documentation

bool ThreadSafeFragQueue::is_empty ( bool  block = false)

A member function that returns true iff the queue is empty.

If block is true, the function blocks until the queue is empty and returns true.

Parameters:
blocka bool specifying whether or not the function should block until the queue is empty.
Returns:
True iff the queue is empty.

Definition at line 41 of file threadsafety.cpp.

Fragment * ThreadSafeFragQueue::pop ( bool  block = true)

A member function that pops the next Fragment pointer off the queue.

If the queue is empty, returns NULL if block is false, otherwise blocks until one is available.

Parameters:
blocka bool specifying whether or not the function should block if the queue is empty.
Returns:
The next Fragment pointer on the queue or NULL if the queue is empty and block is false.

Definition at line 16 of file threadsafety.cpp.

void ThreadSafeFragQueue::push ( Fragment frag)

A member function that pushes the given Fragment pointer onto the queue.

Blocks if the queue is full.

Parameters:
fragthe Fragment pointer to push onto the queue.

Definition at line 31 of file threadsafety.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables