From 8d9ae5b37b4f0c5339fffc138332c9afdf65b11d Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 29 Sep 2016 14:23:50 -0700 Subject: rfnoc nodes: Disconnect on destruct --- host/include/uhd/rfnoc/node_ctrl_base.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/node_ctrl_base.hpp b/host/include/uhd/rfnoc/node_ctrl_base.hpp index 82e095b1d..071de803c 100644 --- a/host/include/uhd/rfnoc/node_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/node_ctrl_base.hpp @@ -65,6 +65,18 @@ public: node_map_t list_downstream_nodes() { return _downstream_nodes; }; node_map_t list_upstream_nodes() { return _upstream_nodes; }; + /*! Disconnect this node from all neighbouring nodes. + */ + void disconnect(); + + /*! Identify \p output_port as unconnected + */ + void disconnect_output_port(const size_t output_port); + + /*! Identify \p input_port as unconnected + */ + void disconnect_input_port(const size_t input_port); + // TODO we need a more atomic connect procedure, this is too error-prone. /*! For an existing connection, store the remote port number. @@ -156,8 +168,8 @@ protected: /*********************************************************************** * Structors **********************************************************************/ - node_ctrl_base(void) {}; - virtual ~node_ctrl_base() {}; + node_ctrl_base(void) {} + virtual ~node_ctrl_base() { disconnect(); } /*********************************************************************** * Protected members -- cgit v1.2.3