24 #ifndef __FiFoQueue_hh
25 #define __FiFoQueue_hh
27 #include <bias_config.h>
28 #include <Base/Debug/Error.hh>
30 #ifndef BIAS_HAVE_PTHREADS
31 # error pthreads need to be activated for FiFo-queue
36 #define __BIAS_FIFOQUEUE_DEFAULT_SIZE__ 10
70 data_ =
new T[__BIAS_FIFOQUEUE_DEFAULT_SIZE__];
290 #endif // __FiFoQueue_hh
FiFoQueue()
Default constructor.
pthread_cond_t * triggerCondFull_
pthread condition variable for waiting for non full buf
This class implements a templated standard FiFo-queue for inter process communication (arbitrary numb...
unsigned head_
first (oldest) element in queue
unsigned numItems_
number of items in buffer
~FiFoQueue()
Just a cleanup.
pthread_mutex_t * syncMutex_
mutex for sync. locking (conditions and access)
int FetchSynced(T &item)
Fetch the oldest item from the queue.
FiFoQueue(unsigned length)
Constructor.
unsigned GetBufferSize()
Returns the size of underlying ringbuffer -> maximum number of items in queue.
FiFoQueue(FiFoQueue &data)
const unsigned length_
length of buffer (number of slots)
pthread_cond_t * triggerCondEmpty_
pthread condition variable for waiting for non empty buf
unsigned tail_
last (newest) element in queue
int AppendSynced(T &item)
Append an datum as newest item.
int FetchUnsynced(T &item)
Fetch the oldest item from the queue.
unsigned GetNumItems()
Return the number of items in queue.
T * data_
array holding cycled buffer
int AppendUnsynced(T &item)
Append an datum as newest item.