#include <BufferManager.hpp>
A BufferManager has a queue-like interface to manage buffers. Since buffers can represent special DMA memory, the buffer manager is responsible for DMA hooks.
◆ Sptr
◆ ~BufferManager()
virtual Pothos::BufferManager::~BufferManager |
( |
void |
| ) |
|
|
virtual |
Virtual destructor for derived buffer managers.
◆ BufferManager()
Pothos::BufferManager::BufferManager |
( |
void |
| ) |
|
|
protected |
◆ empty()
virtual bool Pothos::BufferManager::empty |
( |
void |
| ) |
const |
|
pure virtual |
Is the manager empty?
- Returns
- true if no buffers are available
◆ front()
Get a reference to the front buffer. front().address will be the start of a valid buffer, front().length will be the number of bytes available. The caller sets length to indicate bytes used.
- Returns
- the buffer at the queue head
◆ init()
Init is called once at factory time to initialize the buffers.
◆ isInitialized()
bool Pothos::BufferManager::isInitialized |
( |
void |
| ) |
const |
|
inline |
Has this buffer manager been initialized?
◆ make() [1/2]
static Sptr Pothos::BufferManager::make |
( |
const std::string & |
name | ) |
|
|
static |
The BufferManager factory – makes a new BufferManager given the factory name. This factory call does not invoke init() on the buffer manager. Plugins for custom BufferManagers should be located in the plugin registry: /framework/buffer_manager/[name]
- Exceptions
-
BufferManagerFactoryError | if the factory function fails. |
- Parameters
-
- Returns
- a new shared pointer to a buffer manager
◆ make() [2/2]
The BufferManager factory – makes a new BufferManager given the factory name. Plugins for custom BufferManagers should be located in the plugin registry: /framework/buffer_manager/[name]
- Exceptions
-
BufferManagerFactoryError | if the factory function fails. |
- Parameters
-
name | the name of a BufferManager factory in the plugin tree |
args | the buffer manager init arguments |
- Returns
- a new shared pointer to a buffer manager
◆ pop()
virtual void Pothos::BufferManager::pop |
( |
const size_t |
numBytes | ) |
|
|
pure virtual |
Pop bytes from the front buffer. This operation removes available bytes from the manager. Calling pop removes a managed buffer from an internal queue; the bytes removed are only restored to the manager via push.
If this manager is responsible for DMA writes, the pop operation should cause a write operation. If this manager is responsible for DMA reads, this pop operation should cause a read operation.
- Parameters
-
numBytes | the number of bytes to remove |
◆ push()
virtual void Pothos::BufferManager::push |
( |
const ManagedBuffer & |
buff | ) |
|
|
pure virtual |
Push returns a buffer to the manager. The buffer may be available via a call to front() depending upon the implementation of the manager.
- Exceptions
-
BufferPushError | if buffer does not belong to this manager. |
- Parameters
-
◆ pushExternal()
void Pothos::BufferManager::pushExternal |
( |
const ManagedBuffer & |
buff | ) |
|
|
inline |
Push external returns a buffer to the manager through a callback. This call is used to return a buffer from a different thread context. The callback implements the thread-safe delivery mechanism.
◆ setCallback()
void Pothos::BufferManager::setCallback |
( |
const std::function< void(const ManagedBuffer &)> & |
callback | ) |
|
Set the callback for use with the pushExternal API call.
◆ setFrontBuffer()
void Pothos::BufferManager::setFrontBuffer |
( |
const BufferChunk & |
buff | ) |
|
|
inlineprotected |
Called by derived classes to set the buffer for front()
The documentation for this class was generated from the following file: