UHD 003.004.001-23-stable
|
00001 // 00002 // Copyright 2010-2011 Ettus Research LLC 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef INCLUDED_UHD_TYPES_RANGES_HPP 00019 #define INCLUDED_UHD_TYPES_RANGES_HPP 00020 00021 #include <uhd/config.hpp> 00022 #include <uhd/utils/pimpl.hpp> 00023 #include <string> 00024 #include <vector> 00025 00026 namespace uhd{ 00027 00032 class UHD_API range_t{ 00033 public: 00034 00040 range_t(double value = 0); 00041 00049 range_t(double start, double stop, double step = 0); 00050 00052 double start(void) const; 00053 00055 double stop(void) const; 00056 00058 double step(void) const; 00059 00061 const std::string to_pp_string(void) const; 00062 00063 private: UHD_PIMPL_DECL(impl) _impl; 00064 }; 00065 00069 struct UHD_API meta_range_t : std::vector<range_t>{ 00070 00072 meta_range_t(void); 00073 00080 template <typename InputIterator> 00081 meta_range_t(InputIterator first, InputIterator last): 00082 std::vector<range_t>(first, last){ /* NOP */ } 00083 00091 meta_range_t(double start, double stop, double step = 0); 00092 00094 double start(void) const; 00095 00097 double stop(void) const; 00098 00100 double step(void) const; 00101 00108 double clip(double value, bool clip_step = false) const; 00109 00111 const std::string to_pp_string(void) const; 00112 00113 }; 00114 00115 typedef meta_range_t gain_range_t; 00116 typedef meta_range_t freq_range_t; 00117 00118 } //namespace uhd 00119 00120 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */