.. index:: pair: class; ComputationalGraphManager .. _doxid-class_computational_graph_manager: class ComputationalGraphManager =============================== .. toctree:: :hidden: Overview ~~~~~~~~ Singleton class managing a computational graph. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ComputationalGraphManager { public: // construction :target:`ComputationalGraphManager`(const ComputationalGraphManager&); :target:`ComputationalGraphManager`(ComputationalGraphManager&&); // methods ComputationalGraphManager& :target:`operator =` (const ComputationalGraphManager&); ComputationalGraphManager& :target:`operator =` (ComputationalGraphManager&&); void :ref:`registerNode`(std::shared_ptr<:ref:`ComputationalNode`>& obj); :ref:`ComputationalNode`* :ref:`getNode`(const std::string& id); template void :ref:`registerEdge`( :ref:`OutputPort`* source, :ref:`InputPort`* target ); void :ref:`compute`(); void :ref:`configure`(); void :ref:`graphLoadComplete`(); void :ref:`clear`(); void :target:`setExecMode`(:ref:`ComputationalGraph::ExecMode` mode); :ref:`ComputationalGraph::ExecMode` :target:`getExecMode`(); static ComputationalGraphManager& :ref:`getInstance`(); static ComputationalGraphManager& :ref:`resetInstance`(); }; .. _details-class_computational_graph_manager: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Singleton class managing a computational graph. :ref:`ComputationalGraph ` is only concerned about the graph structure and node execution policies while :ref:`ComputationalGraphManager ` remains responsible for managing the registration of nodes and edges, establishing the actual connections between ports. It owns a :ref:`ComputationalGraph ` and all its nodes. Methods ------- .. index:: pair: function; registerNode .. _doxid-class_computational_graph_manager_1a7b38bb941eb386e6e0916c16cac42b1f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void registerNode(std::shared_ptr<:ref:`ComputationalNode`>& obj) 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' .. index:: pair: function; getNode .. _doxid-class_computational_graph_manager_1ae9cd43ae91337c6e03560b103e351576: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ComputationalNode`* getNode(const std::string& id) Retrieve a node from the graph as a pointer. .. index:: pair: function; registerEdge .. _doxid-class_computational_graph_manager_1a5d7431300f653e18148582567bf37245: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void registerEdge( :ref:`OutputPort`* source, :ref:`InputPort`* target ) Connects an :ref:`InputPort ` to an Output port and registers an edge in the graph between their parent nodes. .. index:: pair: function; compute .. _doxid-class_computational_graph_manager_1a1b51f786dd259e77e05bf1c896fc0dd8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void compute() Executes :ref:`ComputationalGraph `. .. index:: pair: function; configure .. _doxid-class_computational_graph_manager_1adf61b9d197bbf95706861ce168b6efc8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configure() Configure :ref:`ComputationalGraph `. .. index:: pair: function; graphLoadComplete .. _doxid-class_computational_graph_manager_1a41741c569a765ad8351ed8b6fb63dae3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void graphLoadComplete() Function to be called externally after all nodes has been added to the graph. .. index:: pair: function; clear .. _doxid-class_computational_graph_manager_1a79bd3ff2515d3187cda2b8352d923f10: .. ref-code-block:: cpp :class: doxyrest-title-code-block void clear() Resets :ref:`ComputationalGraphManager `. .. index:: pair: function; getInstance .. _doxid-class_computational_graph_manager_1a1b4d16e1a98a63d7708b441086b6fc38: .. ref-code-block:: cpp :class: doxyrest-title-code-block static ComputationalGraphManager& getInstance() Get singleton instance of :ref:`ComputationalGraphManager `. .. index:: pair: function; resetInstance .. _doxid-class_computational_graph_manager_1a52657671dec81d2e391ddbee0aa92839: .. ref-code-block:: cpp :class: doxyrest-title-code-block static ComputationalGraphManager& resetInstance() Reset singleton instance.