diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-06-03 23:28:19 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:24 -0800 |
commit | 01f08d3fa5ae0cd8a2fc3c6e1112117a1f7f9768 (patch) | |
tree | 7fb49f7e0ab5329c29c292df001cd61390eae5f0 /host/include | |
parent | 802afa6eecee368ec8e28044ce22fd39c0f93ae8 (diff) | |
download | uhd-01f08d3fa5ae0cd8a2fc3c6e1112117a1f7f9768.tar.gz uhd-01f08d3fa5ae0cd8a2fc3c6e1112117a1f7f9768.tar.bz2 uhd-01f08d3fa5ae0cd8a2fc3c6e1112117a1f7f9768.zip |
rfnoc: Add check_topology() API to nodes
This API lets blocks decide if their current topology is OK for them,
and make decisions based on their topology.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc/node.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/node.hpp b/host/include/uhd/rfnoc/node.hpp index 09ae76e9a..f9a1272e1 100644 --- a/host/include/uhd/rfnoc/node.hpp +++ b/host/include/uhd/rfnoc/node.hpp @@ -324,7 +324,35 @@ protected: */ void post_action(const res_source_info& edge_info, action_info::sptr action); + /************************************************************************** + * Graph Interaction + *************************************************************************/ + /*! Check if the current connections "work" for this block + * + * The default implementation simply checks if all connections are within + * the valid range, i.e., no \p connected_inputs element is larger than + * get_num_input_ports(), etc. This can be overridden, but keep in mind that + * blocks need some kind of tolerance here, because blocks may simply not + * be part of the current application, and left unconnected. This check is + * more meant for blocks that simply don't work of only one of two ports is + * connected, or situations like that. + * + * Note that this method is always called when a graph is committed, i.e., + * no connections will be added or removed without calling this method + * again, unless the user bypasses calling uhd::rfnoc_graph::commit(). This + * method can therefore be used to make decisions about the behaviour of + * the block. + * + * \param connected_inputs A list of input ports that are connected + * \param connected_outputs A list of output ports that are connected + * \returns true if the block can deal with this configuration + */ + virtual bool check_topology(const std::vector<size_t>& connected_inputs, + const std::vector<size_t>& connected_outputs); + /************************************************************************** + * Attributes + *************************************************************************/ //! A dirtifyer object, useful for properties that always need updating. static dirtifier_t ALWAYS_DIRTY; |