UHD  003.001.002
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 
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 
117 
118 } //namespace uhd
119 
120 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */
meta_range_t freq_range_t
Definition: ranges.hpp:116
meta_range_t(InputIterator first, InputIterator last)
Definition: ranges.hpp:81
meta_range_t gain_range_t
Definition: ranges.hpp:115
STL namespace.
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
T clip(const T &val, const T &bound1, const T &bound2)
Definition: algorithm.hpp:80
#define UHD_PIMPL_DECL(_name)
Definition: pimpl.hpp:42
Definition: ranges.hpp:32
Definition: ranges.hpp:69