diff --git a/docs/changelog.md b/docs/changelog.md index e2cb6b2c1..445db80e9 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -23,6 +23,12 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades @@ -36,10 +37,6 @@ #include // for string #include // for key_t #include // for vector -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup PVT * \{ */ @@ -65,11 +62,7 @@ class Rtcm_Printer; class Rtklib_Solver; class rtklib_pvt_gs; -#if GNURADIO_USES_STD_POINTERS -using rtklib_pvt_gs_sptr = std::shared_ptr; -#else -using rtklib_pvt_gs_sptr = boost::shared_ptr; -#endif +using rtklib_pvt_gs_sptr = gnss_shared_ptr; rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 7c49e4d43..7d46161cf 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -163,8 +163,8 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_state(int state) acquisition_cc_->set_state(state); } -#if GNURADIO_USES_STD_POINTERS -void GpsL1CaPcpsAcquisitionFineDoppler::connect(std::shared_ptr top_block) + +void GpsL1CaPcpsAcquisitionFineDoppler::connect(gnss_shared_ptr top_block) { if (top_block) { /* top_block is not null */ @@ -173,26 +173,7 @@ void GpsL1CaPcpsAcquisitionFineDoppler::connect(std::shared_ptr t } -void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(std::shared_ptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - // nothing to disconnect, now the tracking uses gr_sync_decimator -} - -std::shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_left_block() -{ - return acquisition_cc_; -} - - -std::shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_right_block() -{ - return acquisition_cc_; -} -#else -void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr top_block) +void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(gnss_shared_ptr top_block) { if (top_block) { /* top_block is not null */ @@ -201,22 +182,13 @@ void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr } -void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(boost::shared_ptr top_block) -{ - if (top_block) - { /* top_block is not null */ - }; - // nothing to disconnect, now the tracking uses gr_sync_decimator -} - -boost::shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_left_block() +gnss_shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_left_block() { return acquisition_cc_; } -boost::shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_right_block() +gnss_shared_ptr GpsL1CaPcpsAcquisitionFineDoppler::get_right_block() { return acquisition_cc_; } -#endif diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index df6d63bdc..a3cd9989a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -29,12 +29,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -using pcps_acquisition_fine_doppler_cc_sptr = std::shared_ptr; -#else -#include -using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr; -#endif /** \addtogroup Acquisition * \{ */ @@ -42,6 +36,8 @@ using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr; + class ConfigurationInterface; /*! @@ -76,17 +72,11 @@ public: return item_size_; } -#if GNURADIO_USES_STD_POINTERS - void connect(std::shared_ptr top_block) override; - void disconnect(std::shared_ptr top_block) override; - std::shared_ptr get_left_block() override; - std::shared_ptr get_right_block() override; -#else - void connect(boost::shared_ptr top_block) override; - void disconnect(boost::shared_ptr top_block) override; - boost::shared_ptr get_left_block() override; - boost::shared_ptr get_right_block() override; -#endif + void connect(gnss_shared_ptr top_block) override; + void disconnect(gnss_shared_ptr top_block) override; + gnss_shared_ptr get_left_block() override; + gnss_shared_ptr get_right_block() override; + /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer * to efficiently exchange synchronization data between acquisition and diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index 836209821..3f9a5557d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -37,10 +37,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -50,11 +46,7 @@ class galileo_e5a_noncoherentIQ_acquisition_caf_cc; -#if GNURADIO_USES_STD_POINTERS -using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = std::shared_ptr; -#else -using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = boost::shared_ptr; -#endif +using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = gnss_shared_ptr; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( unsigned int sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index fbbb473eb..31d957ab7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -31,10 +31,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -44,11 +40,7 @@ class galileo_pcps_8ms_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -using galileo_pcps_8ms_acquisition_cc_sptr = std::shared_ptr; -#else -using galileo_pcps_8ms_acquisition_cc_sptr = boost::shared_ptr; -#endif +using galileo_pcps_8ms_acquisition_cc_sptr = gnss_shared_ptr; galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index ef5fea02b..2d494ac70 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -71,11 +71,6 @@ namespace own = std; namespace own = gsl; #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif - /** \addtogroup Acquisition * Classes for GNSS signal acquisition * \{ */ @@ -87,11 +82,7 @@ namespace own = gsl; class Gnss_Synchro; class pcps_acquisition; -#if GNURADIO_USES_STD_POINTERS -using pcps_acquisition_sptr = std::shared_ptr; -#else -using pcps_acquisition_sptr = boost::shared_ptr; -#endif +using pcps_acquisition_sptr = gnss_shared_ptr; pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 3b70fbb37..a569f7fb7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -55,10 +55,7 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif + /** \addtogroup Acquisition * \{ */ @@ -68,11 +65,7 @@ class pcps_acquisition_fine_doppler_cc; -#if GNURADIO_USES_STD_POINTERS -using pcps_acquisition_fine_doppler_cc_sptr = std::shared_ptr; -#else -using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr; -#endif +using pcps_acquisition_fine_doppler_cc_sptr = gnss_shared_ptr; pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index b066a25bf..abea933da 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -47,10 +47,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -60,11 +56,7 @@ class pcps_assisted_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -using pcps_assisted_acquisition_cc_sptr = std::shared_ptr; -#else -using pcps_assisted_acquisition_cc_sptr = boost::shared_ptr; -#endif +using pcps_assisted_acquisition_cc_sptr = gnss_shared_ptr; pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( int32_t max_dwells, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index 7bbdc5c59..ecb1f2aa6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -36,10 +36,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -49,11 +45,7 @@ class pcps_cccwsr_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -using pcps_cccwsr_acquisition_cc_sptr = std::shared_ptr; -#else -using pcps_cccwsr_acquisition_cc_sptr = boost::shared_ptr; -#endif +using pcps_cccwsr_acquisition_cc_sptr = gnss_shared_ptr; pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( uint32_t sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index 698c1d672..59631021e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -53,10 +53,6 @@ #include // for weak_ptr #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -66,11 +62,7 @@ class pcps_opencl_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -typedef std::shared_ptr pcps_opencl_acquisition_cc_sptr; -#else -typedef boost::shared_ptr pcps_opencl_acquisition_cc_sptr; -#endif +using pcps_opencl_acquisition_cc_sptr = gnss_shared_ptr; pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( uint32_t sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index b44f6c8d6..6a6f1fe27 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -53,10 +53,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -66,11 +62,7 @@ class pcps_quicksync_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -using pcps_quicksync_acquisition_cc_sptr = std::shared_ptr; -#else -using pcps_quicksync_acquisition_cc_sptr = boost::shared_ptr; -#endif +using pcps_quicksync_acquisition_cc_sptr = gnss_shared_ptr; pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( uint32_t folding_factor, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index 4a0a6a37d..249fc7731 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -50,10 +50,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Acquisition * \{ */ @@ -63,11 +59,7 @@ class pcps_tong_acquisition_cc; -#if GNURADIO_USES_STD_POINTERS -using pcps_tong_acquisition_cc_sptr = std::shared_ptr; -#else -using pcps_tong_acquisition_cc_sptr = boost::shared_ptr; -#endif +using pcps_tong_acquisition_cc_sptr = gnss_shared_ptr; pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( uint32_t sampled_ms, diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.h b/src/algorithms/channel/libs/channel_msg_receiver_cc.h index cf935da9b..59066de82 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.h +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.h @@ -24,10 +24,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Channel * \{ */ @@ -37,11 +33,7 @@ class channel_msg_receiver_cc; -#if GNURADIO_USES_STD_POINTERS -using channel_msg_receiver_cc_sptr = std::shared_ptr; -#else -using channel_msg_receiver_cc_sptr = boost::shared_ptr; -#endif +using channel_msg_receiver_cc_sptr = gnss_shared_ptr; channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 495a9bcd4..aaec99e0d 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -47,6 +47,11 @@ target_link_libraries(data_type_gr_blocks Volk::volk ) +target_include_directories(data_type_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(data_type_gr_blocks PUBLIC -DGNURADIO_USES_STD_POINTERS=1 diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h index c40b79237..9ddd632ea 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h @@ -20,12 +20,8 @@ #ifndef GNSS_SDR_INTERLEAVED_BYTE_TO_COMPLEX_BYTE_H #define GNSS_SDR_INTERLEAVED_BYTE_TO_COMPLEX_BYTE_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Data_Type * \{ */ @@ -36,11 +32,7 @@ class interleaved_byte_to_complex_byte; -#if GNURADIO_USES_STD_POINTERS -using interleaved_byte_to_complex_byte_sptr = std::shared_ptr; -#else -using interleaved_byte_to_complex_byte_sptr = boost::shared_ptr; -#endif +using interleaved_byte_to_complex_byte_sptr = gnss_shared_ptr; interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte(); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h index 489e95b0f..bef515196 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h @@ -20,12 +20,9 @@ #ifndef GNSS_SDR_INTERLEAVED_BYTE_TO_COMPLEX_SHORT_H #define GNSS_SDR_INTERLEAVED_BYTE_TO_COMPLEX_SHORT_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif + /** \addtogroup Data_Type * \{ */ @@ -35,11 +32,7 @@ class interleaved_byte_to_complex_short; -#if GNURADIO_USES_STD_POINTERS -using interleaved_byte_to_complex_short_sptr = std::shared_ptr; -#else -using interleaved_byte_to_complex_short_sptr = boost::shared_ptr; -#endif +using interleaved_byte_to_complex_short_sptr = gnss_shared_ptr; interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short(); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h index 7659c7316..d9e5a5d52 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h @@ -20,12 +20,8 @@ #ifndef GNSS_SDR_INTERLEAVED_SHORT_TO_COMPLEX_SHORT_H #define GNSS_SDR_INTERLEAVED_SHORT_TO_COMPLEX_SHORT_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Data_Type * \{ */ @@ -35,11 +31,7 @@ class interleaved_short_to_complex_short; -#if GNURADIO_USES_STD_POINTERS -using interleaved_short_to_complex_short_sptr = std::shared_ptr; -#else -using interleaved_short_to_complex_short_sptr = boost::shared_ptr; -#endif +using interleaved_short_to_complex_short_sptr = gnss_shared_ptr; interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short(); diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index ba87e0dea..8520c08b2 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -52,6 +52,11 @@ target_link_libraries(input_filter_gr_blocks Log4cpp::log4cpp ) +target_include_directories(input_filter_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(input_filter_gr_blocks PUBLIC -DGNURADIO_USES_STD_POINTERS=1 diff --git a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h index 9c95de96e..c5db6c916 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h +++ b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h @@ -20,13 +20,9 @@ #ifndef GNSS_SDR_BEAMFORMER_H #define GNSS_SDR_BEAMFORMER_H +#include "gnss_block_interface.h" #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Input_Filter * \{ */ @@ -36,11 +32,7 @@ class beamformer; -#if GNURADIO_USES_STD_POINTERS -using beamformer_sptr = std::shared_ptr; -#else -using beamformer_sptr = boost::shared_ptr; -#endif +using beamformer_sptr = gnss_shared_ptr; beamformer_sptr make_beamformer_sptr(); diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h index f2adb3c44..25ef7bf3c 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h @@ -20,10 +20,7 @@ #ifndef GNSS_SDR_NOTCH_CC_H #define GNSS_SDR_NOTCH_CC_H -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif +#include "gnss_block_interface.h" #include #include #include // for volk_gnsssdr::vector @@ -38,11 +35,7 @@ class Notch; -#if GNURADIO_USES_STD_POINTERS -using notch_sptr = std::shared_ptr; -#else -using notch_sptr = boost::shared_ptr; -#endif +using notch_sptr = gnss_shared_ptr; notch_sptr make_notch_filter( float pfa, diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h index 787518829..bc55c5848 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h @@ -20,10 +20,7 @@ #ifndef GNSS_SDR_NOTCH_LITE_CC_H #define GNSS_SDR_NOTCH_LITE_CC_H -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif +#include "gnss_block_interface.h" #include #include #include // for volk_gnsssdr::vector @@ -38,11 +35,7 @@ class NotchLite; -#if GNURADIO_USES_STD_POINTERS -using notch_lite_sptr = std::shared_ptr; -#else -using notch_lite_sptr = boost::shared_ptr; -#endif +using notch_lite_sptr = gnss_shared_ptr; notch_lite_sptr make_notch_filter_lite( float p_c_factor, diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h index 136570f80..be2f6d54d 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h @@ -20,11 +20,7 @@ #ifndef GNSS_SDR_PULSE_BLANKING_CC_H #define GNSS_SDR_PULSE_BLANKING_CC_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for volk_gnsssdr::vector #include @@ -38,11 +34,7 @@ class pulse_blanking_cc; -#if GNURADIO_USES_STD_POINTERS -using pulse_blanking_cc_sptr = std::shared_ptr; -#else -using pulse_blanking_cc_sptr = boost::shared_ptr; -#endif +using pulse_blanking_cc_sptr = gnss_shared_ptr; pulse_blanking_cc_sptr make_pulse_blanking_cc( float pfa, diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.h b/src/algorithms/libs/byte_x2_to_complex_byte.h index c68a2757f..2967ec678 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.h +++ b/src/algorithms/libs/byte_x2_to_complex_byte.h @@ -21,11 +21,7 @@ #ifndef GNSS_SDR_BYTE_X2_TO_COMPLEX_BYTE_H #define GNSS_SDR_BYTE_X2_TO_COMPLEX_BYTE_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -34,14 +30,10 @@ /** \addtogroup Algorithm_libs algorithms_libs * \{ */ + class byte_x2_to_complex_byte; -#if GNURADIO_USES_STD_POINTERS -using byte_x2_to_complex_byte_sptr = std::shared_ptr; -#else -using byte_x2_to_complex_byte_sptr = boost::shared_ptr; -#endif - +using byte_x2_to_complex_byte_sptr = gnss_shared_ptr; byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); diff --git a/src/algorithms/libs/complex_byte_to_float_x2.h b/src/algorithms/libs/complex_byte_to_float_x2.h index 84df317d7..6ad8eb343 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.h +++ b/src/algorithms/libs/complex_byte_to_float_x2.h @@ -21,12 +21,7 @@ #ifndef GNSS_SDR_COMPLEX_BYTE_TO_FLOAT_X2_H #define GNSS_SDR_COMPLEX_BYTE_TO_FLOAT_X2_H - -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -38,11 +33,7 @@ class complex_byte_to_float_x2; -#if GNURADIO_USES_STD_POINTERS -using complex_byte_to_float_x2_sptr = std::shared_ptr; -#else -using complex_byte_to_float_x2_sptr = boost::shared_ptr; -#endif +using complex_byte_to_float_x2_sptr = gnss_shared_ptr; complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); diff --git a/src/algorithms/libs/complex_float_to_complex_byte.h b/src/algorithms/libs/complex_float_to_complex_byte.h index 44bb352ab..0e3da99a6 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.h +++ b/src/algorithms/libs/complex_float_to_complex_byte.h @@ -21,11 +21,7 @@ #ifndef GNSS_SDR_COMPLEX_FLOAT_TO_COMPLEX_BYTE_H #define GNSS_SDR_COMPLEX_FLOAT_TO_COMPLEX_BYTE_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -37,11 +33,7 @@ class complex_float_to_complex_byte; -#if GNURADIO_USES_STD_POINTERS -using complex_float_to_complex_byte_sptr = std::shared_ptr; -#else -using complex_float_to_complex_byte_sptr = boost::shared_ptr; -#endif +using complex_float_to_complex_byte_sptr = gnss_shared_ptr; complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); diff --git a/src/algorithms/libs/conjugate_cc.h b/src/algorithms/libs/conjugate_cc.h index eb44d68f9..113b42034 100644 --- a/src/algorithms/libs/conjugate_cc.h +++ b/src/algorithms/libs/conjugate_cc.h @@ -21,11 +21,7 @@ #ifndef GNSS_SDR_CONJUGATE_CC_H #define GNSS_SDR_CONJUGATE_CC_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -37,11 +33,7 @@ class conjugate_cc; -#if GNURADIO_USES_STD_POINTERS -using conjugate_cc_sptr = std::shared_ptr; -#else -using conjugate_cc_sptr = boost::shared_ptr; -#endif +using conjugate_cc_sptr = gnss_shared_ptr; conjugate_cc_sptr make_conjugate_cc(); diff --git a/src/algorithms/libs/conjugate_ic.h b/src/algorithms/libs/conjugate_ic.h index a29825fe3..589a77e2e 100644 --- a/src/algorithms/libs/conjugate_ic.h +++ b/src/algorithms/libs/conjugate_ic.h @@ -21,13 +21,9 @@ #ifndef GNSS_SDR_CONJUGATE_IC_H #define GNSS_SDR_CONJUGATE_IC_H +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Algorithms_Library * \{ */ @@ -37,11 +33,7 @@ class conjugate_ic; -#if GNURADIO_USES_STD_POINTERS -using conjugate_ic_sptr = std::shared_ptr; -#else -using conjugate_ic_sptr = boost::shared_ptr; -#endif +using conjugate_ic_sptr = gnss_shared_ptr; conjugate_ic_sptr make_conjugate_ic(); diff --git a/src/algorithms/libs/conjugate_sc.h b/src/algorithms/libs/conjugate_sc.h index ea7d80b26..5933de263 100644 --- a/src/algorithms/libs/conjugate_sc.h +++ b/src/algorithms/libs/conjugate_sc.h @@ -21,11 +21,7 @@ #ifndef GNSS_SDR_CONJUGATE_SC_H #define GNSS_SDR_CONJUGATE_SC_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -37,11 +33,7 @@ class conjugate_sc; -#if GNURADIO_USES_STD_POINTERS -using conjugate_sc_sptr = std::shared_ptr; -#else -using conjugate_sc_sptr = boost::shared_ptr; -#endif +using conjugate_sc_sptr = gnss_shared_ptr; conjugate_sc_sptr make_conjugate_sc(); diff --git a/src/algorithms/libs/cshort_to_float_x2.h b/src/algorithms/libs/cshort_to_float_x2.h index 5346984a2..b084bb135 100644 --- a/src/algorithms/libs/cshort_to_float_x2.h +++ b/src/algorithms/libs/cshort_to_float_x2.h @@ -21,12 +21,7 @@ #ifndef GNSS_SDR_CSHORT_TO_FLOAT_X2_H #define GNSS_SDR_CSHORT_TO_FLOAT_X2_H - -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -38,11 +33,7 @@ class cshort_to_float_x2; -#if GNURADIO_USES_STD_POINTERS -using cshort_to_float_x2_sptr = std::shared_ptr; -#else -using cshort_to_float_x2_sptr = boost::shared_ptr; -#endif +using cshort_to_float_x2_sptr = gnss_shared_ptr; cshort_to_float_x2_sptr make_cshort_to_float_x2(); diff --git a/src/algorithms/libs/short_x2_to_cshort.h b/src/algorithms/libs/short_x2_to_cshort.h index 51e136c48..77a1dee8a 100644 --- a/src/algorithms/libs/short_x2_to_cshort.h +++ b/src/algorithms/libs/short_x2_to_cshort.h @@ -21,11 +21,7 @@ #define GNSS_SDR_SHORT_X2_TO_CSHORT_H -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star @@ -37,11 +33,7 @@ class short_x2_to_cshort; -#if GNURADIO_USES_STD_POINTERS -using short_x2_to_cshort_sptr = std::shared_ptr; -#else -using short_x2_to_cshort_sptr = boost::shared_ptr; -#endif +using short_x2_to_cshort_sptr = gnss_shared_ptr; short_x2_to_cshort_sptr make_short_x2_to_cshort(); diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index e29a4788d..c62fa0950 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -48,6 +48,11 @@ target_link_libraries(obs_gr_blocks Matio::matio ) +target_include_directories(obs_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(obs_gr_blocks PUBLIC -DGNURADIO_USES_STD_POINTERS=1 diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h index 1703d36cd..5d188a5f3 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h @@ -23,6 +23,7 @@ #ifndef GNSS_SDR_HYBRID_OBSERVABLES_GS_H #define GNSS_SDR_HYBRID_OBSERVABLES_GS_H +#include "gnss_block_interface.h" #include "obs_conf.h" #include // for boost::circular_buffer #include // for block @@ -35,10 +36,6 @@ #include // for std::string #include // for typeid #include // for std::vector -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Observables * \{ */ @@ -46,17 +43,14 @@ * GNU Radio blocks for the computation of GNSS observables * \{ */ + class Gnss_Synchro; class hybrid_observables_gs; template class Gnss_circular_deque; -#if GNURADIO_USES_STD_POINTERS -using hybrid_observables_gs_sptr = std::shared_ptr; -#else -using hybrid_observables_gs_sptr = boost::shared_ptr; -#endif +using hybrid_observables_gs_sptr = gnss_shared_ptr; hybrid_observables_gs_sptr hybrid_observables_gs_make(const Obs_Conf& conf_); diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 3524ba4fa..fe197b56d 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -53,6 +53,11 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +target_include_directories(resampler_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(resampler_gr_blocks diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h index c93ef57d6..fad0f9a9b 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h @@ -22,13 +22,9 @@ #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CB_H #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CB_H +#include "gnss_block_interface.h" #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Resampler * \{ */ @@ -39,11 +35,7 @@ class direct_resampler_conditioner_cb; -#if GNURADIO_USES_STD_POINTERS -using direct_resampler_conditioner_cb_sptr = std::shared_ptr; -#else -using direct_resampler_conditioner_cb_sptr = boost::shared_ptr; -#endif +using direct_resampler_conditioner_cb_sptr = gnss_shared_ptr; direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( double sample_freq_in, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h index f4e46d457..2506dd0b9 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h @@ -28,13 +28,9 @@ #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H +#include "gnss_block_interface.h" #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Resampler * \{ */ @@ -44,11 +40,7 @@ class direct_resampler_conditioner_cc; -#if GNURADIO_USES_STD_POINTERS -using direct_resampler_conditioner_cc_sptr = std::shared_ptr; -#else -using direct_resampler_conditioner_cc_sptr = boost::shared_ptr; -#endif +using direct_resampler_conditioner_cc_sptr = gnss_shared_ptr; direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( double sample_freq_in, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h index 5784a65ea..3a2a410f4 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h @@ -22,13 +22,9 @@ #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H +#include "gnss_block_interface.h" #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Resampler * \{ */ @@ -37,11 +33,8 @@ class direct_resampler_conditioner_cs; -#if GNURADIO_USES_STD_POINTERS -using direct_resampler_conditioner_cs_sptr = std::shared_ptr; -#else -using direct_resampler_conditioner_cs_sptr = boost::shared_ptr; -#endif + +using direct_resampler_conditioner_cs_sptr = gnss_shared_ptr; direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( double sample_freq_in, diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h index 2bfd79c26..53766a213 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.h +++ b/src/algorithms/signal_generator/adapters/signal_generator.h @@ -72,11 +72,7 @@ public: gr::basic_block_sptr get_right_block() override; private: -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr gen_source_; -#else - boost::shared_ptr gen_source_; -#endif + gnss_shared_ptr gen_source_; gr::blocks::vector_to_stream::sptr vector_to_stream_; gr::blocks::file_sink::sptr file_sink_; std::string role_; diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 4b987e7c1..88d391036 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -38,6 +38,11 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +target_include_directories(signal_generator_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + # Workaround for CentOS 7 if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h index 8814deb18..23dcd977d 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h @@ -20,34 +20,16 @@ #ifndef GNSS_SDR_SIGNAL_GENERATOR_C_H #define GNSS_SDR_SIGNAL_GENERATOR_C_H +#include "gnss_block_interface.h" #include #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif class signal_generator_c; -/* -* We use std::shared_ptr's instead of raw pointers for all access -* to gr_blocks (and many other data structures). The shared_ptr gets -* us transparent reference counting, which greatly simplifies storage -* management issues. -* -* See https://www.boost.org/doc/libs/release/libs/smart_ptr/doc/html/smart_ptr.html -* -* As a convention, the _sptr suffix indicates a std::shared_ptr -*/ -#if GNURADIO_USES_STD_POINTERS -using signal_generator_c_sptr = std::shared_ptr; -#else -using signal_generator_c_sptr = boost::shared_ptr; -#endif +using signal_generator_c_sptr = gnss_shared_ptr; /*! * \brief Return a shared_ptr to a new instance of gen_source. diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 0c4455ecd..8e7b70f17 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -27,14 +27,9 @@ #include #include #include -#include #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -83,13 +78,8 @@ public: private: Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; -#if GNURADIO_USES_STD_POINTERS - std::vector> null_sinks_; - std::vector> file_sink_; -#else - std::vector> null_sinks_; - std::vector> file_sink_; -#endif + std::vector> null_sinks_; + std::vector> file_sink_; std::string role_; std::string item_type_; diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 3245c4db4..c6dcfae78 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -32,12 +32,7 @@ #include #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source Signal Source * Classes for Signal Source management. @@ -112,11 +107,7 @@ public: private: gr::blocks::file_source::sptr file_source_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index 519582096..d4389b0b2 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -33,12 +33,8 @@ #include "concurrent_queue.h" #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif + /** \addtogroup Signal_Source * \{ */ @@ -82,12 +78,7 @@ public: private: gr::iio::fmcomms2_source_f32c::sptr fmcomms2_source_f32c_; - -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr file_sink_; std::string role_; diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h index 4fc2e5131..a95849a1e 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h @@ -32,13 +32,8 @@ #include #include #include -#include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -112,11 +107,7 @@ public: private: std::vector file_source_vec_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; std::vector throttle_vec_; std::vector filename_vec_; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index 3ef2624db..8fcc304da 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -32,12 +32,7 @@ #include #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -109,11 +104,7 @@ public: private: gr::blocks::file_source::sptr file_source_; unpack_byte_2bit_samples_sptr unpack_byte_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; uint64_t samples_; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index 1daa122f4..05dfdf684 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -31,16 +31,13 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ /** \addtogroup Signal_Source_adapters * \{ */ + class ConfigurationInterface; /*! @@ -84,11 +81,7 @@ private: void driver_instance(); osmosdr::source::sptr osmosdr_source_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr file_sink_; std::string role_; diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 4c5de55a7..5fcef8b76 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -32,12 +32,8 @@ #include "concurrent_queue.h" #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif + /** \addtogroup Signal_Source * \{ */ @@ -83,11 +79,7 @@ public: private: gr::iio::pluto_source::sptr plutosdr_source_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr file_sink_; std::string role_; diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index 21641283e..5a2bee4b7 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -28,13 +28,8 @@ #include #include #include -#include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -89,11 +84,7 @@ private: rtl_tcp_signal_source_c_sptr signal_source_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr file_sink_; std::string role_; diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index cefd7c4df..0b7c11b9e 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -30,12 +30,7 @@ #include #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -110,11 +105,7 @@ public: private: gr::blocks::file_source::sptr file_source_; unpack_intspir_1bit_samples_sptr unpack_intspir_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; std::string filename_; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index b1812f486..2fe2e3962 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -34,13 +34,8 @@ #include #include #include -#include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -111,11 +106,7 @@ public: private: gr::blocks::file_source::sptr file_source_; gr::blocks::deinterleave::sptr deint_; -#if GNURADIO_USES_STD_POINTERS - std::vector> valve_vec_; -#else - std::vector> valve_vec_; -#endif + std::vector> valve_vec_; std::vector endian_vec_; std::vector null_sinks_; std::vector unpack_spir_vec_; diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index 6e2b5327a..f4fe0ee80 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -33,12 +33,7 @@ #include #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -114,11 +109,7 @@ private: gr::blocks::file_source::sptr file_source_; gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_; unpack_byte_2bit_cpx_samples_sptr unpack_byte_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; std::string filename_; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 0fc029b32..0f79e5347 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -34,12 +34,7 @@ #include #include #include -#include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -134,11 +129,7 @@ private: gr::blocks::file_source::sptr file_source_; unpack_2bit_samples_sptr unpack_samples_; gr::basic_block_sptr char_to_float_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + gnss_shared_ptr valve_; gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; std::string filename_; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index aa0a59ce2..276500b07 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -27,13 +27,8 @@ #include #include #include -#include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Signal_Source @@ -81,11 +76,8 @@ public: private: gr::uhd::usrp_source::sptr uhd_source_; -#if GNURADIO_USES_STD_POINTERS - std::vector> valve_; -#else - std::vector> valve_; -#endif + + std::vector> valve_; std::vector file_sink_; std::vector freq_; std::vector gain_; diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 37ad0b16f..383031e5b 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -22,6 +22,7 @@ #ifndef GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H #define GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H +#include "gnss_block_interface.h" #include #include #include @@ -31,11 +32,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -47,11 +43,7 @@ class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block { public: -#if GNURADIO_USES_STD_POINTERS - typedef std::shared_ptr sptr; -#else - typedef boost::shared_ptr sptr; -#endif + using sptr = gnss_shared_ptr; static sptr make(std::string src_device, const std::string &origin_address, int udp_port, diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index 7522f4f2a..2de36d3ed 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -21,16 +21,12 @@ #define GNSS_SDR_LABSAT23_SOURCE_H #include "concurrent_queue.h" +#include "gnss_block_interface.h" #include #include #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -40,11 +36,7 @@ class labsat23_source; -#if GNURADIO_USES_STD_POINTERS -using labsat23_source_sptr = std::shared_ptr; -#else -using labsat23_source_sptr = boost::shared_ptr; -#endif +using labsat23_source_sptr = gnss_shared_ptr; labsat23_source_sptr labsat23_make_source_sptr( const char *signal_file_basename, diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index acdd0d129..489f071d6 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -27,6 +27,7 @@ #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H +#include "gnss_block_interface.h" #include "rtl_tcp_dongle_info.h" #include #include @@ -37,11 +38,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source @@ -52,11 +48,7 @@ class rtl_tcp_signal_source_c; -#if GNURADIO_USES_STD_POINTERS -using rtl_tcp_signal_source_c_sptr = std::shared_ptr; -#else -using rtl_tcp_signal_source_c_sptr = boost::shared_ptr; -#endif +using rtl_tcp_signal_source_c_sptr = gnss_shared_ptr; #if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index 5bac6ad03..0d30dcf24 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -57,14 +57,10 @@ #ifndef GNSS_SDR_UNPACK_2BIT_SAMPLES_H #define GNSS_SDR_UNPACK_2BIT_SAMPLES_H +#include "gnss_block_interface.h" #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -74,11 +70,7 @@ class unpack_2bit_samples; -#if GNURADIO_USES_STD_POINTERS -using unpack_2bit_samples_sptr = std::shared_ptr; -#else -using unpack_2bit_samples_sptr = boost::shared_ptr; -#endif +using unpack_2bit_samples_sptr = gnss_shared_ptr; unpack_2bit_samples_sptr make_unpack_2bit_samples( bool big_endian_bytes, diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h index b3ab27b2a..5189fbdea 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h @@ -24,12 +24,8 @@ #ifndef GNSS_SDR_UNPACK_BYTE_2BIT_CPX_SAMPLES_H #define GNSS_SDR_UNPACK_BYTE_2BIT_CPX_SAMPLES_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -39,11 +35,7 @@ class unpack_byte_2bit_cpx_samples; -#if GNURADIO_USES_STD_POINTERS -using unpack_byte_2bit_cpx_samples_sptr = std::shared_ptr; -#else -using unpack_byte_2bit_cpx_samples_sptr = boost::shared_ptr; -#endif +using unpack_byte_2bit_cpx_samples_sptr = gnss_shared_ptr; unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h index 6af8a5b33..e3a626d87 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h @@ -20,12 +20,9 @@ #ifndef GNSS_SDR_UNPACK_BYTE_2BIT_SAMPLES_H #define GNSS_SDR_UNPACK_BYTE_2BIT_SAMPLES_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif + /** \addtogroup Signal_Source * \{ */ @@ -34,11 +31,7 @@ class unpack_byte_2bit_samples; -#if GNURADIO_USES_STD_POINTERS -using unpack_byte_2bit_samples_sptr = std::shared_ptr; -#else -using unpack_byte_2bit_samples_sptr = boost::shared_ptr; -#endif +using unpack_byte_2bit_samples_sptr = gnss_shared_ptr; unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h index d70b00fbc..ebe432aa8 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h @@ -20,12 +20,8 @@ #ifndef GNSS_SDR_UNPACK_INTSPIR_1BIT_SAMPLES_H #define GNSS_SDR_UNPACK_INTSPIR_1BIT_SAMPLES_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source @@ -36,11 +32,7 @@ class unpack_intspir_1bit_samples; -#if GNURADIO_USES_STD_POINTERS -using unpack_intspir_1bit_samples_sptr = std::shared_ptr; -#else -using unpack_intspir_1bit_samples_sptr = boost::shared_ptr; -#endif +using unpack_intspir_1bit_samples_sptr = gnss_shared_ptr; unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index ff9941af7..85db05d14 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -21,12 +21,8 @@ #ifndef GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H #define GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H +#include "gnss_block_interface.h" #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -36,11 +32,7 @@ class unpack_spir_gss6450_samples; -#if GNURADIO_USES_STD_POINTERS -using unpack_spir_gss6450_samples_sptr = std::shared_ptr; -#else -using unpack_spir_gss6450_samples_sptr = boost::shared_ptr; -#endif +using unpack_spir_gss6450_samples_sptr = gnss_shared_ptr; unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_); diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 2794a2f03..f6a1c4b52 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -67,6 +67,7 @@ target_link_libraries(signal_source_libs target_include_directories(signal_source_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/interfaces ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc index 5e2d5157d..f1d1e0996 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc @@ -42,33 +42,18 @@ Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item, } -#if GNURADIO_USES_STD_POINTERS -std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph) +gnss_shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph) { - std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); + gnss_shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); return valve_; } -std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue) +gnss_shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue) { - std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true)); + gnss_shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true)); return valve_; } -#else -boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph) -{ - boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); - return valve_; -} - - -boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue) -{ - boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true)); - return valve_; -} -#endif void Gnss_Sdr_Valve::open_valve() diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.h b/src/algorithms/signal_source/libs/gnss_sdr_valve.h index 029daf2a7..ca8488042 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.h +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.h @@ -24,16 +24,12 @@ #define GNSS_SDR_GNSS_SDR_VALVE_H #include "concurrent_queue.h" +#include "gnss_block_interface.h" #include // for sync_block #include // for gr_vector_const_void_star #include #include // for size_t #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Signal_Source * \{ */ @@ -43,29 +39,16 @@ class Gnss_Sdr_Valve; -#if GNURADIO_USES_STD_POINTERS -std::shared_ptr gnss_sdr_make_valve( +gnss_shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue); -std::shared_ptr gnss_sdr_make_valve( +gnss_shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph); -#else -boost::shared_ptr gnss_sdr_make_valve( - size_t sizeof_stream_item, - uint64_t nitems, - Concurrent_Queue* queue); - -boost::shared_ptr gnss_sdr_make_valve( - size_t sizeof_stream_item, - uint64_t nitems, - Concurrent_Queue* queue, - bool stop_flowgraph); -#endif /*! * \brief Implementation of a GNU Radio block that sends a STOP message to the @@ -81,29 +64,17 @@ public: gr_vector_void_star& output_items); private: -#if GNURADIO_USES_STD_POINTERS - friend std::shared_ptr gnss_sdr_make_valve( + friend gnss_shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue); - friend std::shared_ptr gnss_sdr_make_valve( + friend gnss_shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph); -#else - friend boost::shared_ptr gnss_sdr_make_valve( - size_t sizeof_stream_item, - uint64_t nitems, - Concurrent_Queue* queue); - friend boost::shared_ptr gnss_sdr_make_valve( - size_t sizeof_stream_item, - uint64_t nitems, - Concurrent_Queue* queue, - bool stop_flowgraph); -#endif Gnss_Sdr_Valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 48cc517ae..690c5af3d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -68,6 +68,11 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +target_include_directories(telemetry_decoder_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(has_rotl) target_compile_definitions(telemetry_decoder_gr_blocks PRIVATE -DCOMPILER_HAS_ROTL=1 diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h index 0aba2e6c4..658ec8e5e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h @@ -24,6 +24,7 @@ #include "beidou_dnav_navigation_message.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include #include // for block @@ -32,12 +33,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif - /** \addtogroup Telemetry_Decoder * \{ */ @@ -47,11 +42,7 @@ class beidou_b1i_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using beidou_b1i_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using beidou_b1i_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using beidou_b1i_telemetry_decoder_gs_sptr = gnss_shared_ptr; beidou_b1i_telemetry_decoder_gs_sptr beidou_b1i_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h index a4ca3dcff..d36131a82 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h @@ -21,6 +21,7 @@ #define GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_GS_H #include "beidou_dnav_navigation_message.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include #include // for block @@ -29,11 +30,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Telemetry_Decoder @@ -44,13 +40,8 @@ class beidou_b3i_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS using beidou_b3i_telemetry_decoder_gs_sptr = - std::shared_ptr; -#else -using beidou_b3i_telemetry_decoder_gs_sptr = - boost::shared_ptr; -#endif + gnss_shared_ptr; beidou_b3i_telemetry_decoder_gs_sptr beidou_b3i_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h index 424da3eb2..c3464b0ed 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h @@ -26,6 +26,7 @@ #include "galileo_fnav_message.h" #include "galileo_inav_message.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include #include // for block @@ -35,11 +36,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif /** \addtogroup Telemetry_Decoder * \{ */ @@ -49,11 +45,7 @@ class galileo_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using galileo_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using galileo_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using galileo_telemetry_decoder_gs_sptr = gnss_shared_ptr; galileo_telemetry_decoder_gs_sptr galileo_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h index 412911b2d..c7f523b7a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h @@ -24,6 +24,7 @@ #include "GLONASS_L1_L2_CA.h" #include "glonass_gnav_navigation_message.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include "gnss_synchro.h" #include @@ -33,11 +34,6 @@ #include #include // for ofstream #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif /** \addtogroup Telemetry_Decoder * \{ */ @@ -47,11 +43,7 @@ class glonass_l1_ca_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using glonass_l1_ca_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using glonass_l1_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using glonass_l1_ca_telemetry_decoder_gs_sptr = gnss_shared_ptr; glonass_l1_ca_telemetry_decoder_gs_sptr glonass_l1_ca_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h index 4753bd2fb..b8cfc22fb 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h @@ -23,6 +23,7 @@ #include "GLONASS_L1_L2_CA.h" #include "glonass_gnav_navigation_message.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include "gnss_synchro.h" #include @@ -32,11 +33,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif /** \addtogroup Telemetry_Decoder * \{ */ @@ -46,11 +42,7 @@ class glonass_l2_ca_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using glonass_l2_ca_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using glonass_l2_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using glonass_l2_ca_telemetry_decoder_gs_sptr = gnss_shared_ptr; glonass_l2_ca_telemetry_decoder_gs_sptr glonass_l2_ca_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index f1bd92277..566db3e98 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h @@ -21,6 +21,7 @@ #define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H #include "GPS_L1_CA.h" +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include "gnss_synchro.h" #include "gps_navigation_message.h" @@ -31,11 +32,6 @@ #include // for int32_t #include // for ofstream #include // for string -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif /** \addtogroup Telemetry_Decoder * \{ */ @@ -46,11 +42,7 @@ class gps_l1_ca_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using gps_l1_ca_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using gps_l1_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using gps_l1_ca_telemetry_decoder_gs_sptr = gnss_shared_ptr; gps_l1_ca_telemetry_decoder_gs_sptr gps_l1_ca_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h index 424c3726f..d49faf7d3 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h @@ -20,6 +20,7 @@ #define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include "gps_cnav_navigation_message.h" #include @@ -27,11 +28,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif extern "C" { @@ -43,13 +39,10 @@ extern "C" /** \addtogroup Telemetry_Decoder_gnuradio_blocks * \{ */ + class gps_l2c_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using gps_l2c_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using gps_l2c_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using gps_l2c_telemetry_decoder_gs_sptr = gnss_shared_ptr; gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h index fcd73f334..3f283259a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h @@ -20,7 +20,8 @@ #define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_GS_H -#include "GPS_L5.h" // for GPS_L5I_NH_CODE_LENGTH +#include "GPS_L5.h" // for GPS_L5I_NH_CODE_LENGTH +#include "gnss_block_interface.h" #include "gnss_satellite.h" // for Gnss_Satellite #include "gps_cnav_navigation_message.h" // for Gps_CNAV_Navigation_Message #include @@ -29,30 +30,21 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif extern "C" { #include "cnav_msg.h" } - /** \addtogroup Telemetry_Decoder * \{ */ /** \addtogroup Telemetry_Decoder_gnuradio_blocks * \{ */ + class gps_l5_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using gps_l5_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using gps_l5_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using gps_l5_telemetry_decoder_gs_sptr = gnss_shared_ptr; gps_l5_telemetry_decoder_gs_sptr gps_l5_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.h index d1741ba40..f89634e21 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.h @@ -20,6 +20,7 @@ #ifndef GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_GS_H #define GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_GS_H +#include "gnss_block_interface.h" #include "gnss_satellite.h" #include // for crc_optimal #include @@ -32,11 +33,6 @@ #include #include // for pair #include -#if GNURADIO_USES_STD_POINTERS -#include // for std::shared_ptr -#else -#include -#endif /** \addtogroup Telemetry_Decoder * \{ */ @@ -48,11 +44,7 @@ class Viterbi_Decoder; class sbas_l1_telemetry_decoder_gs; -#if GNURADIO_USES_STD_POINTERS -using sbas_l1_telemetry_decoder_gs_sptr = std::shared_ptr; -#else -using sbas_l1_telemetry_decoder_gs_sptr = boost::shared_ptr; -#endif +using sbas_l1_telemetry_decoder_gs_sptr = gnss_shared_ptr; sbas_l1_telemetry_decoder_gs_sptr sbas_l1_make_telemetry_decoder_gs( const Gnss_Satellite &satellite, diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index e05ead426..360844188 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -103,6 +103,11 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +target_include_directories(tracking_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(ENABLE_CUDA) if(CMAKE_VERSION VERSION_GREATER 3.11) target_include_directories(tracking_gr_blocks diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index c38040806..e3724eb0e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -24,6 +24,7 @@ #include "cpu_multicorrelator_real_codes.h" #include "dll_pll_conf.h" #include "exponential_smoother.h" +#include "gnss_block_interface.h" #include "tracking_FLL_PLL_filter.h" // for PLL/FLL filter #include "tracking_loop_filter.h" // for DLL filter #include @@ -38,11 +39,6 @@ #include // for string #include // for typeid #include // for pair -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -54,12 +50,7 @@ class Gnss_Synchro; class dll_pll_veml_tracking; -#if GNURADIO_USES_STD_POINTERS -using dll_pll_veml_tracking_sptr = std::shared_ptr; -#else -using dll_pll_veml_tracking_sptr = boost::shared_ptr; -#endif - +using dll_pll_veml_tracking_sptr = gnss_shared_ptr; dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index 276f48ab7..be21e2396 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -23,6 +23,7 @@ #include "dll_pll_conf_fpga.h" #include "exponential_smoother.h" +#include "gnss_block_interface.h" #include "tracking_FLL_PLL_filter.h" // for PLL/FLL filter #include "tracking_loop_filter.h" // for DLL filter #include @@ -38,10 +39,6 @@ #include // for string #include // for typeid #include // for pair -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -53,11 +50,7 @@ class Fpga_Multicorrelator_8sc; class Gnss_Synchro; class dll_pll_veml_tracking_fpga; -#if GNURADIO_USES_STD_POINTERS -using dll_pll_veml_tracking_fpga_sptr = std::shared_ptr; -#else -using dll_pll_veml_tracking_fpga_sptr = boost::shared_ptr; -#endif +using dll_pll_veml_tracking_fpga_sptr = gnss_shared_ptr; dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h index 7d8571798..a8dffde79 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h @@ -29,6 +29,7 @@ #define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tcp_communication.h" #include @@ -36,11 +37,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -50,11 +46,7 @@ class Galileo_E1_Tcp_Connector_Tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using galileo_e1_tcp_connector_tracking_cc_sptr = std::shared_ptr; -#else -using galileo_e1_tcp_connector_tracking_cc_sptr = boost::shared_ptr; -#endif +using galileo_e1_tcp_connector_tracking_cc_sptr = gnss_shared_ptr; galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h index f6776b95a..c418e9e73 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -33,6 +33,7 @@ #include "tracking_FLL_PLL_filter.h" // #include "tracking_loop_filter.h" #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include #include #include // for volk_gnsssdr::vector @@ -40,11 +41,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -54,11 +50,7 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr = std::shared_ptr; -#else -using glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr; -#endif +using glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr = gnss_shared_ptr; glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 1d38892f6..5f5fc7fd4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -30,6 +30,7 @@ #include "cpu_multicorrelator_16sc.h" #include "glonass_l1_signal_processing.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" @@ -40,11 +41,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking @@ -55,11 +51,7 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_sc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr = std::shared_ptr; -#else -using glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr; -#endif +using glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr = gnss_shared_ptr; glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h index 978f37f3a..a18ce893d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h @@ -29,6 +29,7 @@ #define GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_CC_H #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" @@ -37,11 +38,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking @@ -52,11 +48,7 @@ class Glonass_L1_Ca_Dll_Pll_Tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l1_ca_dll_pll_tracking_cc_sptr = std::shared_ptr; -#else -using glonass_l1_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr; -#endif +using glonass_l1_ca_dll_pll_tracking_cc_sptr = gnss_shared_ptr; glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h index 926f1005c..eadf8b69c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h @@ -27,6 +27,7 @@ #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_CC_H #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" @@ -37,11 +38,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -51,11 +47,7 @@ class glonass_l2_ca_dll_pll_c_aid_tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr = std::shared_ptr; -#else -using glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr; -#endif +using glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr = gnss_shared_ptr; glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 82f876af4..eecb524d2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -28,6 +28,7 @@ #include "cpu_multicorrelator_16sc.h" #include "glonass_l2_signal_processing.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" @@ -37,11 +38,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -51,12 +47,7 @@ class glonass_l2_ca_dll_pll_c_aid_tracking_sc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr = std::shared_ptr; -#else -using glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr; -#endif - +using glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr = gnss_shared_ptr; glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h index 9e0f30b68..5f951d5a0 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h @@ -27,6 +27,7 @@ #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_CC_H #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" @@ -35,11 +36,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -49,11 +45,7 @@ class Glonass_L2_Ca_Dll_Pll_Tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using glonass_l2_ca_dll_pll_tracking_cc_sptr = std::shared_ptr; -#else -using glonass_l2_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr; -#endif +using glonass_l2_ca_dll_pll_tracking_cc_sptr = gnss_shared_ptr; glonass_l2_ca_dll_pll_tracking_cc_sptr glonass_l2_ca_dll_pll_make_tracking_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h index e759aa7bd..5c0f9270b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h @@ -26,6 +26,7 @@ #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H #include "cuda_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" @@ -34,11 +35,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -48,13 +44,7 @@ class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc; -#if GNURADIO_USES_STD_POINTERS -typedef std::shared_ptr - gps_l1_ca_dll_pll_tracking_gpu_cc_sptr; -#else -typedef boost::shared_ptr - gps_l1_ca_dll_pll_tracking_gpu_cc_sptr; -#endif +using gps_l1_ca_dll_pll_tracking_gpu_cc_sptr = gnss_shared_ptr; gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_make_tracking_gpu_cc( diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index 6bd4d0f57..75c317a91 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -35,6 +35,7 @@ #include "bayesian_estimation.h" #include "cpu_multicorrelator_real_codes.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" @@ -44,11 +45,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -58,11 +54,7 @@ class Gps_L1_Ca_Kf_Tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using gps_l1_ca_kf_tracking_cc_sptr = std::shared_ptr; -#else -using gps_l1_ca_kf_tracking_cc_sptr = boost::shared_ptr; -#endif +using gps_l1_ca_kf_tracking_cc_sptr = gnss_shared_ptr; gps_l1_ca_kf_tracking_cc_sptr gps_l1_ca_kf_make_tracking_cc(uint32_t order, diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 329b2629c..0a7feb14a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -27,6 +27,7 @@ #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H #include "cpu_multicorrelator.h" +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "tcp_communication.h" #include @@ -34,11 +35,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Tracking * \{ */ @@ -48,11 +44,7 @@ class Gps_L1_Ca_Tcp_Connector_Tracking_cc; -#if GNURADIO_USES_STD_POINTERS -using gps_l1_ca_tcp_connector_tracking_cc_sptr = std::shared_ptr; -#else -using gps_l1_ca_tcp_connector_tracking_cc_sptr = boost::shared_ptr; -#endif +using gps_l1_ca_tcp_connector_tracking_cc_sptr = gnss_shared_ptr; gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc( diff --git a/src/core/interfaces/gnss_block_interface.h b/src/core/interfaces/gnss_block_interface.h index 6bcbfa9e2..a8b1368da 100644 --- a/src/core/interfaces/gnss_block_interface.h +++ b/src/core/interfaces/gnss_block_interface.h @@ -29,6 +29,7 @@ #include #include #include +#include // for std::forward /** \addtogroup Core * \{ */ @@ -36,6 +37,27 @@ * \{ */ +#if GNURADIO_USES_STD_POINTERS +#include +template +using gnss_shared_ptr = std::shared_ptr; +template +gnss_shared_ptr gnss_make_shared(Args &&... args) +{ + return std::make_shared(std::forward(args)...); +} +#else +#include +#include +template +using gnss_shared_ptr = boost::shared_ptr; +template +gnss_shared_ptr gnss_make_shared(Args &&... args) +{ + return boost::make_shared(std::forward(args)...); +} +#endif + /*! * \brief This abstract class represents an interface to GNSS blocks. * diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 70ee5bc76..db7ad6f5d 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -87,6 +87,11 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +target_include_directories(core_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) diff --git a/src/core/libs/channel_status_msg_receiver.h b/src/core/libs/channel_status_msg_receiver.h index dcb9a86fa..9c9ab8d80 100644 --- a/src/core/libs/channel_status_msg_receiver.h +++ b/src/core/libs/channel_status_msg_receiver.h @@ -21,16 +21,13 @@ #ifndef GNSS_SDR_CHANNEL_STATUS_MSG_RECEIVER_CC_H #define GNSS_SDR_CHANNEL_STATUS_MSG_RECEIVER_CC_H +#include "gnss_block_interface.h" #include "gnss_synchro.h" #include "monitor_pvt.h" #include #include #include #include -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif /** \addtogroup Core * \{ */ @@ -40,11 +37,7 @@ class channel_status_msg_receiver; -#if GNURADIO_USES_STD_POINTERS -using channel_status_msg_receiver_sptr = std::shared_ptr; -#else -using channel_status_msg_receiver_sptr = boost::shared_ptr; -#endif +using channel_status_msg_receiver_sptr = gnss_shared_ptr; channel_status_msg_receiver_sptr channel_status_msg_receiver_make(); diff --git a/src/core/libs/gnss_sdr_fpga_sample_counter.h b/src/core/libs/gnss_sdr_fpga_sample_counter.h index 7e4824e77..fa4b6361f 100644 --- a/src/core/libs/gnss_sdr_fpga_sample_counter.h +++ b/src/core/libs/gnss_sdr_fpga_sample_counter.h @@ -22,15 +22,11 @@ #ifndef GNSS_SDR_GNSS_SDR_FPGA_SAMPLE_COUNTER_H #define GNSS_SDR_GNSS_SDR_FPGA_SAMPLE_COUNTER_H +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Core * \{ */ @@ -40,11 +36,7 @@ class gnss_sdr_fpga_sample_counter; -#if GNURADIO_USES_STD_POINTERS -using gnss_sdr_fpga_sample_counter_sptr = std::shared_ptr; -#else -using gnss_sdr_fpga_sample_counter_sptr = boost::shared_ptr; -#endif +using gnss_sdr_fpga_sample_counter_sptr = gnss_shared_ptr; gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms); diff --git a/src/core/libs/gnss_sdr_sample_counter.h b/src/core/libs/gnss_sdr_sample_counter.h index 87a3af17b..c5b816d01 100644 --- a/src/core/libs/gnss_sdr_sample_counter.h +++ b/src/core/libs/gnss_sdr_sample_counter.h @@ -21,15 +21,11 @@ #ifndef GNSS_SDR_GNSS_SDR_SAMPLE_COUNTER_H #define GNSS_SDR_GNSS_SDR_SAMPLE_COUNTER_H +#include "gnss_block_interface.h" #include #include // for gr_vector_const_void_star #include // for size_t #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Core * \{ */ @@ -40,11 +36,7 @@ class gnss_sdr_sample_counter; -#if GNURADIO_USES_STD_POINTERS -using gnss_sdr_sample_counter_sptr = std::shared_ptr; -#else -using gnss_sdr_sample_counter_sptr = boost::shared_ptr; -#endif +using gnss_sdr_sample_counter_sptr = gnss_shared_ptr; gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter( double _fs, diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index dbb69470e..dc8c3506d 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -60,6 +60,7 @@ get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) target_include_directories(core_monitor PUBLIC SYSTEM ${PROTO_INCLUDE_HEADERS} + ${CMAKE_SOURCE_DIR}/src/core/interfaces PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique ) diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 3cd2018ad..0380ed5db 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -23,17 +23,13 @@ #ifndef GNSS_SDR_GNSS_SYNCHRO_MONITOR_H #define GNSS_SDR_GNSS_SYNCHRO_MONITOR_H +#include "gnss_block_interface.h" #include "gnss_synchro_udp_sink.h" #include #include // for gr_vector_void_star #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif /** \addtogroup Core * \{ */ @@ -44,11 +40,7 @@ class gnss_synchro_monitor; -#if GNURADIO_USES_STD_POINTERS -using gnss_synchro_monitor_sptr = std::shared_ptr; -#else -using gnss_synchro_monitor_sptr = boost::shared_ptr; -#endif +using gnss_synchro_monitor_sptr = gnss_shared_ptr; gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels, int decimation_factor, diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 8cadf9c12..d1c69372f 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -69,6 +69,10 @@ if(ENABLE_FPGA) target_compile_definitions(core_receiver PUBLIC -DENABLE_FPGA=1) endif() +if(GNURADIO_USES_STD_POINTERS) + target_compile_definitions(core_receiver PUBLIC -DGNURADIO_USES_STD_POINTERS=1) +endif() + if(ENABLE_RAW_UDP) target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1) endif() diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index 0b05d74c4..434033485 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -26,6 +26,7 @@ #include "galileo_e5a_pcps_acquisition.h" #include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l2_ca_pcps_acquisition.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition.h" @@ -44,11 +45,6 @@ #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif #if HAS_GENERIC_LAMBDA #else @@ -110,11 +106,7 @@ DEFINE_bool(acq_test_dump, false, "Dump the results of an acquisition block into // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class AcqPerfTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using AcqPerfTest_msg_rx_sptr = std::shared_ptr; -#else -using AcqPerfTest_msg_rx_sptr = boost::shared_ptr; -#endif +using AcqPerfTest_msg_rx_sptr = gnss_shared_ptr; AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index a8e9590f5..7618fa4db 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -47,19 +47,12 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index 3881a9c06..4653dcc50 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -45,19 +45,11 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 74c4eb851..9beb1c471 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -55,18 +55,11 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr = boost::shared_ptr; -#endif + +using GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 78b03e57b..004a63bab 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -67,21 +67,11 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 8a703f494..dcea38a74 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -48,19 +48,12 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 2188e3183..cfe36f6fb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -58,11 +58,7 @@ DEFINE_int32(e1_value_CN0_dB_0, 50, "Value for the CN0_dB_0 in channel 0"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index b3319201e..a82599d03 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -53,11 +53,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 3a3030617..7d2f41fd3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -49,11 +49,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr = gnss_shared_ptr; GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc index d115ab84a..9615e6c55 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc @@ -52,19 +52,10 @@ #include #endif -#if GNURADIO_USES_STD_POINTERS -#else -#include -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5bPcpsAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GalileoE5bPcpsAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GalileoE5bPcpsAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GalileoE5bPcpsAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GalileoE5bPcpsAcquisitionTest_msg_rx_sptr GalileoE5bPcpsAcquisitionTest_msg_rx_make(Concurrent_Queue& queue); @@ -148,11 +139,7 @@ protected: Concurrent_Queue channel_internal_queue; std::shared_ptr> queue; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr acquisition; -#else - boost::shared_ptr acquisition; -#endif + gnss_shared_ptr acquisition; gr::top_block_sptr top_block; std::shared_ptr config; std::thread ch_thread; @@ -324,11 +311,7 @@ void GalileoE5bPcpsAcquisitionTest::stop_queue() TEST_F(GalileoE5bPcpsAcquisitionTest, Instantiate) { init(); -#if GNURADIO_USES_STD_POINTERS - acquisition = std::make_shared(config.get(), "Acquisition_7X", 1, 0); -#else - acquisition = boost::make_shared(config.get(), "Acquisition_7X", 1, 0); -#endif + acquisition = gnss_make_shared(config.get(), "Acquisition_7X", 1, 0); } @@ -343,11 +326,7 @@ TEST_F(GalileoE5bPcpsAcquisitionTest, ConnectAndRun) init(); -#if GNURADIO_USES_STD_POINTERS - acquisition = std::make_shared(config.get(), "Acquisition_7X", 1, 0); -#else - acquisition = boost::make_shared(config.get(), "Acquisition_7X", 1, 0); -#endif + acquisition = gnss_make_shared(config.get(), "Acquisition_7X", 1, 0); auto msg_rx = GalileoE5bPcpsAcquisitionTest_msg_rx_make(channel_internal_queue); @@ -377,11 +356,8 @@ TEST_F(GalileoE5bPcpsAcquisitionTest, ValidationOfResults) init(); -#if GNURADIO_USES_STD_POINTERS - acquisition = std::make_shared(config.get(), "Acquisition_7X", 1, 0); -#else - acquisition = boost::make_shared(config.get(), "Acquisition_7X", 1, 0); -#endif + acquisition = gnss_make_shared(config.get(), "Acquisition_7X", 1, 0); + std::shared_ptr input_filter = std::make_shared(config.get(), "InputFilter", 1, 1); auto msg_rx = GalileoE5bPcpsAcquisitionTest_msg_rx_make(channel_internal_queue); queue = std::make_shared>(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index d04aa7605..ca2014254 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -55,11 +55,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr = std::shared_ptr; -#else -using GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr = gnss_shared_ptr; GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 78728ed6b..0c3365d5e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -50,11 +50,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaPcpsAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GlonassL1CaPcpsAcquisitionTest_msg_rx_sptr GlonassL1CaPcpsAcquisitionTest_msg_rx_make(); @@ -178,11 +174,7 @@ void GlonassL1CaPcpsAcquisitionTest::init() TEST_F(GlonassL1CaPcpsAcquisitionTest, Instantiate) { init(); -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_1G", 1, 0); -#else - boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1G", 1, 0); -#endif + auto acquisition = gnss_make_shared(config.get(), "Acquisition_1G", 1, 0); } @@ -196,11 +188,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); init(); -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_1G", 1, 0); -#else - boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1G", 1, 0); -#endif + auto acquisition = gnss_make_shared(config.get(), "Acquisition_1G", 1, 0); auto msg_rx = GlonassL1CaPcpsAcquisitionTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index e48e9432e..916d9a8aa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -53,11 +53,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL2CaPcpsAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -typedef std::shared_ptr GlonassL2CaPcpsAcquisitionTest_msg_rx_sptr; -#else -typedef boost::shared_ptr GlonassL2CaPcpsAcquisitionTest_msg_rx_sptr; -#endif +using GlonassL2CaPcpsAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GlonassL2CaPcpsAcquisitionTest_msg_rx_sptr GlonassL2CaPcpsAcquisitionTest_msg_rx_make(concurrent_queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index c359ea580..ba8373aaf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -56,11 +56,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 1b690edfc..c40e45a36 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include #if HAS_GENERIC_LAMBDA @@ -63,22 +64,11 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#include -#endif - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CaPcpsAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CaPcpsAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CaPcpsAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GpsL1CaPcpsAcquisitionTest_msg_rx_sptr GpsL1CaPcpsAcquisitionTest_msg_rx_make(); @@ -276,23 +266,13 @@ TEST_F(GpsL1CaPcpsAcquisitionTest /*unused*/, ConnectAndRun /*unused*/) top_block = gr::make_top_block("Acquisition test"); init(); -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 0); - std::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); -#else - boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1C", 1, 0); - boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); -#endif + gnss_shared_ptr acquisition = gnss_make_shared(config.get(), "Acquisition_1C", 1, 0); + gnss_shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); ASSERT_NO_THROW({ acquisition->connect(top_block); -#if GNURADIO_USES_STD_POINTERS auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); -#else - boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); -#endif top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -331,13 +311,9 @@ TEST_F(GpsL1CaPcpsAcquisitionTest /*unused*/, ValidationOfResults /*unused*/) fs::create_directory(data_str); } -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 0); - std::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); -#else - boost::shared_ptr acquisition = boost::make_shared(config.get(), "Acquisition_1C", 1, 0); - boost::shared_ptr msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); -#endif + auto acquisition = gnss_make_shared(config.get(), "Acquisition_1C", 1, 0); + auto msg_rx = GpsL1CaPcpsAcquisitionTest_msg_rx_make(); + ASSERT_NO_THROW({ acquisition->set_channel(1); }) << "Failure setting channel."; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index b29681951..892232746 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -51,11 +51,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -typedef std::shared_ptr GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_sptr; -#else -typedef boost::shared_ptr GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_sptr; -#endif +using GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 046db9394..9c543d77b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -55,11 +55,7 @@ DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr = gnss_shared_ptr; GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 6f50a4904..ba2207e82 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -53,11 +53,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr = gnss_shared_ptr; GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index 6aab65a4a..c29e0581b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -69,11 +69,7 @@ namespace fs = boost::filesystem; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL2MPcpsAcquisitionTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL2MPcpsAcquisitionTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL2MPcpsAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL2MPcpsAcquisitionTest_msg_rx_sptr = gnss_shared_ptr; GpsL2MPcpsAcquisitionTest_msg_rx_sptr GpsL2MPcpsAcquisitionTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index cc64b346d..777b833e1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -49,6 +49,8 @@ target_link_libraries(signal_processing_testing_lib ) target_include_directories(signal_processing_testing_lib + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files ) @@ -75,6 +77,13 @@ if(USE_BOOST_BIND_PLACEHOLDERS) ) endif() +if(GNURADIO_USES_STD_POINTERS) + target_compile_definitions(signal_processing_testing_lib + PUBLIC -DGNURADIO_USES_STD_POINTERS=1 + ) +endif() + + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(signal_processing_testing_lib diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h index 13fee5132..10007810c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h @@ -22,24 +22,16 @@ #ifndef GNSS_SDR_ACQUISITION_MSG_RX_H #define GNSS_SDR_ACQUISITION_MSG_RX_H +#include "gnss_block_interface.h" #include #include #include -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif // ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### class Acquisition_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using Acquisition_msg_rx_sptr = std::shared_ptr; -#else -using Acquisition_msg_rx_sptr = boost::shared_ptr; -#endif +using Acquisition_msg_rx_sptr = gnss_shared_ptr; Acquisition_msg_rx_sptr Acquisition_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index d78518ba2..9aad51054 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -81,22 +81,12 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### class HybridObservablesTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using HybridObservablesTest_msg_rx_sptr = std::shared_ptr; -#else -using HybridObservablesTest_msg_rx_sptr = boost::shared_ptr; -#endif - +using HybridObservablesTest_msg_rx_sptr = gnss_shared_ptr; HybridObservablesTest_msg_rx_sptr HybridObservablesTest_msg_rx_make(); @@ -580,11 +570,8 @@ bool HybridObservablesTest::acquire_signal() // top_block_acq->connect(head_samples, 0, acquisition->get_left_block(), 0); } -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr msg_rx; -#else - boost::shared_ptr msg_rx; -#endif + gnss_shared_ptr msg_rx; + try { msg_rx = Acquisition_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index 7b7863eb9..e293023b4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -81,19 +81,11 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif + class HybridObservablesTest_msg_rx_Fpga; -#if GNURADIO_USES_STD_POINTERS -using HybridObservablesTest_msg_rx_Fpga_sptr = std::shared_ptr; -#else -using HybridObservablesTest_msg_rx_Fpga_sptr = boost::shared_ptr; -#endif +using HybridObservablesTest_msg_rx_Fpga_sptr = gnss_shared_ptr; HybridObservablesTest_msg_rx_Fpga_sptr HybridObservablesTest_msg_rx_Fpga_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index d268aabe7..8bde9e366 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -53,21 +53,12 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### class GpsL1CADllPllTelemetryDecoderTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr = gnss_shared_ptr; GpsL1CADllPllTelemetryDecoderTest_msg_rx_sptr GpsL1CADllPllTelemetryDecoderTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 0ddb4cd72..dce8a386e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -42,11 +42,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllCAidTrackingTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr = std::shared_ptr; -#else -using GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr = gnss_shared_ptr; GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr GlonassL1CaDllPllCAidTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index 406ac52c2..8f5a968d4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -49,11 +49,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllTrackingTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GlonassL1CaDllPllTrackingTest_msg_rx_sptr = std::shared_ptr; -#else -using GlonassL1CaDllPllTrackingTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GlonassL1CaDllPllTrackingTest_msg_rx_sptr = gnss_shared_ptr; GlonassL1CaDllPllTrackingTest_msg_rx_sptr GlonassL1CaDllPllTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 0d09fa00a..9ab27aa82 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -21,6 +21,7 @@ #include "GPS_L1_CA.h" #include "gnss_block_factory.h" +#include "gnss_block_interface.h" #include "gnuplot_i.h" #include "in_memory_configuration.h" #include "signal_generator_flags.h" @@ -67,20 +68,11 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CADllPllTrackingTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CADllPllTrackingTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CADllPllTrackingTest_msg_rx_sptr = gnss_shared_ptr; GpsL1CADllPllTrackingTest_msg_rx_sptr GpsL1CADllPllTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 642be7ebc..9db873bdd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -56,11 +56,6 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif #define DMA_TRACK_TRANSFER_SIZE 2046 // DMA transfer size for tracking #define MIN_SAMPLES_REMAINING 20000 // number of remaining samples in the DMA that causes the CPU to stop the flowgraph (it has to be a bit alrger than 2x max packet size) @@ -159,11 +154,7 @@ void sending_thread(const gr::top_block_sptr &top_block, const char *file_name) // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTestFpga_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CADllPllTrackingTestFpga_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CADllPllTrackingTestFpga_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL1CADllPllTrackingTestFpga_msg_rx_sptr = gnss_shared_ptr; GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index dfa7d5c2f..1f22f9602 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -21,6 +21,7 @@ #include "GPS_L1_CA.h" #include "gnss_block_factory.h" +#include "gnss_block_interface.h" #include "gnss_sdr_flags.h" #include "gnuplot_i.h" #include "in_memory_configuration.h" @@ -66,23 +67,14 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif - DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CAKfTrackingTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL1CAKfTrackingTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL1CAKfTrackingTest_msg_rx_sptr = boost::shared_ptr; -#endif + +using GpsL1CAKfTrackingTest_msg_rx_sptr = gnss_shared_ptr; GpsL1CAKfTrackingTest_msg_rx_sptr GpsL1CAKfTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 744098257..3f2eead9d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -44,20 +44,12 @@ #else #include #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL2MDllPllTrackingTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using GpsL2MDllPllTrackingTest_msg_rx_sptr = std::shared_ptr; -#else -using GpsL2MDllPllTrackingTest_msg_rx_sptr = boost::shared_ptr; -#endif +using GpsL2MDllPllTrackingTest_msg_rx_sptr = gnss_shared_ptr; GpsL2MDllPllTrackingTest_msg_rx_sptr GpsL2MDllPllTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index f93afec3e..fe44bc98e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -30,6 +30,7 @@ #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_pcps_acquisition.h" #include "gnss_block_factory.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition.h" @@ -82,21 +83,11 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif - // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using TrackingPullInTest_msg_rx_sptr = std::shared_ptr; -#else -using TrackingPullInTest_msg_rx_sptr = boost::shared_ptr; -#endif +using TrackingPullInTest_msg_rx_sptr = gnss_shared_ptr; TrackingPullInTest_msg_rx_sptr TrackingPullInTest_msg_rx_make(); @@ -592,11 +583,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) top_block_acq->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); // top_block_acq->connect(head_samples, 0, acquisition->get_left_block(), 0); } -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr msg_rx; -#else - boost::shared_ptr msg_rx; -#endif + gnss_shared_ptr msg_rx; try { msg_rx = Acquisition_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index e1107919c..3ff00b953 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -31,6 +31,7 @@ #include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" #include "galileo_e5a_pcps_acquisition_fpga.h" #include "gnss_block_factory.h" +#include "gnss_block_interface.h" #include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "gps_l5i_pcps_acquisition_fpga.h" @@ -81,21 +82,11 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -#if GNURADIO_USES_STD_POINTERS -#include -#else -#include -#endif - // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx_Fpga; -#if GNURADIO_USES_STD_POINTERS -using TrackingPullInTest_msg_rx_Fpga_sptr = std::shared_ptr; -#else -using TrackingPullInTest_msg_rx_Fpga_sptr = boost::shared_ptr; -#endif +using TrackingPullInTest_msg_rx_Fpga_sptr = gnss_shared_ptr; TrackingPullInTest_msg_rx_Fpga_sptr TrackingPullInTest_msg_rx_Fpga_make(); diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 7a7ca8a76..742715b02 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -106,11 +106,7 @@ Gnss_Synchro gnss_synchro{}; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class FrontEndCal_msg_rx; -#if GNURADIO_USES_STD_POINTERS -using FrontEndCal_msg_rx_sptr = std::shared_ptr; -#else -using FrontEndCal_msg_rx_sptr = boost::shared_ptr; -#endif +using FrontEndCal_msg_rx_sptr = gnss_shared_ptr; FrontEndCal_msg_rx_sptr FrontEndCal_msg_rx_make();