class FunctionalNodeBase

Overview

Non-abstract, non-templated base class for the FunctionalNode class. More…

#include <functional_node.h>

class FunctionalNodeBase: public ComputationalNode {
public:
    // construction

    FunctionalNodeBase(const std::string& id);

    // methods

    virtual Port* getInputById(const std::string&);
    virtual Port* getOutputById(const std::string&);
    virtual void configure();
    virtual void compute();
    void registerF2FEdge(const std::string& i_port, const std::string& address);
};

// direct descendants

template <typename... INPUT_TYPES, typename... OUTPUT_TYPES>
class FunctionalNode<std::tuple<INPUT_TYPES...>, std::tuple<OUTPUT_TYPES...>>;

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

Non-abstract, non-templated base class for the FunctionalNode class.

Its existence is necessary for storing and manipulating functional nodes in the creation of Computaional Graph edges

Methods

virtual Port* getInputById(const std::string&)

Returns an InputPort by id.

virtual Port* getOutputById(const std::string&)

Returns an OutputPort by id.

virtual void configure()

Configures the node making it ready to execute ‘compute’.

virtual void compute()

Requests the node to execute its computation.

void registerF2FEdge(const std::string& i_port, const std::string& address)

Request the registration of an edge between an output port in another functional node an i_port input port in this node.

Creating edges between FNs requires that all FNs has been created. Thus the edges are only created from ‘graphLoadedCB’ callback, which is called externally when all nodes have been created.

A ComputationalGraphManager is used to access other nodes, so this function assumes that a ComputationalGraphManager has been instantiated and it is been used to store and manage graph nodes, this is the usual case.