NRP Core  1.4.1
ComputationalGraphManager Class Reference

Singleton class managing a computational graph. More...

#include <computational_graph_manager.h>

Public Member Functions

virtual ~ComputationalGraphManager ()
 
 ComputationalGraphManager (const ComputationalGraphManager &)=delete
 
 ComputationalGraphManager (ComputationalGraphManager &&)=delete
 
ComputationalGraphManageroperator= (const ComputationalGraphManager &)=delete
 
ComputationalGraphManageroperator= (ComputationalGraphManager &&)=delete
 
void registerNode (std::shared_ptr< ComputationalNode > &obj)
 Register a node in the graph. More...
 
ComputationalNodegetNode (const std::string &id)
 Retrieve a node from the graph as a pointer. More...
 
template<class T_IN , class T_OUT >
void registerEdge (OutputPort< T_IN > *source, InputPort< T_IN, T_OUT > *target)
 Connects an InputPort to an Output port and registers an edge in the graph between their parent nodes. More...
 
void compute ()
 Executes ComputationalGraph. More...
 
void configure ()
 Configure ComputationalGraph. More...
 
void graphLoadComplete ()
 Function to be called externally after all nodes has been added to the graph. More...
 
void clear ()
 Resets ComputationalGraphManager. More...
 
void setExecMode (ComputationalGraph::ExecMode mode)
 
ComputationalGraph::ExecMode getExecMode ()
 

Static Public Member Functions

static ComputationalGraphManagergetInstance ()
 Get singleton instance of ComputationalGraphManager. More...
 
static ComputationalGraphManagerresetInstance ()
 Reset singleton instance. More...
 

Detailed Description

Singleton class managing a computational graph.

ComputationalGraph is only concerned about the graph structure and node execution policies while ComputationalGraphManager remains responsible for managing the registration of nodes and edges, establishing the actual connections between ports. It owns a ComputationalGraph and all its nodes.

Constructor & Destructor Documentation

◆ ~ComputationalGraphManager()

ComputationalGraphManager::~ComputationalGraphManager ( )
virtual

◆ ComputationalGraphManager() [1/2]

ComputationalGraphManager::ComputationalGraphManager ( const ComputationalGraphManager )
delete

◆ ComputationalGraphManager() [2/2]

ComputationalGraphManager::ComputationalGraphManager ( ComputationalGraphManager &&  )
delete

Member Function Documentation

◆ clear()

void ComputationalGraphManager::clear ( )
inline

◆ compute()

void ComputationalGraphManager::compute ( )
inline

Executes ComputationalGraph.

◆ configure()

void ComputationalGraphManager::configure ( )
inline

Configure ComputationalGraph.

◆ getExecMode()

ComputationalGraph::ExecMode ComputationalGraphManager::getExecMode ( )
inline

◆ getInstance()

ComputationalGraphManager & ComputationalGraphManager::getInstance ( )
static

Get singleton instance of ComputationalGraphManager.

◆ getNode()

ComputationalNode* ComputationalGraphManager::getNode ( const std::string &  id)
inline

Retrieve a node from the graph as a pointer.

◆ graphLoadComplete()

void ComputationalGraphManager::graphLoadComplete ( )
inline

Function to be called externally after all nodes has been added to the graph.

◆ operator=() [1/2]

ComputationalGraphManager& ComputationalGraphManager::operator= ( ComputationalGraphManager &&  )
delete

◆ operator=() [2/2]

ComputationalGraphManager& ComputationalGraphManager::operator= ( const ComputationalGraphManager )
delete

◆ registerEdge()

template<class T_IN , class T_OUT >
void ComputationalGraphManager::registerEdge ( OutputPort< T_IN > *  source,
InputPort< T_IN, T_OUT > *  target 
)
inline

Connects an InputPort to an Output port and registers an edge in the graph between their parent nodes.

◆ registerNode()

void ComputationalGraphManager::registerNode ( std::shared_ptr< ComputationalNode > &  obj)
inline

Register a node in the graph.

If the node is of type 'Functional', an attempt to register a node with an 'id' already existing is considered an error and an exception is thrown. If the type is different to 'Functional' the new node is not registered and the reference obj is shifted to the existing node with the same 'id'

◆ resetInstance()

ComputationalGraphManager & ComputationalGraphManager::resetInstance ( )
static

Reset singleton instance.

◆ setExecMode()

void ComputationalGraphManager::setExecMode ( ComputationalGraph::ExecMode  mode)
inline

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