USRP Hardware Driver and USRP Manual Version: 4.1.0.1
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
14namespace uhd {
15
21{
22public:
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
57private:
58 double _start, _stop, _step;
59};
60
64struct UHD_API meta_range_t : std::vector<range_t>
65{
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
Definition: ranges.hpp:21
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:70
STL namespace.
Definition: build_info.hpp:12
meta_range_t freq_range_t
Definition: ranges.hpp:112
meta_range_t gain_range_t
Definition: ranges.hpp:111
Definition: ranges.hpp:65
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:76
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