template class OutputNode

Overview

Implementation of an output node in the computation graph. More…

#include <output_node.h>

template <class DATA>
class OutputNode: public ComputationalNode {
public:
    // construction

    OutputNode(
        const std::string& id,
        OutputNodePolicies::PublishFormatPolicy publishFormatPolicy = OutputNodePolicies::PublishFormatPolicy::SERIES,
        bool publishFromCache = false,
        int maxPortConnections = 0,
        unsigned int computePeriod = 1
    );

    // methods

    template <class T_IN>
    InputPort<T_IN, DATA>* getOrRegisterInput(const std::string& id);

    unsigned int getComputePeriod();
    void setComputePeriod(unsigned int computePeriod);
    bool publishFromCache();
    virtual bool doCompute() const;
};

// direct descendants

class OutputDummy;
class OutputEngineNode;

template <class MSG_TYPE>
class OutputMQTTNode;

template <class MSG_TYPE>
class OutputROSNode;

class OutputSpinnakerNode;

Inherited Members

public:
    // enums

    enum NodeType;

    // fields

    static const static std::map<NodeType, std::string> nodeTypeStr = {{ComputationalNode::Input, "Input"},                                                                                            {ComputationalNode::Output, "Output"},                                                                                            {ComputationalNode::Functional, "Functional"}};

    // methods

    const std::string& id() const;
    NodeType type() const;
    virtual std::string typeStr() const;
    void setVisited(bool visited);
    bool isVisited() const;
    void setDoCompute(bool doCompute);
    virtual bool doCompute() const;

    static std::pair<std::string, std::string> parseNodeAddress(
        const std::string& address,
        bool hasPort = true
    );

Detailed Documentation

Implementation of an output node in the computation graph.

Output nodes are the connection point to send data out of the computation graph. In its ‘compute’ operation all messages received since last ‘compute’ are sent using the ‘sendSingleMsg’ implemented by derived classes.

Construction

OutputNode(
    const std::string& id,
    OutputNodePolicies::PublishFormatPolicy publishFormatPolicy = OutputNodePolicies::PublishFormatPolicy::SERIES,
    bool publishFromCache = false,
    int maxPortConnections = 0,
    unsigned int computePeriod = 1
)

Constructor.

Methods

template <class T_IN>
InputPort<T_IN, DATA>* getOrRegisterInput(const std::string& id)

Gets or register input port to this node and returns a pointer to it.

virtual bool doCompute() const

Tells if this node should be executed in this graph execution cycle, used in some graph execution modes.

ComputationalNode returns the value of its ‘doCompute’ property. Subclasses of ComputationalNode can implement further logic that can override this value