class ComputationalNode¶
Overview¶
Base class implementing a node in the computational graph. More…
#include <computational_node.h> class ComputationalNode { public: // enums enum NodeType; // fields static const static std::map<NodeType, std::string> nodeTypeStr = {{ComputationalNode::Input, "Input"}, {ComputationalNode::Output, "Output"}, {ComputationalNode::Functional, "Functional"}}; // construction ComputationalNode(); ComputationalNode(std::string id, NodeType type); // 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; }; // direct descendants template <typename... INPUT_TYPES, typename... OUTPUT_TYPES> class FunctionalNode<std::tuple<INPUT_TYPES...>, std::tuple<OUTPUT_TYPES...>>; template <class DATA> class InputNode; template <class DATA> class OutputNode;
Detailed Documentation¶
Base class implementing a node in the computational graph.
Methods¶
const std::string& id() const
Returns the node ‘id’.
NodeType type() const
Returns the node ‘type’.
virtual std::string typeStr() const
Returns the node ‘type’ as a string.
void setVisited(bool visited)
Sets a value for the node ‘visited’ property, used for graph traversing.
bool isVisited() const
Returns true if the node has been marked as visited, false otherwise.
void setDoCompute(bool doCompute)
Sets a value for the node ‘doCompute’ property, used in some graph execution modes.
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