USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
UHD and USRP Manual
source_node_ctrl.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_LIBUHD_SOURCE_NODE_CTRL_BASE_HPP
9 #define INCLUDED_LIBUHD_SOURCE_NODE_CTRL_BASE_HPP
10 
11 #include <uhd/rfnoc/constants.hpp>
13 #include <uhd/types/stream_cmd.hpp>
14 #include <boost/thread.hpp>
15 
16 namespace uhd { namespace rfnoc {
17 
23 class source_node_ctrl : virtual public node_ctrl_base
24 {
25 public:
26  /***********************************************************************
27  * Types
28  **********************************************************************/
29  typedef boost::shared_ptr<source_node_ctrl> sptr;
30  typedef std::map<size_t, boost::weak_ptr<source_node_ctrl> > node_map_t;
31  typedef std::pair<size_t, boost::weak_ptr<source_node_ctrl> > node_map_pair_t;
32 
33  /***********************************************************************
34  * Source block controls
35  **********************************************************************/
40  virtual void issue_stream_cmd(
41  const uhd::stream_cmd_t& stream_cmd, const size_t chan = 0) = 0;
42 
57  size_t connect_downstream(node_ctrl_base::sptr downstream_node,
58  size_t port = ANY_PORT,
59  const uhd::device_addr_t& args = uhd::device_addr_t());
60 
67  virtual void set_rx_streamer(bool active, const size_t port);
68 
69 protected:
80  virtual size_t _request_output_port(
81  const size_t suggested_port, const uhd::device_addr_t& args) const;
82 
83 
84 private:
87  boost::mutex _output_mutex;
88 
100  void _register_downstream_node(node_ctrl_base::sptr downstream_node, size_t port);
101 
102 }; /* class source_node_ctrl */
103 
104 }} /* namespace uhd::rfnoc */
105 
106 #endif /* INCLUDED_LIBUHD_SOURCE_NODE_CTRL_BASE_HPP */
Definition: stream_cmd.hpp:36
Definition: source_node_ctrl.hpp:23
boost::shared_ptr< source_node_ctrl > sptr
Definition: source_node_ctrl.hpp:29
virtual void issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, const size_t chan=0)=0
Definition: build_info.hpp:13
boost::shared_ptr< node_ctrl_base > sptr
Definition: node_ctrl_base.hpp:38
#define UHD_RFNOC_API
Definition: config.hpp:104
virtual size_t _request_output_port(const size_t suggested_port, const uhd::device_addr_t &args) const
size_t connect_downstream(node_ctrl_base::sptr downstream_node, size_t port=ANY_PORT, const uhd::device_addr_t &args=uhd::device_addr_t())
virtual void set_rx_streamer(bool active, const size_t port)
std::map< size_t, boost::weak_ptr< source_node_ctrl > > node_map_t
Definition: source_node_ctrl.hpp:30
std::pair< size_t, boost::weak_ptr< source_node_ctrl > > node_map_pair_t
Definition: source_node_ctrl.hpp:31
Definition: device_addr.hpp:38
Definition: node_ctrl_base.hpp:31