#include <BlockBuffer.H>
Class to manage used and unused buffers for double or more buffering. Uses mutexes so this class is thread safe. All buffers start on the emptyBuffers queue.
- Examples:
- BlockBufferTest.C.
Definition at line 34 of file BlockBuffer.H.
◆ BlockBuffer() [1/2]
BlockBuffer::BlockBuffer |
( |
int |
count | ) |
|
|
inline |
Constructor
- Parameters
-
count | The number of buffers to create. |
Definition at line 51 of file BlockBuffer.H.
◆ BlockBuffer() [2/2]
BlockBuffer::BlockBuffer |
( |
void |
| ) |
|
|
inline |
Constructor - creates BLOCK_BUFFER_DEFAULT_COUNT buffers.
Definition at line 56 of file BlockBuffer.H.
◆ getBufferCount()
int BlockBuffer::getBufferCount |
( |
| ) |
|
|
inline |
Find the number of buffers available in total.
- Returns
- the total buffer count.
Definition at line 111 of file BlockBuffer.H.
◆ getEmptyBuffer()
Eigen::Array<unsigned short, Eigen::Dynamic, Eigen::Dynamic>* BlockBuffer::getEmptyBuffer |
( |
void |
| ) |
|
|
inline |
◆ getFullBuffer()
Eigen::Array<unsigned short, Eigen::Dynamic, Eigen::Dynamic>* BlockBuffer::getFullBuffer |
( |
void |
| ) |
|
|
inline |
◆ init()
void BlockBuffer::init |
( |
int |
count | ) |
|
|
inlineprivate |
◆ putEmptyBuffer()
void BlockBuffer::putEmptyBuffer |
( |
Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > * |
eb | ) |
|
|
inline |
◆ putFullBuffer()
void BlockBuffer::putFullBuffer |
( |
Eigen::Array< unsigned short, Eigen::Dynamic, Eigen::Dynamic > * |
fb | ) |
|
|
inline |
Push a full buffer to the full queue.
- Parameters
-
fb | The full buffer to add to the full queue. |
- Examples:
- BlockBufferTest.C.
Definition at line 93 of file BlockBuffer.H.
◆ resize()
void BlockBuffer::resize |
( |
int |
count | ) |
|
|
inline |
Resise the number of buffers contained. Each buffer is resized to the current buffer row/col sizes. All buffers are created and the emptyBuffers queue contains them. The fullBuffers queue is empty. Note: This should not be run whilst in operation. Ensure no other threads are accessing this class.
- Parameters
-
count | The number of buffers to create. |
- Examples:
- BlockBufferTest.C.
Definition at line 133 of file BlockBuffer.H.
◆ resizeBuffers()
void BlockBuffer::resizeBuffers |
( |
int |
rows, |
|
|
int |
cols |
|
) |
| |
|
inline |
resize all of the buffers
- Parameters
-
rows | The number of rows to create in each buffer. |
cols | The number of cols to create in each buffer. |
- Examples:
- BlockBufferTest.C.
Definition at line 119 of file BlockBuffer.H.
◆ buffers
std::vector<Eigen::Array<unsigned short, Eigen::Dynamic, Eigen::Dynamic> > BlockBuffer::buffers |
|
private |
◆ emptyBufferMutex
Mutex BlockBuffer::emptyBufferMutex |
|
private |
◆ emptyBuffers
std::queue<Eigen::Array<unsigned short, Eigen::Dynamic, Eigen::Dynamic> *> BlockBuffer::emptyBuffers |
|
private |
◆ fullBufferMutex
Mutex BlockBuffer::fullBufferMutex |
|
private |
◆ fullBuffers
std::queue<Eigen::Array<unsigned short, Eigen::Dynamic, Eigen::Dynamic> *> BlockBuffer::fullBuffers |
|
private |
The documentation for this class was generated from the following file: