USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
gain_group.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011,2014 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_UTILS_GAIN_GROUP_HPP
8 #define INCLUDED_UHD_UTILS_GAIN_GROUP_HPP
9 
10 #include <uhd/config.hpp>
11 #include <uhd/types/ranges.hpp>
12 #include <boost/shared_ptr.hpp>
13 #include <boost/function.hpp>
14 #include <boost/utility.hpp>
15 #include <vector>
16 #include <string>
17 
18 namespace uhd{
19 
24  boost::function<gain_range_t(void)> get_range;
25  boost::function<double(void)> get_value;
26  boost::function<void(double)> set_value;
27 };
28 
29 class UHD_API gain_group : boost::noncopyable{
30 public:
31  typedef boost::shared_ptr<gain_group> sptr;
32 
33  virtual ~gain_group(void) = 0;
34 
42  virtual gain_range_t get_range(const std::string &name = "") = 0;
43 
50  virtual double get_value(const std::string &name = "") = 0;
51 
60  virtual void set_value(double gain, const std::string &name = "") = 0;
61 
67  virtual const std::vector<std::string> get_names(void) = 0;
68 
83  virtual void register_fcns(
84  const std::string &name,
85  const gain_fcns_t &gain_fcns,
86  size_t priority = 0
87  ) = 0;
88 
93  static sptr make(void);
94 };
95 
96 } //namespace uhd
97 
98 #endif /* INCLUDED_UHD_UTILS_GAIN_GROUP_HPP */
99 
Definition: gain_group.hpp:23
boost::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:24
Definition: build_info.hpp:14
#define UHD_API
Definition: config.h:62
boost::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:31
boost::function< void(double)> set_value
Definition: gain_group.hpp:26
Definition: ranges.hpp:63
Definition: gain_group.hpp:29
boost::function< double(void)> get_value
Definition: gain_group.hpp:25