UHD 003.004.003-0-unknown

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ranges.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_TYPES_RANGES_HPP
19 #define INCLUDED_UHD_TYPES_RANGES_HPP
20
21 #include <uhd/config.hpp>
22 #include <uhd/utils/pimpl.hpp>
23 #include <string>
24 #include <vector>
25
26 namespace uhd{
27
32 class UHD_API range_t{
33 public:
34
40 range_t(double value = 0);
41
49 range_t(double start, double stop, double step = 0);
50
52 double start(void) const;
53
55 double stop(void) const;
56
58 double step(void) const;
59
61 const std::string to_pp_string(void) const;
62
63 private: UHD_PIMPL_DECL(impl) _impl;
64 };
65
69 struct UHD_API meta_range_t : std::vector<range_t>{
70
72 meta_range_t(void);
73
80 template <typename InputIterator>
81 meta_range_t(InputIterator first, InputIterator last):
82 std::vector<range_t>(first, last){ /* NOP */ }
83
91 meta_range_t(double start, double stop, double step = 0);
92
94 double start(void) const;
95
97 double stop(void) const;
98
100 double step(void) const;
101
108 double clip(double value, bool clip_step = false) const;
109
111 const std::string to_pp_string(void) const;
112
113 };
114
115 typedef meta_range_t gain_range_t;
116 typedef meta_range_t freq_range_t;
117
118 } //namespace uhd
119
120 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */