Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Friends | List of all members
Pothos::OutputPort Class Reference

#include <OutputPort.hpp>

Public Member Functions

 ~OutputPort (void)
 Destructor. More...
 
int index (void) const
 
const std::string & name (void) const
 Get the string name identifier for this port. More...
 
const DTypedtype (void) const
 Get the data type information for this port. More...
 
const std::string & domain (void) const
 Get the domain information for this port. More...
 
const BufferChunkbuffer (void) const
 
size_t elements (void) const
 
unsigned long long totalElements (void) const
 
unsigned long long totalBuffers (void) const
 
unsigned long long totalLabels (void) const
 
unsigned long long totalMessages (void) const
 
void produce (const size_t numElements)
 
void popBuffer (const size_t numBytes)
 
void postLabel (const Label &label)
 
template<typename ValueType >
void postMessage (ValueType &&message)
 
void postBuffer (const BufferChunk &buffer)
 
bool isSignal (void) const
 
void setReadBeforeWrite (InputPort *port)
 

Friends

class WorkerActor
 
class InputPort
 

Detailed Description

OutputPort provides methods to interact with a worker's output ports.

Constructor & Destructor Documentation

Pothos::OutputPort::~OutputPort ( void  )

Destructor.

Member Function Documentation

const Pothos::BufferChunk & Pothos::OutputPort::buffer ( void  ) const
inline

Get access to the stream buffer. For non-stream ports, this returns an empty buffer chunk.

const std::string & Pothos::OutputPort::domain ( void  ) const
inline

Get the domain information for this port.

const Pothos::DType & Pothos::OutputPort::dtype ( void  ) const
inline

Get the data type information for this port.

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.

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
bool Pothos::OutputPort::isSignal ( void  ) const
inline

Is this port used for signaling in a signals + slots paradigm?

const std::string & Pothos::OutputPort::name ( void  ) const
inline

Get the string name identifier for this port.

void Pothos::OutputPort::popBuffer ( const size_t  numBytes)
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 bytes should be less than or equal to the bytes available and a multiple of the element size.

Parameters
numBytesthe number of bytes to remove
void Pothos::OutputPort::postBuffer ( const BufferChunk 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
bufferthe buffer to post
void Pothos::OutputPort::postLabel ( const Label label)
inline

Post an output label to the subscribers on this port.

Parameters
labelthe label to post
template<typename ValueType >
void Pothos::OutputPort::postMessage ( ValueType &&  message)

Post an output message to the subscribers on this port.

Parameters
messagethe message to post
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
numElementsthe number of elements to produce
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
portthe input port to borrow the buffer from
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.

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().

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().

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().

Friends And Related Function Documentation

friend class InputPort
friend
friend class WorkerActor
friend

The documentation for this class was generated from the following files: