USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
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 #pragma once
9 
10 #include <uhd/config.hpp>
11 #include <uhd/types/ranges.hpp>
13 #include <functional>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 namespace uhd {
19 
24 {
25  std::function<gain_range_t(void)> get_range;
26  std::function<double(void)> get_value;
27  std::function<void(double)> set_value;
28 };
29 
31 {
32 public:
33  typedef std::shared_ptr<gain_group> sptr;
34 
35  virtual ~gain_group(void) = 0;
36 
44  virtual gain_range_t get_range(const std::string& name = "") = 0;
45 
52  virtual double get_value(const std::string& name = "") = 0;
53 
62  virtual void set_value(double gain, const std::string& name = "") = 0;
63 
69  virtual const std::vector<std::string> get_names(void) = 0;
70 
85  virtual void register_fcns(
86  const std::string& name, const gain_fcns_t& gain_fcns, size_t priority = 0) = 0;
87 
92  static sptr make(void);
93 
98  static sptr make_zero();
99 };
100 
101 } // namespace uhd
uhd::gain_group
Definition: gain_group.hpp:30
config.hpp
uhd::gain_fcns_t::set_value
std::function< void(double)> set_value
Definition: gain_group.hpp:27
uhd::gain_fcns_t
Definition: gain_group.hpp:23
uhd::gain_fcns_t::get_value
std::function< double(void)> get_value
Definition: gain_group.hpp:26
uhd::gain_fcns_t::get_range
std::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:25
UHD_API
#define UHD_API
Definition: config.h:87
noncopyable.hpp
uhd::gain_group::sptr
std::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:33
uhd
Definition: build_info.hpp:12
ranges.hpp
uhd::gain_range_t
meta_range_t gain_range_t
Definition: ranges.hpp:132
uhd::noncopyable
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
uhd::meta_range_t
Definition: ranges.hpp:65