From 08dfff379865656e94b31fd565a4b13b4609ea63 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 1 Nov 2010 18:56:38 -0700 Subject: uhd: created a meta range that is a range of ranges for gains and freqs created a templated range that that holds a start, stop, and step created a meta-range template that is a vector of ranges meta-range can calculate the overall start, stop, step or be indexed to get at components replaced instances of range.min, max, step with the functions start() stop() and step() the xcvr frequency range is now expressed in as two ranges (have to fix its clip function though) --- host/lib/types.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'host/lib/types.cpp') diff --git a/host/lib/types.cpp b/host/lib/types.cpp index e5e6a2512..8ccb664d5 100644 --- a/host/lib/types.cpp +++ b/host/lib/types.cpp @@ -16,7 +16,6 @@ // #include -#include #include #include #include @@ -40,24 +39,6 @@ using namespace uhd; -/*********************************************************************** - * ranges - **********************************************************************/ -gain_range_t::gain_range_t(float min, float max, float step): - min(min), - max(max), - step(step) -{ - /* NOP */ -} - -freq_range_t::freq_range_t(double min, double max): - min(min), - max(max) -{ - /* NOP */ -} - /*********************************************************************** * tune request **********************************************************************/ -- cgit v1.2.3 From 755569e66f7a939aa9392a79bf637d823fb78b84 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 17 Nov 2010 09:03:25 -0800 Subject: uhd: ranges symbol fix, try extern macro --- host/include/uhd/config.hpp | 3 +++ host/include/uhd/types/ranges.hpp | 4 ++-- host/lib/types.cpp | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'host/lib/types.cpp') diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp index 2918c2340..043e8d884 100644 --- a/host/include/uhd/config.hpp +++ b/host/include/uhd/config.hpp @@ -75,13 +75,16 @@ #ifdef UHD_DLL // defined if UHD is compiled as a DLL #ifdef UHD_DLL_EXPORTS // defined if we are building the UHD DLL (instead of using it) #define UHD_API UHD_HELPER_DLL_EXPORT + #define EXIMP_TEMPLATE extern #else #define UHD_API UHD_HELPER_DLL_IMPORT + #define EXIMP_TEMPLATE #endif // UHD_DLL_EXPORTS #define UHD_LOCAL UHD_HELPER_DLL_LOCAL #else // UHD_DLL is not defined: this means UHD is a static lib. #define UHD_API #define UHD_LOCAL + #define EXIMP_TEMPLATE #endif // UHD_DLL // Define force inline macro diff --git a/host/include/uhd/types/ranges.hpp b/host/include/uhd/types/ranges.hpp index 623bdca19..25120de40 100644 --- a/host/include/uhd/types/ranges.hpp +++ b/host/include/uhd/types/ranges.hpp @@ -105,11 +105,11 @@ namespace uhd{ }; //! export a symbol for the gain range type - template struct UHD_API meta_range_t; + EXIMP_TEMPLATE template struct UHD_API meta_range_t; typedef meta_range_t gain_range_t; //! export a symbol for the freq range type - template struct UHD_API meta_range_t; + EXIMP_TEMPLATE template struct UHD_API meta_range_t; typedef meta_range_t freq_range_t; diff --git a/host/lib/types.cpp b/host/lib/types.cpp index 8ccb664d5..bea20a4aa 100644 --- a/host/lib/types.cpp +++ b/host/lib/types.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,12 @@ using namespace uhd; +/*********************************************************************** + * ranges template instantiation + **********************************************************************/ +template struct uhd::meta_range_t; +template struct uhd::meta_range_t; + /*********************************************************************** * tune request **********************************************************************/ -- cgit v1.2.3