Base class implementing a node in the computational graph. More...
#include <computational_node.h>
Public Types | |
enum | NodeType { Input, Output, Functional } |
All the possible node types. More... | |
Public Member Functions | |
ComputationalNode ()=delete | |
virtual | ~ComputationalNode ()=default |
ComputationalNode (std::string id, NodeType type) | |
Constructor. More... | |
const std::string & | id () const |
Returns the node 'id'. More... | |
NodeType | type () const |
Returns the node 'type'. More... | |
virtual std::string | typeStr () const |
Returns the node 'type' as a string. More... | |
void | setVisited (bool visited) |
Sets a value for the node 'visited' property, used for graph traversing. More... | |
bool | isVisited () const |
Returns true if the node has been marked as visited, false otherwise. More... | |
void | setDoCompute (bool doCompute) |
Sets a value for the node 'doCompute' property, used in some graph execution modes. More... | |
virtual bool | doCompute () const |
Tells if this node should be executed in this graph execution cycle, used in some graph execution modes. More... | |
Static Public Member Functions | |
static std::pair< std::string, std::string > | parseNodeAddress (const std::string &address, bool hasPort=true) |
Parses a computational node address returning the node id and the port (if any) contained in the address. More... | |
Static Public Attributes | |
const static std::map< NodeType, std::string > | nodeTypeStr |
Protected Member Functions | |
virtual void | configure ()=0 |
Configures the node making it ready to execute 'compute'. More... | |
virtual void | compute ()=0 |
Requests the node to execute its computation. More... | |
virtual void | graphCycleStartCB () |
Function called by the Computational Graph at the beginning of a new execution cycle. More... | |
virtual void | graphLoadedCB () |
Function called by the Computational Graph to nodes that the graph has been completely loaded. More... | |
Friends | |
class | ComputationalGraph |
class | ComputationalGraphManager |
class | ComputationalGraphPythonNodes_PYTHON_DECORATORS_BASIC_Test |
Base class implementing a node in the computational graph.
|
delete |
|
virtualdefault |
|
inline |
Constructor.
|
protectedpure virtual |
Requests the node to execute its computation.
Implemented in FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >, InputNode< DATA >, InputNode< MSG_TYPE >, InputNode< ulong >, InputNode< boost::python::object >, InputNode< nlohmann::json >, InputNode< DataPack< MSG_TYPE > >, InputNode< DataPackInterface >, OutputNode< DATA >, OutputNode< DataPack< MSG_TYPE > * >, OutputNode< MSG_TYPE >, OutputNode< boost::python::object >, OutputNode< nlohmann::json >, OutputNode< DataPackInterface * >, and FunctionalNodeBase.
|
protectedpure virtual |
Configures the node making it ready to execute 'compute'.
Implemented in FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >, OutputNode< DATA >, OutputNode< DataPack< MSG_TYPE > * >, OutputNode< MSG_TYPE >, OutputNode< boost::python::object >, OutputNode< nlohmann::json >, OutputNode< DataPackInterface * >, InputEngineNode, InputSpinnakerNode, FunctionalNodeBase, OutputSpinnakerNode, InputMQTTNode< MSG_TYPE >, InputMQTTNode< DataPack< MSG_TYPE > >, InputROSNode< MSG_TYPE >, InputTimeBaseNode, and InputDummy.
|
inlinevirtual |
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
Reimplemented in OutputNode< DATA >.
|
inlineprotectedvirtual |
Function called by the Computational Graph at the beginning of a new execution cycle.
Reimplemented in OutputNode< DATA >, OutputNode< DataPack< MSG_TYPE > * >, OutputNode< MSG_TYPE >, OutputNode< boost::python::object >, OutputNode< nlohmann::json >, and OutputNode< DataPackInterface * >.
|
inlineprotectedvirtual |
Function called by the Computational Graph to nodes that the graph has been completely loaded.
Reimplemented in FunctionalNodeBase.
|
inline |
Returns the node 'id'.
|
inline |
Returns true if the node has been marked as visited, false otherwise.
|
inlinestatic |
Parses a computational node address returning the node id and the port (if any) contained in the address.
address | string containing a computational graph connection address with the format /node_id/port_id |
hasPort | if the address contains a port id or just a node id |
|
inline |
Sets a value for the node 'doCompute' property, used in some graph execution modes.
|
inline |
Sets a value for the node 'visited' property, used for graph traversing.
|
inline |
Returns the node 'type'.
|
inlinevirtual |
Returns the node 'type' as a string.
Reimplemented in OutputMQTTNode< MSG_TYPE >, InputMQTTNode< MSG_TYPE >, OutputEngineNode, OutputROSNode< MSG_TYPE >, InputEngineNode, InputROSNode< MSG_TYPE >, InputSpinnakerNode, and OutputSpinnakerNode.
|
friend |
|
friend |
|
friend |
|
static |