USRP Hardware Driver and USRP Manual Version: 3.15.0.0-MacPorts-Release
UHD and USRP Manual
 
Loading...
Searching...
No Matches
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
15namespace uhd {
16
22{
23public:
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
58private:
59 double _start, _stop, _step;
60};
61
65struct UHD_API meta_range_t : std::vector<range_t>
66{
69
76 template <typename InputIterator>
77 meta_range_t(InputIterator first, InputIterator last)
78 : std::vector<range_t>(first, last)
79 { /* NOP */
80 }
81
89 meta_range_t(double start, double stop, double step = 0);
90
92 double start(void) const;
93
95 double stop(void) const;
96
98 double step(void) const;
99
106 double clip(double value, bool clip_step = false) const;
107
109 const std::string to_pp_string(void) const;
110};
111
114
115} // namespace uhd
116
117#endif /* INCLUDED_UHD_TYPES_RANGES_HPP */
Definition ranges.hpp:22
range_t(double value=0)
bool operator!=(const range_t &other) const
Inequality operator.
const std::string to_pp_string(void) const
Convert this range to a printable string.
double stop(void) const
Get the stop value for this range.
double start(void) const
Get the start value for this range.
range_t(double start, double stop, double step=0)
bool operator==(const range_t &other) const
Equality operator.
double step(void) const
Get the step value for this range.
#define UHD_API
Definition config.h:68
Definition build_info.hpp:13
meta_range_t freq_range_t
Definition ranges.hpp:113
meta_range_t gain_range_t
Definition ranges.hpp:112
Definition ranges.hpp:66
double stop(void) const
Get the overall stop value for this meta-range.
double step(void) const
Get the overall step value for this meta-range.
meta_range_t(InputIterator first, InputIterator last)
Definition ranges.hpp:77
meta_range_t(double start, double stop, double step=0)
meta_range_t(void)
A default constructor for an empty meta-range.
double start(void) const
Get the overall start value for this meta-range.
const std::string to_pp_string(void) const
Convert this meta-range to a printable string.
double clip(double value, bool clip_step=false) const