NRP Core  1.4.1
FunctionalNodeBase Class Reference

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

#include <functional_node.h>

Inheritance diagram for FunctionalNodeBase:
ComputationalNode FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >

Public Member Functions

 FunctionalNodeBase (const std::string &id)
 
virtual PortgetInputById (const std::string &)
 Returns an InputPort by id. More...
 
virtual PortgetOutputById (const std::string &)
 Returns an OutputPort by id. More...
 
void configure () override
 Configures the node making it ready to execute 'compute'. More...
 
void compute () override
 Requests the node to execute its computation. More...
 
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. More...
 
- Public Member Functions inherited from ComputationalNode
 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...
 

Protected Member Functions

void graphLoadedCB () override
 Function called by the Computational Graph to nodes that the graph has been completely loaded. More...
 
virtual void createEdge (const std::string &, Port *)
 Create an edge in the graph between this node 'port_id' input port and o_port. More...
 
void clearEdgeRequests ()
 
- Protected Member Functions inherited from ComputationalNode
virtual void graphCycleStartCB ()
 Function called by the Computational Graph at the beginning of a new execution cycle. More...
 

Friends

class ComputationalGraphPythonNodes_F2F_EDGES_Test
 

Additional Inherited Members

- Public Types inherited from ComputationalNode
enum  NodeType { Input, Output, Functional }
 All the possible node types. More...
 
- Static Public Member Functions inherited from ComputationalNode
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 inherited from ComputationalNode
const static std::map< NodeType, std::string > nodeTypeStr
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FunctionalNodeBase()

FunctionalNodeBase::FunctionalNodeBase ( const std::string &  id)
inline

Member Function Documentation

◆ clearEdgeRequests()

void FunctionalNodeBase::clearEdgeRequests ( )
inlineprotected

◆ compute()

void FunctionalNodeBase::compute ( )
inlineoverridevirtual

Requests the node to execute its computation.

Implements ComputationalNode.

Reimplemented in FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >.

◆ configure()

void FunctionalNodeBase::configure ( )
inlineoverridevirtual

Configures the node making it ready to execute 'compute'.

Implements ComputationalNode.

Reimplemented in FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >.

◆ createEdge()

virtual void FunctionalNodeBase::createEdge ( const std::string &  ,
Port  
)
inlineprotectedvirtual

Create an edge in the graph between this node 'port_id' input port and o_port.

Reimplemented in FunctionalNode< std::tuple< INPUT_TYPES... >, std::tuple< OUTPUT_TYPES... > >.

◆ getInputById()

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

◆ getOutputById()

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

◆ graphLoadedCB()

void FunctionalNodeBase::graphLoadedCB ( )
inlineoverrideprotectedvirtual

Function called by the Computational Graph to nodes that the graph has been completely loaded.

Reimplemented from ComputationalNode.

◆ registerF2FEdge()

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

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.

Friends And Related Function Documentation

◆ ComputationalGraphPythonNodes_F2F_EDGES_Test

friend class ComputationalGraphPythonNodes_F2F_EDGES_Test
friend

The documentation for this class was generated from the following file: