USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-g13c32cef
UHD and USRP Manual
gain_group.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011,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_UHD_UTILS_GAIN_GROUP_HPP
9 #define INCLUDED_UHD_UTILS_GAIN_GROUP_HPP
10 
11 #include <uhd/config.hpp>
12 #include <uhd/types/ranges.hpp>
13 #include <boost/shared_ptr.hpp>
14 #include <boost/function.hpp>
15 #include <boost/utility.hpp>
16 #include <vector>
17 #include <string>
18 
19 namespace uhd{
20 
25  boost::function<gain_range_t(void)> get_range;
26  boost::function<double(void)> get_value;
27  boost::function<void(double)> set_value;
28 };
29 
30 class UHD_API gain_group : boost::noncopyable{
31 public:
32  typedef boost::shared_ptr<gain_group> sptr;
33 
34  virtual ~gain_group(void) = 0;
35 
43  virtual gain_range_t get_range(const std::string &name = "") = 0;
44 
51  virtual double get_value(const std::string &name = "") = 0;
52 
61  virtual void set_value(double gain, const std::string &name = "") = 0;
62 
68  virtual const std::vector<std::string> get_names(void) = 0;
69 
84  virtual void register_fcns(
85  const std::string &name,
86  const gain_fcns_t &gain_fcns,
87  size_t priority = 0
88  ) = 0;
89 
94  static sptr make(void);
95 };
96 
97 } //namespace uhd
98 
99 #endif /* INCLUDED_UHD_UTILS_GAIN_GROUP_HPP */
100 
Definition: gain_group.hpp:24
boost::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:25
Definition: build_info.hpp:14
#define UHD_API
Definition: config.h:63
boost::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:32
boost::function< void(double)> set_value
Definition: gain_group.hpp:27
Definition: ranges.hpp:64
Definition: gain_group.hpp:30
boost::function< double(void)> get_value
Definition: gain_group.hpp:26