#include <OutputPort.hpp>
OutputPort provides methods to interact with a worker's output ports.
◆ ~OutputPort()
Pothos::OutputPort::~OutputPort |
( |
void |
| ) |
|
◆ alias()
const std::string& Pothos::OutputPort::alias |
( |
void |
| ) |
const |
Get a displayable name for this port.
◆ buffer()
Get access to the stream buffer. For non-stream ports, this returns an empty buffer chunk.
◆ domain()
const std::string & Pothos::OutputPort::domain |
( |
void |
| ) |
const |
|
inline |
Get the domain information for this port.
◆ dtype()
Get the data type information for this port.
◆ elements()
size_t Pothos::OutputPort::elements |
( |
void |
| ) |
const |
|
inline |
Get the number of elements available in the stream buffer. The number of elements is the available bytes/dtype size.
◆ emplaceMessage()
template<typename T , typename... Args>
void Pothos::OutputPort::emplaceMessage |
( |
Args &&... |
args | ) |
|
Construct a message from arguments and post it to the subscribers on this port.
port->emplaceMessage<std::string>(ptr, len);
- Template Parameters
-
T | the type of the new message object |
- Parameters
-
args | the constructor arguments for type T |
◆ getBuffer() [1/2]
Get a buffer of a specified size in elements. The type of the buffer is specified by the port. Some blocks may require buffers of arbitrary size for use with postBuffer() and postMessage() calls. The call will attempt to use the front buffer from this output port and will fall-back to a reusable pool.
- Postcondition
- buffer() has undefined behavior after this call.
- Parameters
-
numElements | the number of elements given the port's type |
- Returns
- a buffer chunk with the port's type and the specified length
◆ getBuffer() [2/2]
BufferChunk Pothos::OutputPort::getBuffer |
( |
const DType & |
dtype, |
|
|
const size_t |
numElements |
|
) |
| |
Get a buffer of a specified size and type. This variant provides a user specified data type.
- Postcondition
- buffer() has undefined behavior after this call.
- Parameters
-
dtype | the buffer's type (independent of port type) |
numElements | the number of elements of type dtype |
- Returns
- a buffer chunk with the specified type and length
◆ index()
int Pothos::OutputPort::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
◆ isSignal()
bool Pothos::OutputPort::isSignal |
( |
void |
| ) |
const |
|
inline |
Is this port used for signaling in a signals + slots paradigm?
◆ name()
const std::string & Pothos::OutputPort::name |
( |
void |
| ) |
const |
|
inline |
Get the string name identifier for this port.
◆ popElements()
void Pothos::OutputPort::popElements |
( |
const size_t |
numElements | ) |
|
|
inline |
Remove all or part of an output buffer from the port; without producing elements for downstream consumers. This call allows the user to use the output buffer for non-streaming purposes, such as an async message. The number of elements specified should be less than or equal to the available number elements on this port.
- Parameters
-
numElements | the number of elements to remove |
◆ postBuffer()
template<typename ValueType >
void Pothos::OutputPort::postBuffer |
( |
ValueType && |
buffer | ) |
|
|
inline |
Post an output buffer to the subscribers on this port. This call allows external user-provided buffers to be used in place of the normal stream buffer provided by buffer(). The number of elements to produce is determined from the buffer's length field divided by the dtype size. Do not call produce() when using postBuffer().
- Parameters
-
◆ postLabel()
template<typename... ValueType>
void Pothos::OutputPort::postLabel |
( |
ValueType &&... |
label | ) |
|
|
inline |
Post an output label to the subscribers on this port. postLabel also supports move and emplacement semantics.
port->postLabel(label);
port->postLabel(std::move(label));
port->postLabel(
id, data,
index);
- Parameters
-
◆ postMessage()
template<typename ValueType >
void Pothos::OutputPort::postMessage |
( |
ValueType && |
message | ) |
|
Post an output message to the subscribers on this port.
- Parameters
-
message | the message to post |
◆ produce()
void Pothos::OutputPort::produce |
( |
const size_t |
numElements | ) |
|
|
inline |
Produce elements from 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 produce |
◆ setAlias()
void Pothos::OutputPort::setAlias |
( |
const std::string & |
alias | ) |
|
Set the displayable alias for this port.
◆ setReadBeforeWrite()
void Pothos::OutputPort::setReadBeforeWrite |
( |
InputPort * |
port | ) |
|
|
inline |
Set read before write on this output port. Read before write indicates that an element will be read from the input before a corresponding element is written to an element from this output.
This property implies that the input buffer can be used as an output buffer duing a call to the work operation. Also referred to as buffer inlining, the intention is to keep more memory in cache by using the same buffer for both reading and writing operations when possible.
When this "read before write" property is enabled, and the only reference to the buffer is held by the input port, and the size of the input elements is the same as the output. then the input buffer may be substituted for an output buffer.
- Parameters
-
port | the input port to borrow the buffer from |
◆ setReserve()
void Pothos::OutputPort::setReserve |
( |
const size_t |
numElements | ) |
|
|
inline |
Set a reserve requirement on this output port. The reserve size ensures that when sufficient resources are available, the buffer will contain at least the specified number of elements. By default, each output port has a reserve of zero elements, which means that the output port's buffer may be any size, but not empty, depending upon the available resources. Note that work() may still be called when the reserve is not met, because the scheduler will only prevent work() from being called when any given port has no available output elements.
- Parameters
-
numElements | the number of elements to require |
◆ totalBuffers()
unsigned long long Pothos::OutputPort::totalBuffers |
( |
void |
| ) |
const |
|
inline |
Get the total number of buffers produced from this port. This value will increment immediately after postBuffer(). This call will also increment after every work execution where elements are produced using the produce() method.
◆ totalElements()
unsigned long long Pothos::OutputPort::totalElements |
( |
void |
| ) |
const |
|
inline |
Get the total number of elements produced from this port. The value returned by this method will not change until after execution of work() and propagateLabels().
◆ totalLabels()
unsigned long long Pothos::OutputPort::totalLabels |
( |
void |
| ) |
const |
|
inline |
Get the total number of labels produced from this port. This value will increment immediately after postLabel().
◆ totalMessages()
unsigned long long Pothos::OutputPort::totalMessages |
( |
void |
| ) |
const |
|
inline |
Get the total number of messages posted to this port. The value returned by this method will be incremented immediately upon calling postMessage().
◆ InputPort
◆ WorkerActor
The documentation for this class was generated from the following files: