USRP Hardware Driver and USRP Manual  Version: 003.008.002-0-ge9d11b35
UHD and USRP Manual
ranges.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2012 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 <string>
23 #include <vector>
24 
25 namespace uhd{
26 
32  public:
33 
39  range_t(double value = 0);
40 
48  range_t(double start, double stop, double step = 0);
49 
51  double start(void) const;
52 
54  double stop(void) const;
55 
57  double step(void) const;
58 
60  const std::string to_pp_string(void) const;
61 
62  private: double _start, _stop, _step;
63  };
64 
68  struct UHD_API meta_range_t : std::vector<range_t>{
69 
71  meta_range_t(void);
72 
79  template <typename InputIterator>
80  meta_range_t(InputIterator first, InputIterator last):
81  std::vector<range_t>(first, last){ /* NOP */ }
82 
90  meta_range_t(double start, double stop, double step = 0);
91 
93  double start(void) const;
94 
96  double stop(void) const;
97 
99  double step(void) const;
100 
107  double clip(double value, bool clip_step = false) const;
108 
110  const std::string to_pp_string(void) const;
111 
112  };
113 
116 
117 } //namespace uhd
118 
119 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */
meta_range_t freq_range_t
Definition: ranges.hpp:115
meta_range_t(InputIterator first, InputIterator last)
Definition: ranges.hpp:80
meta_range_t gain_range_t
Definition: ranges.hpp:114
STL namespace.
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
T clip(const T &val, const T &bound1, const T &bound2)
Definition: algorithm.hpp:81
Definition: ranges.hpp:31
Definition: ranges.hpp:68