UHD 003.005.002-0-unknown

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
gain_group.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011 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
34 struct UHD_API gain_fcns_t{
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
51 virtual gain_range_t get_range(const std::string &name = "") = 0;
52
59 virtual double get_value(const std::string &name = "") = 0;
60
69 virtual void set_value(double gain, const std::string &name = "") = 0;
70
76 virtual const std::vector<std::string> get_names(void) = 0;
77
92 virtual void register_fcns(
93 const std::string &name,
94 const gain_fcns_t &gain_fcns,
95 size_t priority = 0
96 ) = 0;
97
102 static sptr make(void);
103 };
104
105 } //namespace uhd
106
107 #endif /* INCLUDED_UHD_UTILS_GAIN_GROUP_HPP */
108
uhd::gain_fcns_t
Definition: gain_group.hpp:34
uhd::gain_fcns_t::get_range
boost::function< gain_range_t(void)> get_range
Definition: gain_group.hpp:35
config.hpp
UHD_API
#define UHD_API
Definition: config.hpp:76
ranges.hpp
uhd::gain_group::sptr
boost::shared_ptr< gain_group > sptr
Definition: gain_group.hpp:42
uhd::gain_fcns_t::set_value
boost::function< void(double)> set_value
Definition: gain_group.hpp:37
uhd::meta_range_t
Definition: ranges.hpp:68
uhd::gain_group
Definition: gain_group.hpp:40
uhd::gain_fcns_t::get_value
boost::function< double(void)> get_value
Definition: gain_group.hpp:36