template class InputPort

Overview

Implementation of an input port in the computation graph. More…

#include <input_port.h>

template <class T_IN, class T_OUT>
class InputPort: public Port {
public:
    // construction

    InputPort(
        const std::string& id,
        ComputationalNode* parent,
        std::function<void(const T_OUT*)> callback,
        std::size_t maxSubs = 0
    );

    // methods

    void subscribeTo(OutputPort<T_IN>* port);
    virtual size_t subscriptionsSize();
    size_t subscriptionsMax();
};

Inherited Members

public:
    // methods

    const std::string& id();
    ComputationalNode* parent() const;
    virtual size_t subscriptionsSize() = 0;

Detailed Documentation

Implementation of an input port in the computation graph.

It converts and passes incoming msgs using a callback function

Construction

InputPort(
    const std::string& id,
    ComputationalNode* parent,
    std::function<void(const T_OUT*)> callback,
    std::size_t maxSubs = 0
)

Constructor.

Methods

void subscribeTo(OutputPort<T_IN>* port)

Subscribes this port to an OutputPort ‘port’.

virtual size_t subscriptionsSize()

Return the number ports this port is subscribed to.

size_t subscriptionsMax()

Return the number ports this port is subscribed to.