Class Node::Output

Nested Relationships

This class is a nested type of Class Node.

Nested Types

Class Documentation

class Output

Public Types

enum class Type

Values:

enumerator MSender
enumerator SSender

Public Functions

virtual ~Output() = default
inline Output(Node &par, OutputDescription desc, bool ref = true)
inline Node &getParent()
inline const Node &getParent() const
std::string toString() const

Output to string representation.

inline std::string getName() const

Get name of the output

inline std::string getGroup() const

Get group of the output

inline void setGroup(std::string group)

Set group name for this output

inline void setName(std::string name)

Set name for this output

inline Type getType() const

Get type of the output

std::vector<DatatypeHierarchy> getPossibleDatatypes() const

Get possible datatypes that can be sent

void setPossibleDatatypes(std::vector<DatatypeHierarchy> types)

Set possible datatypes that can be sent

bool isSamePipeline(const Input &in)

Check if this output and given input are on the same pipeline.

See also

canConnect for checking if connection is possible

Returns:

True if output and input are on the same pipeline

bool canConnect(const Input &in)

Check if connection is possible

Parameters:

inInput to connect to

Returns:

True if connection is possible, false otherwise

std::vector<ConnectionInternal> getConnections()

Retrieve all connections from this output

Returns:

Vector of connections

inline std::vector<QueueConnection> getQueueConnections()

Retrieve all queue connections from this output

Returns:

Vector of queue connections

std::shared_ptr<dai::MessageQueue> createOutputQueue(unsigned int maxSize = OUTPUT_QUEUE_DEFAULT_MAX_SIZE, bool blocking = OUTPUT_QUEUE_DEFAULT_BLOCKING)

Construct and return a shared pointer to an output message queue.

Parameters:
  • maxSize – Maximum size of the output queue

  • blocking – Whether the output queue should block when full

Returns:

std::shared_ptr<dai::MessageQueue>: shared pointer to an output queue

void link(Input &in)

Link current output to input.

Throws an error if this output cannot be linked to given input, or if they are already linked

Parameters:

inInput to link to

virtual void link(std::shared_ptr<Node> in)
void unlink(Input &in)

Unlink a previously linked connection

Throws an error if not linked.

Parameters:

inInput from which to unlink from

void send(const std::shared_ptr<ADatatype> &msg)

Sends a Message to all connected inputs

Parameters:

msg – Message to send to all connected inputs

bool trySend(const std::shared_ptr<ADatatype> &msg)

Try sending a message to all connected inputs

Parameters:

msg – Message to send to all connected inputs

Returns:

True if ALL connected inputs got the message, false otherwise

Public Static Attributes

static constexpr bool OUTPUT_QUEUE_DEFAULT_BLOCKING = false

Default value for the blocking argument in the createOutputQueue method

static constexpr unsigned int OUTPUT_QUEUE_DEFAULT_MAX_SIZE = 16

Default value for the maxSize argument in the createOutputQueue method

struct QueueConnection

Public Functions

inline bool operator==(const QueueConnection &rhs) const

Public Members

Output *output
std::shared_ptr<MessageQueue> queue