#include <InputPort.hpp>
InputPort provides methods to interact with a worker's input ports.
Pothos::InputPort::~InputPort |
( |
void |
| ) |
|
Get access to the stream buffer. For non-stream ports, this returns an empty buffer chunk.
void Pothos::InputPort::clear |
( |
void |
| ) |
|
Clear all memory on this input port. Clear buffers, labels, and messages.
void Pothos::InputPort::consume |
( |
const size_t |
numElements | ) |
|
|
inline |
Consume elements on this port. The number of elements specified must be less than or equal to the number of elements available.
- Parameters
-
numElements | the number of elements to consume |
const std::string & Pothos::InputPort::domain |
( |
void |
| ) |
const |
|
inline |
Get the domain information for this port.
Get the data type information for this port.
size_t Pothos::InputPort::elements |
( |
void |
| ) |
const |
|
inline |
Get the number of elements available in the stream buffer. The number of elements is the available bytes/dtype size.
bool Pothos::InputPort::hasMessage |
( |
void |
| ) |
|
|
inline |
Does the specified input port have an asynchronous message available?
int Pothos::InputPort::index |
( |
void |
| ) |
const |
|
inline |
Get the index number of this port. An index of -1 means the port cannot be represented by an integer.
- Returns
- the index or -1
bool Pothos::InputPort::isSlot |
( |
void |
| ) |
const |
|
inline |
Is this port used for signal handling in a signals + slots paradigm?
Get an iterator to all input labels for the specified port. Labels are sorted in order of oldest to newest by label index.
- Returns
- an iterable object with sorted labels
const std::string & Pothos::InputPort::name |
( |
void |
| ) |
const |
|
inline |
Get the string name identifier for this port.
Remove and return an asynchronous message from the port. If there is no message available, a null Object() is returned.
- Returns
- an asynchronous message object
void Pothos::InputPort::pushBuffer |
( |
const BufferChunk & |
buffer | ) |
|
Push a buffer into the buffer queue of this input port. This is a thread-safe call, it can be made from any context. Use pushBuffer to preload an input port with elements, example: a window-sized history of elements for a filter block, or a preloaded number of elements for a feedback loop.
void Pothos::InputPort::pushLabel |
( |
const Label & |
label | ) |
|
Push a label into the label storage of this input port. This is a thread-safe call, it can be made from any context. When using this call, first push the buffer with the corresponding label index before pushing the label.
void Pothos::InputPort::pushMessage |
( |
const Object & |
message | ) |
|
Push a message into the message queue of this input port. This is a thread-safe call, it can be made from any context.
void Pothos::InputPort::removeLabel |
( |
const Label & |
label | ) |
|
|
inline |
Remove a label from the internal storage structure. This invalidates the iterator retrieved from labels(). Since labels are automatically removed by consume(), this call allows a users to simplify state tracking in their block implementations by removing labels, that might be iterated through on subsequent runs.
void Pothos::InputPort::setReserve |
( |
const size_t |
numElements | ) |
|
|
inline |
Set a reserve requirement on this input port. A reserve requirement means that work() will not be called unless this input port has at least numElements available; An exception to this rule is when a message is available. By default, each input port has a reserve of zero elements.
- Parameters
-
numElements | the number of elements to require |
unsigned long long Pothos::InputPort::totalBuffers |
( |
void |
| ) |
const |
|
inline |
Get the total number of buffers posted to this port. Note that this call tracks incoming buffer count, and not total buffer consumption (which is harder).
unsigned long long Pothos::InputPort::totalElements |
( |
void |
| ) |
const |
|
inline |
Get the total number of elements consumed on this port. The value returned by this method will not change until after execution of work() and propagateLabels().
unsigned long long Pothos::InputPort::totalLabels |
( |
void |
| ) |
const |
|
inline |
Get the total number of labels consumed from this port. This count updates immediately upon calling removeLabel(), and after after execution of work() and propagateLabels().
unsigned long long Pothos::InputPort::totalMessages |
( |
void |
| ) |
const |
|
inline |
Get the total number of messages popped from this port. The value returned by this method will be incremented immediately upon calling popMessage().
The documentation for this class was generated from the following files: