diff options
Diffstat (limited to 'host/lib/rfnoc/tick_node_ctrl.cpp')
-rw-r--r-- | host/lib/rfnoc/tick_node_ctrl.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/host/lib/rfnoc/tick_node_ctrl.cpp b/host/lib/rfnoc/tick_node_ctrl.cpp index f8e422a51..84edd92db 100644 --- a/host/lib/rfnoc/tick_node_ctrl.cpp +++ b/host/lib/rfnoc/tick_node_ctrl.cpp @@ -12,8 +12,8 @@ using namespace uhd::rfnoc; const double tick_node_ctrl::RATE_UNDEFINED = 0; double tick_node_ctrl::get_tick_rate( - const std::set< node_ctrl_base::sptr > &_explored_nodes -) { + const std::set<node_ctrl_base::sptr>& _explored_nodes) +{ // First, see if we've implemented _get_tick_rate() { double my_tick_rate = _get_tick_rate(); @@ -24,20 +24,20 @@ double tick_node_ctrl::get_tick_rate( // If not, we ask all our neighbours for the tick rate. // This will fail if we get different values. - std::set< node_ctrl_base::sptr > explored_nodes(_explored_nodes); + std::set<node_ctrl_base::sptr> explored_nodes(_explored_nodes); explored_nodes.insert(shared_from_this()); // Here, we need all up- and downstream nodes - std::vector< sptr > neighbouring_tick_nodes = find_downstream_node<tick_node_ctrl>(true); + std::vector<sptr> neighbouring_tick_nodes = + find_downstream_node<tick_node_ctrl>(true); { - std::vector< sptr > upstream_neighbouring_tick_nodes = find_upstream_node<tick_node_ctrl>(true); - neighbouring_tick_nodes.insert( - neighbouring_tick_nodes.end(), - upstream_neighbouring_tick_nodes.begin(), - upstream_neighbouring_tick_nodes.end() - ); + std::vector<sptr> upstream_neighbouring_tick_nodes = + find_upstream_node<tick_node_ctrl>(true); + neighbouring_tick_nodes.insert(neighbouring_tick_nodes.end(), + upstream_neighbouring_tick_nodes.begin(), + upstream_neighbouring_tick_nodes.end()); } // neighbouring_tick_nodes is now initialized double ret_val = RATE_UNDEFINED; - for(const sptr &node: neighbouring_tick_nodes) { + for (const sptr& node : neighbouring_tick_nodes) { if (_explored_nodes.count(node)) { continue; } @@ -47,19 +47,17 @@ double tick_node_ctrl::get_tick_rate( } if (ret_val == RATE_UNDEFINED) { ret_val = tick_rate; - // TODO: Remember name of this node so we can make the throw message more descriptive. + // TODO: Remember name of this node so we can make the throw message more + // descriptive. continue; } if (tick_rate != ret_val) { - throw uhd::runtime_error( - str( - // TODO add node names - boost::format("Conflicting tick rates: One neighbouring block specifies %d MHz, another %d MHz.") - % tick_rate % ret_val - ) - ); + throw uhd::runtime_error(str( + // TODO add node names + boost::format("Conflicting tick rates: One neighbouring block specifies " + "%d MHz, another %d MHz.") + % tick_rate % ret_val)); } } return ret_val; } - |