USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
ranges.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2012 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_TYPES_RANGES_HPP
8 #define INCLUDED_UHD_TYPES_RANGES_HPP
9 
10 #include <uhd/config.hpp>
11 #include <string>
12 #include <vector>
13 
14 namespace uhd{
15 
21  public:
22 
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: double _start, _stop, _step;
58  };
59 
63  struct UHD_API meta_range_t : std::vector<range_t>{
64 
66  meta_range_t(void);
67 
74  template <typename InputIterator>
75  meta_range_t(InputIterator first, InputIterator last):
76  std::vector<range_t>(first, last){ /* NOP */ }
77 
85  meta_range_t(double start, double stop, double step = 0);
86 
88  double start(void) const;
89 
91  double stop(void) const;
92 
94  double step(void) const;
95 
102  double clip(double value, bool clip_step = false) const;
103 
105  const std::string to_pp_string(void) const;
106 
107  };
108 
111 
112 } //namespace uhd
113 
114 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */
meta_range_t freq_range_t
Definition: ranges.hpp:110
meta_range_t(InputIterator first, InputIterator last)
Definition: ranges.hpp:75
UHD_INLINE T clip(const T &val, const T &bound1, const T &bound2)
Definition: algorithm.hpp:70
meta_range_t gain_range_t
Definition: ranges.hpp:109
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:14
Definition: ranges.hpp:20
#define UHD_API
Definition: config.h:62
Definition: ranges.hpp:63
UHD_API bool operator==(const time_spec_t &, const time_spec_t &)
Implement equality_comparable interface.