SST  6.1.0
StructuralSimulationToolkit
SST::Core::Interprocess::CircularBuffer< T > Class Template Reference

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

#include <circularBuffer.h>

Public Member Functions

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

Detailed Description

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

Multi-process safe, Circular Buffer class.

Template Parameters
TType of data item to store in the buffer
AMemory Allocator type to use

Constructor & Destructor Documentation

template<typename T >
SST::Core::Interprocess::CircularBuffer< T >::CircularBuffer ( size_t  bufferSize = 0)
inline

Construct a new circular buffer.

Parameters
bufferSizeNumber of elements in the buffer
allocatorMemory allocator to use for constructing the buffer

Member Function Documentation

template<typename T >
T SST::Core::Interprocess::CircularBuffer< T >::read ( void  )
inline

Blocking Read a value from the circular buffer.

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

Non-Blocking Read a value from the circular buffer.

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

Write a value to the circular buffer.

Parameters
valueNew Value to write

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