USRP Hardware Driver and USRP Manual  Version: 004.000.000.HEAD-0-g8773fb2c
UHD and USRP Manual
sink_node_ctrl.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014-2016 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_LIBUHD_SINK_NODE_CTRL_BASE_HPP
19 #define INCLUDED_LIBUHD_SINK_NODE_CTRL_BASE_HPP
20 
22 #include <uhd/rfnoc/constants.hpp>
24 #include <boost/thread.hpp>
25 
26 namespace uhd {
27  namespace rfnoc {
28 
34 class sink_node_ctrl : virtual public node_ctrl_base
35 {
36 public:
37  /***********************************************************************
38  * Types
39  **********************************************************************/
40  typedef boost::shared_ptr<sink_node_ctrl> sptr;
41  typedef std::map< size_t, boost::weak_ptr<sink_node_ctrl> > node_map_t;
42  typedef std::pair< size_t, boost::weak_ptr<sink_node_ctrl> > node_map_pair_t;
43 
44  /***********************************************************************
45  * Sink block controls
46  **********************************************************************/
61  size_t connect_upstream(
62  node_ctrl_base::sptr upstream_node,
63  size_t port=ANY_PORT,
65  );
66 
73  virtual void set_tx_streamer(bool active, const size_t port);
74 
75 
76 protected:
77 
85  std::map<size_t, bool> _tx_streamer_active;
86 
115  virtual size_t _request_input_port(
116  const size_t suggested_port,
117  const uhd::device_addr_t &args
118  ) const;
119 
120 private:
123  boost::mutex _input_mutex;
124 
135  void _register_upstream_node(
136  node_ctrl_base::sptr upstream_node,
137  size_t port
138  );
139 
140 }; /* class sink_node_ctrl */
141 
142 }} /* namespace uhd::rfnoc */
143 
144 #endif /* INCLUDED_LIBUHD_SINK_NODE_CTRL_BASE_HPP */
145 // vim: sw=4 et:
boost::shared_ptr< sink_node_ctrl > sptr
Definition: sink_node_ctrl.hpp:40
std::pair< size_t, boost::weak_ptr< sink_node_ctrl > > node_map_pair_t
Definition: sink_node_ctrl.hpp:42
size_t connect_upstream(node_ctrl_base::sptr upstream_node, size_t port=ANY_PORT, const uhd::device_addr_t &args=uhd::device_addr_t())
Definition: build_info.hpp:25
virtual void set_tx_streamer(bool active, const size_t port)
virtual size_t _request_input_port(const size_t suggested_port, const uhd::device_addr_t &args) const
boost::shared_ptr< node_ctrl_base > sptr
Definition: node_ctrl_base.hpp:46
#define UHD_RFNOC_API
Definition: config.hpp:103
Definition: sink_node_ctrl.hpp:34
std::map< size_t, boost::weak_ptr< sink_node_ctrl > > node_map_t
Definition: sink_node_ctrl.hpp:41
std::map< size_t, bool > _tx_streamer_active
Definition: sink_node_ctrl.hpp:85
Definition: device_addr.hpp:47
Definition: node_ctrl_base.hpp:40