USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-gaea0e2de
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/function.hpp>
14 #include <boost/shared_ptr.hpp>
16 #include <string>
17 #include <vector>
18 
19 namespace uhd {
20 
25 {
26  boost::function<gain_range_t(void)> get_range;
27  boost::function<double(void)> get_value;
28  boost::function<void(double)> set_value;
29 };
30 
32 {
33 public:
34  typedef boost::shared_ptr<gain_group> sptr;
35 
36  virtual ~gain_group(void) = 0;
37 
45  virtual gain_range_t get_range(const std::string& name = "") = 0;
46 
53  virtual double get_value(const std::string& name = "") = 0;
54 
63  virtual void set_value(double gain, const std::string& name = "") = 0;
64 
70  virtual const std::vector<std::string> get_names(void) = 0;
71 
86  virtual void register_fcns(
87  const std::string& name, const gain_fcns_t& gain_fcns, size_t priority = 0) = 0;
88 
93  static sptr make(void);
94 };
95 
96 } // namespace uhd
97 
98 #endif /* INCLUDED_UHD_UTILS_GAIN_GROUP_HPP */
Definition: gain_group.hpp:24
boost::noncopyable noncopyable
Definition: noncopyable.hpp:46
boost::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:26
Definition: build_info.hpp:13
#define UHD_API
Definition: config.h:68
boost::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:34
boost::function< void(double)> set_value
Definition: gain_group.hpp:28
Definition: ranges.hpp:65
Definition: gain_group.hpp:31
boost::function< double(void)> get_value
Definition: gain_group.hpp:27