UHD
003.005.000-31-stable
|
00001 // 00002 // Copyright 2010-2012 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 <string> 00023 #include <vector> 00024 00025 namespace uhd{ 00026 00031 class UHD_API range_t{ 00032 public: 00033 00039 range_t(double value = 0); 00040 00048 range_t(double start, double stop, double step = 0); 00049 00051 double start(void) const; 00052 00054 double stop(void) const; 00055 00057 double step(void) const; 00058 00060 const std::string to_pp_string(void) const; 00061 00062 private: double _start, _stop, _step; 00063 }; 00064 00068 struct UHD_API meta_range_t : std::vector<range_t>{ 00069 00071 meta_range_t(void); 00072 00079 template <typename InputIterator> 00080 meta_range_t(InputIterator first, InputIterator last): 00081 std::vector<range_t>(first, last){ /* NOP */ } 00082 00090 meta_range_t(double start, double stop, double step = 0); 00091 00093 double start(void) const; 00094 00096 double stop(void) const; 00097 00099 double step(void) const; 00100 00107 double clip(double value, bool clip_step = false) const; 00108 00110 const std::string to_pp_string(void) const; 00111 00112 }; 00113 00114 typedef meta_range_t gain_range_t; 00115 typedef meta_range_t freq_range_t; 00116 00117 } //namespace uhd 00118 00119 #endif /* INCLUDED_UHD_TYPES_RANGES_HPP */