USRP Hardware Driver and USRP Manual  Version: 4.1.0.0-release
UHD and USRP Manual
ranges.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2012 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 <string>
12 #include <vector>
13 
14 namespace uhd {
15 
21 {
22 public:
28  range_t(double value = 0);
29 
37  range_t(double start, double stop, double step = 0);
38 
40  double start(void) const;
41 
43  double stop(void) const;
44 
46  double step(void) const;
47 
49  const std::string to_pp_string(void) const;
50 
52  bool operator==(const range_t& other) const;
53 
55  bool operator!=(const range_t& other) const;
56 
57 private:
58  double _start, _stop, _step;
59 };
60 
64 struct UHD_API meta_range_t : std::vector<range_t>
65 {
67  meta_range_t(void);
68 
75  template <typename InputIterator>
76  meta_range_t(InputIterator first, InputIterator last)
77  : std::vector<range_t>(first, last)
78  { /* NOP */
79  }
80 
88  meta_range_t(double start, double stop, double step = 0);
89 
91  double start(void) const;
92 
94  double stop(void) const;
95 
97  double step(void) const;
98 
105  double clip(double value, bool clip_step = false) const;
106 
108  const std::string to_pp_string(void) const;
109 };
110 
113 
114 } // namespace uhd
meta_range_t freq_range_t
Definition: ranges.hpp:112
meta_range_t(InputIterator first, InputIterator last)
Definition: ranges.hpp:76
UHD_INLINE T clip(const T &val, const T &bound1, const T &bound2)
Definition: algorithm.hpp:81
meta_range_t gain_range_t
Definition: ranges.hpp:111
UHD_INLINE bool operator!=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:64
STL namespace.
Definition: build_info.hpp:12
Definition: ranges.hpp:20
#define UHD_API
Definition: config.h:70
Definition: ranges.hpp:64
UHD_API bool operator==(const time_spec_t &, const time_spec_t &)
Implement equality_comparable interface.