EMIPLIB
Public Member Functions

MIPStreamBuffer Class Reference

This class represents a thread-safe buffer to which data can be written and from which the same data can be read again, making it well suited to safely pass data between threads.

#include <mipstreambuffer.h>

List of all members.

Public Member Functions

 MIPStreamBuffer (int blockSize, int preAllocBlocks=0)
 Constructs a MIPStreamBuffer object.
void clear ()
 Resets the buffers.
void write (const void *pData, int amount)
 Writes amount bytes from pData into the buffer.
int read (void *pData, int amount)
 Reads and removes amount bytes from the buffer, storing them in pData.
int getAmountBuffered () const
 Returns the amount of data which is currently being stored.

Constructor & Destructor Documentation

MIPStreamBuffer::MIPStreamBuffer ( int  blockSize,
int  preAllocBlocks = 0 
)

Constructs a MIPStreamBuffer object.

Parameters:
blockSizeThe data will be stored in a linked list containing blocks of this size.
preAllocBlocksThe number of blocks for which memory will be pre-allocated.

Member Function Documentation

void MIPStreamBuffer::clear ( )
int MIPStreamBuffer::getAmountBuffered ( ) const
int MIPStreamBuffer::read ( void *  pData,
int  amount 
)
void MIPStreamBuffer::write ( const void *  pData,
int  amount 
)

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