From a7a140862b351707eaaa80d867e5b7bd30c94a6d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 30 Oct 2021 05:43:22 +0200 Subject: [PATCH] Fix building against latest GNU Radio Replace boost::any by std::any --- CMakeLists.txt | 4 +- cmake/Modules/FindGNURADIO.cmake | 14 +++++ .../PVT/gnuradio_blocks/CMakeLists.txt | 7 +++ .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 52 +++++++++++-------- src/algorithms/channel/libs/CMakeLists.txt | 10 ++++ .../channel/libs/channel_msg_receiver_cc.cc | 11 +++- .../gnuradio_blocks/CMakeLists.txt | 7 +++ .../gnuradio_blocks/hybrid_observables_gs.cc | 12 ++++- .../tracking/gnuradio_blocks/CMakeLists.txt | 11 ++++ .../gnuradio_blocks/dll_pll_veml_tracking.cc | 11 +++- .../dll_pll_veml_tracking_fpga.cc | 11 +++- src/core/libs/CMakeLists.txt | 7 +++ src/core/libs/channel_status_msg_receiver.cc | 14 +++-- src/core/libs/galileo_e6_has_msg_receiver.cc | 12 +++-- src/core/libs/nav_message_monitor.cc | 12 +++-- src/core/monitor/CMakeLists.txt | 1 - src/core/receiver/CMakeLists.txt | 7 +++ src/core/receiver/control_thread.cc | 10 +++- src/tests/CMakeLists.txt | 17 ++++++ .../acquisition/acq_performance_test.cc | 23 +++++--- .../beidou_b1i_pcps_acquisition_test.cc | 8 ++- .../beidou_b3i_pcps_acquisition_test.cc | 7 ++- ...8ms_ambiguous_acquisition_gsoc2013_test.cc | 7 ++- ...cps_ambiguous_acquisition_gsoc2013_test.cc | 7 ++- ...e1_pcps_ambiguous_acquisition_gsoc_test.cc | 7 ++- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 8 ++- ...wsr_ambiguous_acquisition_gsoc2013_test.cc | 8 ++- ...ync_ambiguous_acquisition_gsoc2014_test.cc | 7 ++- ...ong_ambiguous_acquisition_gsoc2013_test.cc | 7 ++- ...cps_acquisition_gsoc2014_gensource_test.cc | 7 ++- .../galileo_e5b_pcps_acquisition_test.cc | 8 ++- .../galileo_e6_pcps_acquisition_test.cc | 8 ++- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 7 ++- .../glonass_l1_ca_pcps_acquisition_test.cc | 8 ++- .../glonass_l2_ca_pcps_acquisition_test.cc | 7 ++- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 8 ++- .../gps_l1_ca_pcps_acquisition_test.cc | 8 ++- ...a_pcps_opencl_acquisition_gsoc2013_test.cc | 8 ++- ...cps_quicksync_acquisition_gsoc2014_test.cc | 8 ++- ..._ca_pcps_tong_acquisition_gsoc2013_test.cc | 8 ++- .../gps_l2_m_pcps_acquisition_test.cc | 8 ++- .../libs/CMakeLists.txt | 7 +++ .../libs/acquisition_msg_rx.cc | 10 +++- .../observables/hybrid_observables_test.cc | 12 ++++- .../hybrid_observables_test_fpga.cc | 12 ++++- .../gps_l1_ca_telemetry_decoder_test.cc | 11 +++- ...onass_l1_ca_dll_pll_c_aid_tracking_test.cc | 8 ++- .../glonass_l1_ca_dll_pll_tracking_test.cc | 9 +++- .../gps_l1_ca_dll_pll_tracking_test.cc | 8 ++- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 8 ++- .../tracking/gps_l1_ca_kf_tracking_test.cc | 8 ++- .../gps_l2_m_dll_pll_tracking_test.cc | 9 +++- .../tracking/tracking_pull-in_test.cc | 7 ++- .../tracking/tracking_pull-in_test_fpga.cc | 7 ++- src/utils/front-end-cal/CMakeLists.txt | 7 +++ src/utils/front-end-cal/main.cc | 8 ++- 56 files changed, 448 insertions(+), 95 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 694877965..4784d3ef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -661,7 +661,9 @@ if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND LOG4CPP_READY_FOR_CXX17) endif() endif() endif() - +if((NOT PMT_USES_BOOST_ANY) AND (CMAKE_CXX_STANDARD VERSION_LESS 17)) + message(FATAL_ERROR "GNU Radio v${GNURADIO_VERSION} requires C++17. Please update your environment.") +endif() ################################################################################ diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index ba5d1b337..4ea557a19 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -377,6 +377,20 @@ if(GNURADIO_VERSION VERSION_GREATER 3.8.99) endif() endif() +# Check if PMT uses boost::any or std::any +if(GNURADIO_PMT_INCLUDE_DIRS) + file(STRINGS ${GNURADIO_PMT_INCLUDE_DIRS}/pmt/pmt.h _pmt_content) + set(_uses_boost TRUE) + foreach(_loop_var IN LISTS _pmt_content) + string(STRIP "${_loop_var}" _file_line) + if("#include " STREQUAL "${_file_line}") + set(_uses_boost FALSE) + endif() + endforeach() + if(${_uses_boost}) + set(PMT_USES_BOOST_ANY TRUE) + endif() +endif() set_package_properties(GNURADIO PROPERTIES URL "https://www.gnuradio.org/" diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 6fd16ce42..e59a38c7e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -58,6 +58,13 @@ else() ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(pvt_gr_blocks + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(pvt_gr_blocks diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 6b61e7473..784412e70 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -56,7 +56,6 @@ #include "rtcm_printer.h" #include "rtklib_rtkcmn.h" #include "rtklib_solver.h" -#include // for any_cast, any #include // for xml_iarchive #include // for xml_oarchive #include @@ -94,6 +93,13 @@ namespace bc = boost::math; namespace bc = boost::integer; #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, @@ -1115,7 +1121,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (msg_type_hash_code == d_gps_ephemeris_sptr_type_hash_code) { // ### GPS EPHEMERIS ### - const auto gps_eph = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_eph = wht::any_cast>(pmt::any_ref(msg)); DLOG(INFO) << "Ephemeris record has arrived from SAT ID " << gps_eph->PRN << " (Block " << gps_eph->satelliteBlock[gps_eph->PRN] << ")" @@ -1165,7 +1171,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_iono_sptr_type_hash_code) { // ### GPS IONO ### - const auto gps_iono = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_iono = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->gps_iono = *gps_iono; if (d_enable_rx_clock_correction == true) { @@ -1176,7 +1182,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_utc_model_sptr_type_hash_code) { // ### GPS UTC MODEL ### - const auto gps_utc_model = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_utc_model = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->gps_utc_model = *gps_utc_model; if (d_enable_rx_clock_correction == true) { @@ -1187,7 +1193,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_cnav_ephemeris_sptr_type_hash_code) { // ### GPS CNAV message ### - const auto gps_cnav_ephemeris = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_cnav_ephemeris = wht::any_cast>(pmt::any_ref(msg)); // update/insert new ephemeris record to the global ephemeris map if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data { @@ -1226,7 +1232,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_cnav_iono_sptr_type_hash_code) { // ### GPS CNAV IONO ### - const auto gps_cnav_iono = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_cnav_iono = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->gps_cnav_iono = *gps_cnav_iono; if (d_enable_rx_clock_correction == true) { @@ -1237,7 +1243,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_cnav_utc_model_sptr_type_hash_code) { // ### GPS CNAV UTC MODEL ### - const auto gps_cnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_cnav_utc_model = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; { d_user_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; @@ -1248,7 +1254,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_gps_almanac_sptr_type_hash_code) { // ### GPS ALMANAC ### - const auto gps_almanac = boost::any_cast>(pmt::any_ref(msg)); + const auto gps_almanac = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->gps_almanac_map[gps_almanac->PRN] = *gps_almanac; if (d_enable_rx_clock_correction == true) { @@ -1261,7 +1267,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_galileo_ephemeris_sptr_type_hash_code) { // ### Galileo EPHEMERIS ### - const auto galileo_eph = boost::any_cast>(pmt::any_ref(msg)); + const auto galileo_eph = wht::any_cast>(pmt::any_ref(msg)); // insert new ephemeris record DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->tow << ", GALILEO Week Number =" << galileo_eph->WN @@ -1311,7 +1317,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_galileo_iono_sptr_type_hash_code) { // ### Galileo IONO ### - const auto galileo_iono = boost::any_cast>(pmt::any_ref(msg)); + const auto galileo_iono = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->galileo_iono = *galileo_iono; if (d_enable_rx_clock_correction == true) { @@ -1322,7 +1328,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_galileo_utc_model_sptr_type_hash_code) { // ### Galileo UTC MODEL ### - const auto galileo_utc_model = boost::any_cast>(pmt::any_ref(msg)); + const auto galileo_utc_model = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->galileo_utc_model = *galileo_utc_model; if (d_enable_rx_clock_correction == true) { @@ -1333,7 +1339,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_galileo_almanac_helper_sptr_type_hash_code) { // ### Galileo Almanac ### - const auto galileo_almanac_helper = boost::any_cast>(pmt::any_ref(msg)); + const auto galileo_almanac_helper = wht::any_cast>(pmt::any_ref(msg)); const Galileo_Almanac sv1 = galileo_almanac_helper->get_almanac(1); const Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2); const Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3); @@ -1367,7 +1373,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_galileo_almanac_sptr_type_hash_code) { // ### Galileo Almanac ### - const auto galileo_alm = boost::any_cast>(pmt::any_ref(msg)); + const auto galileo_alm = wht::any_cast>(pmt::any_ref(msg)); // update/insert new almanac record to the global almanac map d_internal_pvt_solver->galileo_almanac_map[galileo_alm->PRN] = *galileo_alm; if (d_enable_rx_clock_correction == true) @@ -1380,7 +1386,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_glonass_gnav_ephemeris_sptr_type_hash_code) { // ### GLONASS GNAV EPHEMERIS ### - const auto glonass_gnav_eph = boost::any_cast>(pmt::any_ref(msg)); + const auto glonass_gnav_eph = wht::any_cast>(pmt::any_ref(msg)); // TODO Add GLONASS with gps week number and tow, // insert new ephemeris record DLOG(INFO) << "GLONASS GNAV New Ephemeris record inserted in global map with TOW =" << glonass_gnav_eph->d_TOW @@ -1419,7 +1425,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_glonass_gnav_utc_model_sptr_type_hash_code) { // ### GLONASS GNAV UTC MODEL ### - const auto glonass_gnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); + const auto glonass_gnav_utc_model = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; if (d_enable_rx_clock_correction == true) { @@ -1430,7 +1436,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_glonass_gnav_almanac_sptr_type_hash_code) { // ### GLONASS GNAV Almanac ### - const auto glonass_gnav_almanac = boost::any_cast>(pmt::any_ref(msg)); + const auto glonass_gnav_almanac = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; if (d_enable_rx_clock_correction == true) { @@ -1444,7 +1450,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_beidou_dnav_ephemeris_sptr_type_hash_code) { // ### Beidou EPHEMERIS ### - const auto bds_dnav_eph = boost::any_cast>(pmt::any_ref(msg)); + const auto bds_dnav_eph = wht::any_cast>(pmt::any_ref(msg)); DLOG(INFO) << "Ephemeris record has arrived from SAT ID " << bds_dnav_eph->PRN << " (Block " << bds_dnav_eph->satelliteBlock[bds_dnav_eph->PRN] << ")" @@ -1487,7 +1493,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_beidou_dnav_iono_sptr_type_hash_code) { // ### BeiDou IONO ### - const auto bds_dnav_iono = boost::any_cast>(pmt::any_ref(msg)); + const auto bds_dnav_iono = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->beidou_dnav_iono = *bds_dnav_iono; if (d_enable_rx_clock_correction == true) { @@ -1498,7 +1504,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_beidou_dnav_utc_model_sptr_type_hash_code) { // ### BeiDou UTC MODEL ### - const auto bds_dnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); + const auto bds_dnav_utc_model = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model; if (d_enable_rx_clock_correction == true) { @@ -1509,7 +1515,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) else if (msg_type_hash_code == d_beidou_dnav_almanac_sptr_type_hash_code) { // ### BeiDou ALMANAC ### - const auto bds_dnav_almanac = boost::any_cast>(pmt::any_ref(msg)); + const auto bds_dnav_almanac = wht::any_cast>(pmt::any_ref(msg)); d_internal_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->PRN] = *bds_dnav_almanac; if (d_enable_rx_clock_correction == true) { @@ -1522,7 +1528,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) LOG(WARNING) << "msg_handler_telemetry unknown object type!"; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_telemetry Bad any_cast: " << e.what(); } @@ -1538,12 +1544,12 @@ void rtklib_pvt_gs::msg_handler_has_data(const pmt::pmt_t& msg) const { if (d_enable_has_messages) { - const auto has_data = boost::any_cast>(pmt::any_ref(msg)); + const auto has_data = wht::any_cast>(pmt::any_ref(msg)); d_has_simple_printer->print_message(has_data.get()); } } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_has_data Bad any_cast: " << e.what(); } diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index bc9b6f913..5d65ca047 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -76,6 +76,16 @@ if(USE_BOOST_BIND_PLACEHOLDERS) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(channel_libs + PRIVATE -DPMT_USES_BOOST_ANY=1 + ) + target_link_libraries(channel_libs + PRIVATE + Boost::headers + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(channel_libs diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 423afa0ca..4d2e5616b 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -17,13 +17,20 @@ #include "channel_msg_receiver_cc.h" -#include #include #include #include #include #include +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif + #if HAS_GENERIC_LAMBDA #else #include @@ -85,7 +92,7 @@ void channel_msg_receiver_cc::msg_handler_channel_events(const pmt::pmt_t& msg) break; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any cast: " << e.what(); } diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index a48fb65e6..5035ab2ee 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -69,6 +69,13 @@ if(USE_BOOST_BIND_PLACEHOLDERS) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(obs_gr_blocks + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(obs_gr_blocks diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 3dada88c4..a8a96a1bf 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -35,6 +35,14 @@ #include // for numeric_limits #include // for move +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif + #if HAS_GENERIC_LAMBDA #else #include @@ -195,7 +203,7 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg { if (pmt::any_ref(msg).type().hash_code() == d_double_type_hash_code) { - const auto new_rx_clock_offset_s = boost::any_cast(pmt::any_ref(msg)); + const auto new_rx_clock_offset_s = wht::any_cast(pmt::any_ref(msg)); d_T_rx_TOW_ms = d_T_rx_TOW_ms - static_cast(round(new_rx_clock_offset_s * 1000.0)); // align the receiver clock to integer multiple of d_T_rx_step_ms if (d_T_rx_TOW_ms % d_T_rx_step_ms) @@ -211,7 +219,7 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg LOG(INFO) << "Corrected new RX Time offset: " << static_cast(round(new_rx_clock_offset_s * 1000.0)) << "[ms]"; } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_pvt_to_observables Bad any_cast: " << e.what(); } diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index d40b38a1d..6290cb842 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -150,6 +150,17 @@ if(has_span) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(tracking_gr_blocks + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) + target_link_libraries(tracking_gr_blocks + PRIVATE + Boost::headers + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(tracking_gr_blocks diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index dd1af18ad..733b8b6fd 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -65,6 +65,13 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_) { @@ -605,7 +612,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) { if (pmt::any_ref(msg).type().hash_code() == int_type_hash_code) { - const int tlm_event = boost::any_cast(pmt::any_ref(msg)); + const int tlm_event = wht::any_cast(pmt::any_ref(msg)); if (tlm_event == 1) { DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel; @@ -614,7 +621,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) } } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_telemetry_to_trk Bad any_cast: " << e.what(); } diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index fa8db0621..63f409c23 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -54,6 +54,13 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_) { @@ -469,7 +476,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t & { if (pmt::any_ref(msg).type().hash_code() == int_type_hash_code) { - const int tlm_event = boost::any_cast(pmt::any_ref(msg)); + const int tlm_event = wht::any_cast(pmt::any_ref(msg)); if (tlm_event == 1) { DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel; @@ -478,7 +485,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t & } } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_telemetry_to_trk Bad any_cast: " << e.what(); } diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index cc95de249..cbfed507c 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -142,6 +142,13 @@ if(USE_BOOST_ASIO_IO_CONTEXT) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(core_libs + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() + # Do not apply clang-tidy fixes to protobuf generated headers get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) target_include_directories(core_libs diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index 7093018a4..4b11abd7e 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -17,7 +17,6 @@ #include "channel_status_msg_receiver.h" -#include #include #include #include @@ -31,6 +30,13 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif channel_status_msg_receiver_sptr channel_status_msg_receiver_make() { @@ -64,7 +70,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m // ****************** Gnss_Synchro received ************************ if (msg_type_hash_code == typeid(std::shared_ptr).hash_code()) { - const auto gnss_synchro_obj = boost::any_cast>(pmt::any_ref(msg)); + const auto gnss_synchro_obj = wht::any_cast>(pmt::any_ref(msg)); if (gnss_synchro_obj->Flag_valid_pseudorange == true) { d_channel_status_map[gnss_synchro_obj->Channel_ID] = gnss_synchro_obj; @@ -84,7 +90,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m else if (msg_type_hash_code == typeid(std::shared_ptr).hash_code()) { // ***************** Monitor_Pvt received ****************** - const auto monitor_pvt_obj = boost::any_cast>(pmt::any_ref(msg)); + const auto monitor_pvt_obj = wht::any_cast>(pmt::any_ref(msg)); d_pvt_status = *monitor_pvt_obj.get(); // std::cout << "-------- \n" << '\n'; @@ -96,7 +102,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m LOG(WARNING) << "channel_status_msg_receiver unknown object type!"; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "channel_status_msg_receiver Bad any_cast: " << e.what(); } diff --git a/src/core/libs/galileo_e6_has_msg_receiver.cc b/src/core/libs/galileo_e6_has_msg_receiver.cc index 423e9bbdc..62407724a 100644 --- a/src/core/libs/galileo_e6_has_msg_receiver.cc +++ b/src/core/libs/galileo_e6_has_msg_receiver.cc @@ -23,7 +23,6 @@ #include "galileo_has_page.h" // for Galileo_HAS_page #include "gnss_sdr_make_unique.h" // for std::make_unique in C++11 #include "reed_solomon.h" // for ReedSolomon -#include // for boost::any_cast #include // for DLOG #include // for gr::io_signature::make #include // for std::find, std::count @@ -38,6 +37,13 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif galileo_e6_has_msg_receiver_sptr galileo_e6_has_msg_receiver_make() { @@ -106,7 +112,7 @@ void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& m const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code(); if (msg_type_hash_code == typeid(std::shared_ptr).hash_code()) { - const auto HAS_data_page = boost::any_cast>(pmt::any_ref(msg)); + const auto HAS_data_page = wht::any_cast>(pmt::any_ref(msg)); DLOG(INFO) << "New HAS page received: " << "Status: " << static_cast(HAS_data_page->has_status) << ", " << "MT: " << static_cast(HAS_data_page->message_type) << ", " @@ -122,7 +128,7 @@ void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& m LOG(WARNING) << "galileo_e6_has_msg_receiver received an unknown object type!"; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "galileo_e6_has_msg_receiver Bad any_cast: " << e.what(); } diff --git a/src/core/libs/nav_message_monitor.cc b/src/core/libs/nav_message_monitor.cc index a640432ed..105234b81 100644 --- a/src/core/libs/nav_message_monitor.cc +++ b/src/core/libs/nav_message_monitor.cc @@ -17,7 +17,6 @@ #include "nav_message_monitor.h" #include "gnss_sdr_make_unique.h" -#include #include #include #include // size_t @@ -28,6 +27,13 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif nav_message_monitor_sptr nav_message_monitor_make(const std::vector& addresses, uint16_t port) { @@ -62,7 +68,7 @@ void nav_message_monitor::msg_handler_nav_message(const pmt::pmt_t& msg) const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code(); if (msg_type_hash_code == typeid(std::shared_ptr).hash_code()) { - const auto nav_message_packet = boost::any_cast>(pmt::any_ref(msg)); + const auto nav_message_packet = wht::any_cast>(pmt::any_ref(msg)); nav_message_udp_sink_->write_nav_message(nav_message_packet); } else @@ -70,7 +76,7 @@ void nav_message_monitor::msg_handler_nav_message(const pmt::pmt_t& msg) LOG(WARNING) << "nav_message_monitor received an unknown object type!"; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "nav_message_monitor Bad any_cast: " << e.what(); } diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 73605b992..9d067c909 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -50,7 +50,6 @@ target_link_libraries(core_monitor core_system_parameters PRIVATE Boost::serialization - Gnuradio::pmt ) get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 738b09f32..4b4fa761d 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -187,6 +187,13 @@ else() ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(core_receiver + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() + # Fix for Boost Asio < 1.70 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0)) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index aaef7123a..ff0eecfa1 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -69,6 +69,12 @@ #include // for steady_clock #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + extern Concurrent_Map global_gps_acq_assist_map; extern Concurrent_Queue global_gps_acq_assist_queue; @@ -280,7 +286,7 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg) { if (receiver_on_standby_ == false) { - const auto new_event = boost::any_cast(pmt::any_ref(msg)); + const auto new_event = wht::any_cast(pmt::any_ref(msg)); DLOG(INFO) << "New channel event rx from ch id: " << new_event->channel_id << " what: " << new_event->event_type; flowgraph_->apply_action(new_event->channel_id, new_event->event_type); @@ -288,7 +294,7 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg) } else if (msg_type_hash_code == command_event_type_hash_code_) { - const auto new_event = boost::any_cast(pmt::any_ref(msg)); + const auto new_event = wht::any_cast(pmt::any_ref(msg)); DLOG(INFO) << "New command event rx from ch id: " << new_event->command_id << " what: " << new_event->event_type; diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index e663cf272..602eda561 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -542,6 +542,11 @@ if(ENABLE_UNIT_TESTING) PRIVATE -DGNURADIO_USES_STD_POINTERS=1 ) endif() + if(PMT_USES_BOOST_ANY) + target_compile_definitions(run_tests + PRIVATE -DPMT_USES_BOOST_ANY=1 + ) + endif() if(ENABLE_UNIT_TESTING_EXTRA) target_link_libraries(run_tests PRIVATE Gpstk::gpstk) if(GPSTK_OLDER_THAN_8) @@ -1002,6 +1007,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files ) + if(PMT_USES_BOOST_ANY) + target_compile_definitions(acq_test + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) + endif() add_test(acq_test acq_test) if(USE_GENERIC_LAMBDAS) @@ -1091,6 +1102,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() + if(PMT_USES_BOOST_ANY) + target_compile_definitions(trk_test + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) + endif() add_test(trk_test trk_test) 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 63d5d8a8e..2cac830f5 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 @@ -49,6 +49,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test."); DEFINE_string(acq_test_input_file, std::string(""), "File containing raw signal data, must be in int8_t format. The signal generator will not be used."); @@ -119,7 +124,7 @@ void AcqPerfTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg) rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; @@ -540,7 +545,8 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign config->set_property("Acquisition.dump", "false"); } - std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(cn0) + "_" + std::to_string(iter) + "_" + std::to_string(pfa); + // std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(cn0) + "_" + std::to_string(iter) + "_" + std::to_string(pfa); + std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(static_cast(cn0)) + "_" + std::to_string(iter) + "_" + std::to_string(static_cast(pfa * 1.0e5)); config->set_property("Acquisition.dump_filename", dump_file); config->set_property("Acquisition.dump_channel", std::to_string(dump_channel)); config->set_property("Acquisition.blocking_on_standby", "true"); @@ -719,7 +725,7 @@ void AcquisitionPerformanceTest::plot_results() for (int k = 0; k < num_thresholds; k++) { Pd_i.push_back(Pd[i][k]); - Pfa_i.push_back(Pfa[i][k]); + Pfa_i.push_back(pfa_vector[k]); } g1.plot_xy(Pfa_i, Pd_i, "CN0 = " + std::to_string(static_cast(cn0_vector[i])) + " dBHz"); } @@ -755,7 +761,7 @@ void AcquisitionPerformanceTest::plot_results() for (int k = 0; k < num_thresholds; k++) { Pd_i_correct.push_back(Pd_correct[i][k]); - Pfa_i.push_back(Pfa[i][k]); + Pfa_i.push_back(pfa_vector[k]); } g2.plot_xy(Pfa_i, Pd_i_correct, "CN0 = " + std::to_string(static_cast(cn0_vector[i])) + " dBHz"); } @@ -778,6 +784,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) if (fs::exists(path_str)) { + std::cout << "Deleting old files at " << path_str << " ...\n"; fs::remove_all(path_str); } errorlib::error_code ec; @@ -840,7 +847,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) run_receiver(); // count executions - std::string basename = path_str + std::string("/acquisition_") + std::to_string(it) + "_" + std::to_string(iter) + "_" + std::to_string(pfa_vector[pfa_iter]) + "_" + gnss_synchro.System + "_" + signal_id; + std::string basename = path_str + std::string("/acquisition_") + std::to_string(static_cast(it)) + "_" + std::to_string(iter) + "_" + std::to_string(static_cast(pfa_vector[pfa_iter] * 1e-5)) + "_" + gnss_synchro.System + "_" + signal_id; int num_executions = count_executions(basename, observed_satellite); // Read measured data @@ -983,7 +990,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { meas_Pd_.push_back(0.0); } - std::cout << TEXT_BOLD_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz" + std::cout << TEXT_BOLD_BLUE << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << '\n'; } if (num_clean_executions > 0) @@ -1000,7 +1007,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) } double computed_Pd_correct = correctly_detected / static_cast(num_clean_executions); meas_Pd_correct_.push_back(computed_Pd_correct); - std::cout << TEXT_BOLD_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz" + std::cout << TEXT_BOLD_BLUE << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << computed_Pd_correct << TEXT_RESET << '\n'; } else @@ -1018,7 +1025,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { meas_Pfa_.push_back(0.0); } - std::cout << TEXT_BOLD_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz" + std::cout << TEXT_BOLD_BLUE << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index 82a331ec5..9e577e096 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -50,6 +50,12 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class BeidouB1iPcpsAcquisitionTest_msg_rx; @@ -84,7 +90,7 @@ void BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt:: int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index d2314fc18..bb99b7f07 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -50,6 +50,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class BeidouB3iPcpsAcquisitionTest_msg_rx; @@ -84,7 +89,7 @@ void BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt:: int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 17d286465..9c0eb822e 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 @@ -44,6 +44,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### @@ -82,7 +87,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_channe rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 1b484212e..fd0f2a7fe 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 @@ -42,6 +42,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx; @@ -79,7 +84,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_e rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 709854700..1c0b3af42 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 @@ -52,6 +52,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx; @@ -89,7 +94,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_channel_event rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 085c704fa..0d964e826 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 @@ -52,6 +52,12 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx; @@ -86,7 +92,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_channel_events(co int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 5a1958acc..07d132be4 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 @@ -45,7 +45,11 @@ #else #include #endif - +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx; @@ -83,7 +87,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_channel_eve rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 4b36e4725..f28bb2d63 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 @@ -47,6 +47,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif DEFINE_double(e1_value_threshold, 0.3, "Value of the threshold for the acquisition"); DEFINE_int32(e1_value_CN0_dB_0, 50, "Value for the CN0_dB_0 in channel 0"); @@ -88,7 +93,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_ rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 1694b8d67..ccd2e61a5 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 @@ -46,6 +46,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx; @@ -83,7 +88,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_chann rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 d614f1420..737c83abe 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 @@ -42,6 +42,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx; @@ -79,7 +84,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_channel_ rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 4255e54ba..27dab121a 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 @@ -49,6 +49,12 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5bPcpsAcquisitionTest_msg_rx; @@ -84,7 +90,7 @@ void GalileoE5bPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt: rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { std::cout << "msg_handler_telemetry Bad any cast!" << std::endl; rx_message = 0; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e6_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e6_pcps_acquisition_test.cc index 53800d708..82cfb7c98 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e6_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e6_pcps_acquisition_test.cc @@ -49,6 +49,12 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE6PcpsAcquisitionTest_msg_rx; @@ -84,7 +90,7 @@ void GalileoE6PcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt:: rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { std::cout << "msg_handler_telemetry Bad any cast!" << std::endl; rx_message = 0; 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 97e2d6531..b23c989bf 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 @@ -48,6 +48,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx; @@ -85,7 +90,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_channel_events(c rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 451879923..2495623e1 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 @@ -42,7 +42,11 @@ #else #include #endif - +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaPcpsAcquisitionTest_msg_rx; @@ -77,7 +81,7 @@ void GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { std::cout << "msg_handler_telemetry Bad any cast!\n"; rx_message = 0; 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 b18da4708..4f205422d 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 @@ -46,6 +46,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL2CaPcpsAcquisitionTest_msg_rx; @@ -83,7 +88,7 @@ void GlonassL2CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 60e6ce9ee..2c2191f1e 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 @@ -48,7 +48,11 @@ #else #include #endif - +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx; @@ -86,7 +90,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events(const rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 d337b8453..3d4eda283 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 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionTest_msg_rx; @@ -83,7 +89,7 @@ void GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::pm int64_t message = pmt::to_long(msg); rx_message = message; } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 ab015e0ce..7e4ef8df8 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 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx; @@ -81,7 +87,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 78900eef8..21ff4678e 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 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif DEFINE_double(value_threshold, 1, "Value of the threshold for the acquisition"); DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); @@ -85,7 +91,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_channel_eve rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 f8e10b61d..a8e988210 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 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx; @@ -83,7 +89,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events(c rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 9cd291e1c..a2d87201d 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 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL2MPcpsAcquisitionTest_msg_rx; @@ -82,7 +88,7 @@ void GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::pmt int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 9a3b91e76..8b9096c68 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries(signal_processing_testing_lib Armadillo::armadillo Gflags::gflags Gnuradio::runtime + Gnuradio::pmt PRIVATE Boost::headers Matio::matio @@ -80,6 +81,12 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(signal_processing_testing_lib + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index 467ba82c0..596fd3994 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -26,6 +26,14 @@ #include #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif + Acquisition_msg_rx_sptr Acquisition_msg_rx_make() { return Acquisition_msg_rx_sptr(new Acquisition_msg_rx()); @@ -40,7 +48,7 @@ void Acquisition_msg_rx::msg_handler_channel_events(const pmt::pmt_t& msg) rx_message = message; top_block->stop(); // stop the flowgraph } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_acquisition Bad cast!\n"; rx_message = 0; 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 b03fb05c1..493941408 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 @@ -64,21 +64,29 @@ #include #include #include +#include #include #include #include #include #include + #if HAS_GENERIC_LAMBDA #else #include #endif + #ifdef GR_GREATER_38 #include #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### class HybridObservablesTest_msg_rx; @@ -114,7 +122,7 @@ void HybridObservablesTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t m int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; @@ -180,7 +188,7 @@ void HybridObservablesTest_tlm_msg_rx::msg_handler_channel_events(const pmt::pmt int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 7a56d1d3f..d3fbaf8fb 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 @@ -63,22 +63,30 @@ #include #include #include +#include #include #include #include #include #include #include + #if HAS_GENERIC_LAMBDA #else #include #endif + #ifdef GR_GREATER_38 #include #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif class HybridObservablesTest_msg_rx_Fpga; @@ -112,7 +120,7 @@ void HybridObservablesTest_msg_rx_Fpga::msg_handler_channel_events(const pmt::pm int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; @@ -175,7 +183,7 @@ void HybridObservablesTest_tlm_msg_rx_Fpga::msg_handler_channel_events(const pmt int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 0a34267f7..bc56d4cd2 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 @@ -46,11 +46,18 @@ #include #include #include +#include + #if HAS_GENERIC_LAMBDA #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### class GpsL1CADllPllTelemetryDecoderTest_msg_rx; @@ -83,7 +90,7 @@ void GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_channel_events(const int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; @@ -143,7 +150,7 @@ void GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_channel_events(co int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 0715c0c9d..33770b758 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 @@ -29,12 +29,18 @@ #include #include #include +#include #include #include #if HAS_GENERIC_LAMBDA #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllCAidTrackingTest_msg_rx; @@ -67,7 +73,7 @@ void GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_channel_events(const int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 b766346c3..001628c2f 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 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #if HAS_GENERIC_LAMBDA @@ -41,7 +42,11 @@ #else #include #endif - +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllTrackingTest_msg_rx; @@ -74,7 +79,7 @@ void GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt: int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 57310bbfa..bd772cf9d 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 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; @@ -88,7 +94,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt rx_message = message; // 3 -> loss of lock // std::cout << "Received trk message: " << rx_message << '\n'; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 3da9880f9..15fcf19f4 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 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include // FPGA read input file #include @@ -53,6 +54,11 @@ #else #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#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) @@ -183,7 +189,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_channel_events(const pmt: int64_t message = pmt::to_long(msg); rx_message = message; } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 c47d0728e..ea3bd765d 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 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot"); @@ -90,7 +96,7 @@ void GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t m long int message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 e87d87862..43c32314a 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 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #if HAS_GENERIC_LAMBDA @@ -41,7 +42,11 @@ #else #include #endif - +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL2MDllPllTrackingTest_msg_rx; @@ -76,7 +81,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_ int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what(); rx_message = 0; 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 cf91049c9..5f1265edd 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 @@ -68,6 +68,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx; @@ -103,7 +108,7 @@ void TrackingPullInTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg) rx_message = message; // 3 -> loss of lock // std::cout << "Received trk message: " << rx_message << '\n'; } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_tracking Bad cast!"; rx_message = 0; 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 5384f7753..8d68997fc 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 @@ -67,6 +67,11 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx_Fpga; @@ -101,7 +106,7 @@ void TrackingPullInTest_msg_rx_Fpga::msg_handler_channel_events(const pmt::pmt_t int64_t message = pmt::to_long(std::move(msg)); rx_message = message; // 3 -> loss of lock } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_tracking Bad cast!"; rx_message = 0; diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index fe017a5a0..2fc93dad4 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -95,6 +95,13 @@ if(USE_BOOST_BIND_PLACEHOLDERS) ) endif() +if(PMT_USES_BOOST_ANY) + target_compile_definitions(front-end-cal + PRIVATE + -DPMT_USES_BOOST_ANY=1 + ) +endif() + if(ENABLE_STRIP) set_target_properties(front-end-cal PROPERTIES LINK_FLAGS "-s") endif() diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index d63b6564d..b8e7ef7fc 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -74,6 +74,12 @@ #include #endif +#if PMT_USES_BOOST_ANY +namespace wht = boost; +#else +namespace wht = std; +#endif + #if GFLAGS_OLD_NAMESPACE namespace gflags { @@ -129,7 +135,7 @@ void FrontEndCal_msg_rx::msg_handler_channel_events(const pmt::pmt_t& msg) rx_message = message; channel_internal_queue.push(rx_message); } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n"; rx_message = 0;