USRP Hardware Driver and USRP Manual  Version: 003.008.002-0-ge9d11b35
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 // 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_UHD_UTILS_GAIN_GROUP_HPP
19 #define INCLUDED_UHD_UTILS_GAIN_GROUP_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/types/ranges.hpp>
23 #include <boost/shared_ptr.hpp>
24 #include <boost/function.hpp>
25 #include <boost/utility.hpp>
26 #include <vector>
27 #include <string>
28 
29 namespace uhd{
30 
35  boost::function<gain_range_t(void)> get_range;
36  boost::function<double(void)> get_value;
37  boost::function<void(double)> set_value;
38 };
39 
40 class UHD_API gain_group : boost::noncopyable{
41 public:
42  typedef boost::shared_ptr<gain_group> sptr;
43 
44  virtual ~gain_group(void) = 0;
45 
53  virtual gain_range_t get_range(const std::string &name = "") = 0;
54 
61  virtual double get_value(const std::string &name = "") = 0;
62 
71  virtual void set_value(double gain, const std::string &name = "") = 0;
72 
78  virtual const std::vector<std::string> get_names(void) = 0;
79 
94  virtual void register_fcns(
95  const std::string &name,
96  const gain_fcns_t &gain_fcns,
97  size_t priority = 0
98  ) = 0;
99 
104  static sptr make(void);
105 };
106 
107 } //namespace uhd
108 
109 #endif /* INCLUDED_UHD_UTILS_GAIN_GROUP_HPP */
110 
Definition: gain_group.hpp:34
boost::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:35
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
boost::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:42
boost::function< void(double)> set_value
Definition: gain_group.hpp:37
Definition: ranges.hpp:68
Definition: gain_group.hpp:40
boost::function< double(void)> get_value
Definition: gain_group.hpp:36