SST::Core::Interprocess::CircularBuffer< T, A > Class Template Reference

Multi-process safe, Circular Buffer class. More...

#include <circularBuffer.h>

Public Member Functions

 CircularBuffer (size_t bufferSize, const A &allocator)
 Construct a new circular buffer.
void write (const T &value)
 Write a value to the circular buffer.
read (void)
 Blocking Read a value from the circular buffer.
bool readNB (T *result)
 Non-Blocking Read a value from the circular buffer.

Detailed Description

template<typename T, typename A>
class SST::Core::Interprocess::CircularBuffer< T, A >

Multi-process safe, Circular Buffer class.

Template Parameters:
T Type of data item to store in the buffer
A Memory Allocator type to use

Constructor & Destructor Documentation

template<typename T , typename A >
SST::Core::Interprocess::CircularBuffer< T, A >::CircularBuffer ( size_t  bufferSize,
const A &  allocator 
) [inline]

Construct a new circular buffer.

Parameters:
bufferSize Number of elements in the buffer
allocator Memory allocator to use for constructing the buffer

Member Function Documentation

template<typename T , typename A >
T SST::Core::Interprocess::CircularBuffer< T, A >::read ( void   )  [inline]

Blocking Read a value from the circular buffer.

Returns:
The next item in the queue to be read
template<typename T , typename A >
bool SST::Core::Interprocess::CircularBuffer< T, A >::readNB ( T *  result  )  [inline]

Non-Blocking Read a value from the circular buffer.

Parameters:
result Pointer to an item which will be filled in if possible
Returns:
True if an item was available, False otherwisw
template<typename T , typename A >
void SST::Core::Interprocess::CircularBuffer< T, A >::write ( const T &  value  )  [inline]

Write a value to the circular buffer.

Parameters:
value New Value to write

The documentation for this class was generated from the following file:

Generated on 14 Sep 2015 for SST by  doxygen 1.6.1