diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-07-29 14:06:39 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:34 -0800 |
commit | bf986d32632199917dc811f00465ecf409c64a76 (patch) | |
tree | 161ba1b536fac92ff2d82722cb24fbbbf3ce86d1 /host/tests/rfnoc_graph_mock_nodes.hpp | |
parent | c19b80a5d7fac51c0efcb265b1be81e9982dd153 (diff) | |
download | uhd-bf986d32632199917dc811f00465ecf409c64a76.tar.gz uhd-bf986d32632199917dc811f00465ecf409c64a76.tar.bz2 uhd-bf986d32632199917dc811f00465ecf409c64a76.zip |
rfnoc: Add DUC block controller
Diffstat (limited to 'host/tests/rfnoc_graph_mock_nodes.hpp')
-rw-r--r-- | host/tests/rfnoc_graph_mock_nodes.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/host/tests/rfnoc_graph_mock_nodes.hpp b/host/tests/rfnoc_graph_mock_nodes.hpp index 63e8bc534..c28256b67 100644 --- a/host/tests/rfnoc_graph_mock_nodes.hpp +++ b/host/tests/rfnoc_graph_mock_nodes.hpp @@ -11,6 +11,7 @@ #include <uhd/rfnoc/node.hpp> #include <uhd/types/stream_cmd.hpp> #include <uhdlib/rfnoc/node_accessor.hpp> +#include <list> using namespace uhd::rfnoc; @@ -358,11 +359,22 @@ class mock_terminator_t : public node_t public: static size_t counter; - mock_terminator_t(const size_t num_ports) + mock_terminator_t( + const size_t num_ports, const std::vector<std::string> expected_actions = {}) : _num_ports(num_ports), _term_count(counter++) { set_prop_forwarding_policy(forwarding_policy_t::DROP); set_action_forwarding_policy(forwarding_policy_t::DROP); + for (const auto& action_key : expected_actions) { + RFNOC_LOG_DEBUG("Adding action handler for key " << action_key); + register_action_handler( + action_key, [this](const res_source_info& src, action_info::sptr action) { + RFNOC_LOG_INFO( + "Received action: key=" << action->key << ", id=" << action->id + << ", src edge=" << src.to_string()); + received_actions.push_back(action); + }); + } } std::string get_unique_id() const @@ -405,6 +417,8 @@ public: return get_property<data_t>(id, edge_info); } + std::list<action_info::sptr> received_actions; + private: const size_t _num_ports; const size_t _term_count; |