TOBI SignalServer  0.1
tobiss::DataBuffer< T > Class Template Reference

Thread safe FIFO buffer. More...

#include <databuffer.h>

+ Inheritance diagram for tobiss::DataBuffer< T >:

Data Structures

class  buffer_overrun
class  buffer_underrun

Public Types

typedef boost::circular_buffer< T > container_type
typedef container_type::size_type size_type
typedef container_type::value_type value_type
typedef boost::call_traits
< value_type >::param_type 
param_type

Public Member Functions

 DataBuffer (size_type capacity)
 Constructor.
void resize (size_type capacity)
 Change Buffer Size.
size_type getNumAvail ()
 returns number of unread items available in the buffer.
void blockWhileEmpty ()
 If the buffer is empty, block until another threads inserts an item.
void blockWhileFull ()
 If the buffer is full, block until another threads removes an item.
void insert_blocking (param_type item)
 Insert a new item (sample/frame/packet/...) in the buffer.
void insert_throwing (param_type item)
 Insert a new item (sample/frame/packet/...) in the buffer.
void insert_overwriting (param_type item)
 Insert a new item (sample/frame/packet/...) in the buffer.
void getNext_blocking (value_type *pItem)
 get next item (sample/frame/packet/...) from the buffer (item is removed from the buffer)
void getNext_throwing (value_type *pItem)
 get next item (sample/frame/packet/...) from the buffer (item is removed from the buffer)
void peekNext_blocking (value_type *pItem)
 get next item (sample/frame/packet/...) from the buffer (item remains in the buffer)
void peekNext_throwing (value_type *pItem)
 get next item (sample/frame/packet/...) from the buffer (item remains in the buffer)
bool dropOldest ()
void clearAll ()

Private Member Functions

 DataBuffer (const DataBuffer &)
DataBufferoperator= (const DataBuffer &)
bool is_not_empty () const
bool is_not_full () const

Private Attributes

size_type unread_
container_type container_
boost::mutex mutex_
boost::condition_variable cond_not_empty_
boost::condition_variable cond_not_full_

Detailed Description

template<class T>
class tobiss::DataBuffer< T >

Thread safe FIFO buffer.

Template Parameters:
TDatatype to be buffered

Definition at line 56 of file databuffer.h.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables