Helios++
Helios software for LiDAR simulations
|
Class defining a strategy that provides support for buffering of consecutive readings. More...
#include <BufferedReadingStrategy.h>
Public Member Functions | |
BufferedReadingStrategy (ReadingStrategy< ReadArg > &readingStrategy, size_t const bufferSize=256) | |
Default constructor for buffered reading strategy. More... | |
ReadArg | read () override |
Take until buffer is empty, read always that buffer needs to be fulfilled. More... | |
virtual size_t | getBufferSize () |
Obtain the buffer size. More... | |
virtual void | setBufferSize (size_t const bufferSize) |
Set the buffer size and update the buffer to fit. More... | |
![]() | |
ReadingStrategy ()=default | |
Default constructor for reading strategy. | |
Protected Member Functions | |
virtual bool | isBufferEmpty () const |
Check whether the buffer is empty or not. More... | |
Protected Attributes | |
size_t | bufferSize |
The maximum number of ReadArg type elements that a buffer is allowed to hold. | |
ReadArg * | buffer = nullptr |
The buffer where multiple consecutive reads are stored. | |
ReadingStrategy< ReadArg > & | readingStrategy |
The reading strategy that is being extended with buffer support. | |
size_t | cachedIndex = 0 |
The cached index defining the state of the buffer. | |
size_t | cachedMaxIndex = 0 |
The cached index defining the next to the greatest admissible index for the current state of the buffer. | |
Class defining a strategy that provides support for buffering of consecutive readings.
ReadArg | Type of what is being read |
|
inline |
Default constructor for buffered reading strategy.
|
inlinevirtual |
Obtain the buffer size.
|
inlineprotectedvirtual |
Check whether the buffer is empty or not.
|
inlineoverridevirtual |
Take until buffer is empty, read always that buffer needs to be fulfilled.
Implements helios::filems::ReadingStrategy< ReadArg >.
|
inlinevirtual |
Set the buffer size and update the buffer to fit.
bufferSize | The new buffer size |