USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-ga1b5c4ae
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 #ifndef INCLUDED_UHD_TYPES_RANGES_HPP
9 #define INCLUDED_UHD_TYPES_RANGES_HPP
10 
11 #include <uhd/config.hpp>
12 #include <string>
13 #include <vector>
14 
15 namespace uhd{
16 
22  public:
23 
29  range_t(double value = 0);
30 
38  range_t(double start, double stop, double step = 0);
39 
41  double start(void) const;
42 
44  double stop(void) const;
45 
47  double step(void) const;
48 
50  const std::string to_pp_string(void) const;
51 
53  bool operator==(const range_t &other) const;
54 
56  bool operator!=(const range_t &other) const;
57 
58  private: 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){ /* NOP */ }
78 
86  meta_range_t(double start, double stop, double step = 0);
87 
89  double start(void) const;
90 
92  double stop(void) const;
93 
95  double step(void) const;
96 
103  double clip(double value, bool clip_step = false) const;
104 
106  const std::string to_pp_string(void) const;
107 
108  };
109 
112 
113 } //namespace uhd
114 
115 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */
meta_range_t freq_range_t
Definition: ranges.hpp:111
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:71
meta_range_t gain_range_t
Definition: ranges.hpp:110
UHD_INLINE bool operator!=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:65
STL namespace.
Definition: build_info.hpp:14
Definition: ranges.hpp:21
#define UHD_API
Definition: config.h:63
Definition: ranges.hpp:64
UHD_API bool operator==(const time_spec_t &, const time_spec_t &)
Implement equality_comparable interface.