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::InputPort Class Reference

#include <InputPort.hpp>

Public Member Functions

 ~InputPort (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
 
bool hasMessage (void)
 Does the specified input port have an asynchronous message available? More...
 
const LabelIteratorRangelabels (void) const
 
void removeLabel (const Label &label)
 
void consume (const size_t numElements)
 
Object popMessage (void)
 
void setReserve (const size_t numElements)
 
bool isSlot (void) const
 
void pushBuffer (const BufferChunk &buffer)
 
void pushLabel (const Label &label)
 
void pushMessage (const Object &message)
 
void clear (void)
 

Friends

class WorkerActor
 
class OutputPort
 

Detailed Description

InputPort provides methods to interact with a worker's input ports.

Constructor & Destructor Documentation

Pothos::InputPort::~InputPort ( void  )

Destructor.

Member Function Documentation

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

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
numElementsthe number of elements to consume
const std::string & Pothos::InputPort::domain ( void  ) const
inline

Get the domain information for this port.

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

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?

const Pothos::LabelIteratorRange & Pothos::InputPort::labels ( void  ) const
inline

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.

Pothos::Object Pothos::InputPort::popMessage ( void  )
inline

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

Friends And Related Function Documentation

friend class OutputPort
friend
friend class WorkerActor
friend

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