BufferManager is a class that will allocate a big buffer and spit it up in several cache-aligned sub-buffers.
More...
#include <bufferManager.hpp>
|
| using | Buffer = gsl::span<uint8_t> |
| | The span definition of a subbuffer.
|
| |
BufferManager is a class that will allocate a big buffer and spit it up in several cache-aligned sub-buffers.
The BufferManager can then be used to get references to the subbuffers. These references will then return their subbuffer to the BufferManager when their reference counter reaches zero. This allows to copy data into these subbuffers and then pass it through a pipeline, where it is no longer needed. The subbuffers are created cache-aligned and the BufferManager will try to reuse the most recently returned buffers to optimise cache usage.
◆ Buffer
The span definition of a subbuffer.
◆ BufferManager() [1/2]
| rtctk::componentFramework::BufferManager::BufferManager |
( |
| ) |
|
|
delete |
◆ BufferManager() [2/2]
| rtctk::componentFramework::BufferManager::BufferManager |
( |
const size_t | buffer_size, |
|
|
ComponentMetricsIf & | metrics, |
|
|
const std::string & | description, |
|
|
const std::string & | prefix, |
|
|
const size_t | buffers, |
|
|
const std::optional< numapp::MemPolicy > & | policy = {} ) |
BufferManager constructor.
- buffer_size size of each buffer
- metrics Component metrics to be used for reporting the buffer usage
- description Description used for buffer occupancy metric
- prefix Prefix to be used for the buffer occupancy metric
- buffers how many buffers should be allocated, this is the maximum amount available
- policy Memory policy to use for allocating the buffers
◆ BlockingGet()
Same as get, but will not throw but blocks until buffer is free.
◆ Get()
Get a new buffer from the pool, throws when no buffers are available.
- Returns
- shared pointer to a BufferReference
The documentation for this class was generated from the following files: