From dfab84b2ded9e1d4d875936a3a22be9c88b54d92 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Feb 2019 01:31:09 +0100 Subject: [PATCH] Add fixes applied by clang-tidy --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 2 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 316 +++++++++--------- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 2 +- src/algorithms/PVT/libs/rtcm_printer.cc | 2 +- .../adapters/rtl_tcp_signal_source.cc | 4 +- .../rtl_tcp_signal_source_c.cc | 2 +- .../signal_source/libs/rtl_tcp_dongle_info.cc | 2 +- .../galileo_e1_tcp_connector_tracking.cc | 2 +- .../gps_l1_ca_tcp_connector_tracking.cc | 2 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 8 +- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 8 +- src/core/monitor/gnss_synchro_monitor.cc | 7 +- src/core/monitor/gnss_synchro_udp_sink.cc | 2 +- src/core/monitor/gnss_synchro_udp_sink.h | 2 +- src/core/receiver/control_thread.cc | 66 ++-- src/core/receiver/gnss_block_factory.cc | 87 ++--- src/core/receiver/gnss_block_factory.h | 68 ++-- src/core/receiver/gnss_flowgraph.cc | 32 +- src/core/receiver/tcp_cmd_interface.cc | 7 +- src/core/system_parameters/rtcm.cc | 159 +++++---- src/tests/system-tests/position_test.cc | 12 +- src/tests/system-tests/ttff.cc | 8 +- 22 files changed, 400 insertions(+), 400 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 175967413..560ff1ca8 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -52,7 +52,7 @@ using google::LogMessage; RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(std::move(role)), + unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 8982300ab..f639d4ecd 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -67,7 +67,7 @@ rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, } -void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) +void rtklib_pvt_cc::msg_handler_telemetry(const pmt::pmt_t& msg) { try { @@ -334,10 +334,10 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, { std::string dump_path; // Get path - if (d_dump_filename.find_last_of("/") != std::string::npos) + if (d_dump_filename.find_last_of('/') != std::string::npos) { - std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); - dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); d_dump_filename = dump_filename_; } else @@ -349,9 +349,9 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_dump_filename = "pvt"; } // remove extension if any - if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) { - d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); } dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; dump_ls_pvt_filename.append(".dat"); @@ -587,7 +587,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, rtklib_pvt_cc::~rtklib_pvt_cc() { - msgctl(sysv_msqid, IPC_RMID, NULL); + msgctl(sysv_msqid, IPC_RMID, nullptr); if (d_xml_storage) { // save GPS L2CM ephemeris to XML file @@ -1098,7 +1098,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item bool flag_write_RINEX_nav_output = false; gnss_observables_map.clear(); - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer // ############ 1. READ PSEUDORANGES #### for (uint32_t i = 0; i < d_nchannels; i++) { @@ -2009,17 +2009,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2028,76 +2028,76 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2105,7 +2105,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2117,7 +2117,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2129,28 +2129,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output and d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2183,11 +2183,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2195,17 +2195,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2214,17 +2214,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2232,14 +2232,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2247,8 +2247,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2281,34 +2281,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2340,25 +2340,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2366,8 +2366,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2399,34 +2399,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2458,34 +2458,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2517,11 +2517,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2537,18 +2537,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2558,17 +2558,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2576,18 +2576,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2595,18 +2595,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2614,23 +2614,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2662,11 +2662,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2675,15 +2675,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { @@ -2703,7 +2703,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2712,17 +2712,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2732,17 +2732,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2750,14 +2750,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2765,8 +2765,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2798,11 +2798,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2810,16 +2810,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2827,8 +2827,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2858,11 +2858,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2870,22 +2870,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -2918,12 +2918,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2931,16 +2931,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2948,8 +2948,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2979,11 +2979,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2991,23 +2991,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3039,11 +3039,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 1c4109c17..4f84f8a27 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -72,7 +72,7 @@ private: const Pvt_Conf& conf_, const rtk_t& rtk); - void msg_handler_telemetry(pmt::pmt_t msg); + void msg_handler_telemetry(const pmt::pmt_t& msg); bool d_dump; bool d_dump_mat; diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index da32c0e9b..b4892e2f8 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -143,7 +143,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump } } - rtcm_devname = std::move(rtcm_dump_devname); + rtcm_devname = rtcm_dump_devname; if (flag_rtcm_tty_port == true) { rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 5166840f5..85f1a562f 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -48,10 +48,10 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(std::move(role)), + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + queue_(std::move(std::move(queue))) { // DUMP PARAMETERS std::string empty = ""; diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index f43f3e90c..5e40880a5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -333,7 +333,7 @@ int rtl_tcp_signal_source_c::work(int noutput_items, gr_vector_const_void_star & /*input_items*/, gr_vector_void_star &output_items) { - gr_complex *out = reinterpret_cast(output_items[0]); + auto *out = reinterpret_cast(output_items[0]); int i = 0; if (io_service_.stopped()) { diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index fab664d28..6ad323015 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -121,7 +121,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const } // clip - if (gains.size() == 0) + if (gains.empty()) { // no defined gains to clip to return gain; diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 70fdd98a2..f95f76200 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -48,7 +48,7 @@ using google::LogMessage; GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index 3000ac8ae..15e7f650b 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -47,7 +47,7 @@ using google::LogMessage; GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 2c755b088..a79232993 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -104,7 +104,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; // Initialize tracking ========================================== //--- DLL variables -------------------------------------------------------- @@ -270,7 +270,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -309,8 +309,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { // Fill the acquisition data diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 832e94207..db7a28465 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -95,7 +95,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; //--- DLL variables -------------------------------------------------------- d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) @@ -300,7 +300,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -341,8 +341,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 4f3918d8a..ad9f40e37 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -36,6 +36,7 @@ #include #include #include +#include using google::LogMessage; @@ -49,7 +50,7 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, return gnss_synchro_monitor_sptr(new gnss_synchro_monitor(n_channels, output_rate_ms, udp_port, - udp_addresses)); + std::move(udp_addresses))); } @@ -63,7 +64,7 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, d_output_rate_ms = output_rate_ms; d_nchannels = n_channels; - udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(udp_addresses, udp_port)); + udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(std::move(udp_addresses), udp_port)); count = 0; } @@ -75,7 +76,7 @@ gnss_synchro_monitor::~gnss_synchro_monitor() = default; int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer for (int epoch = 0; epoch < noutput_items; epoch++) { count++; diff --git a/src/core/monitor/gnss_synchro_udp_sink.cc b/src/core/monitor/gnss_synchro_udp_sink.cc index 46b2d33c9..54f489433 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.cc +++ b/src/core/monitor/gnss_synchro_udp_sink.cc @@ -44,7 +44,7 @@ Gnss_Synchro_Udp_Sink::Gnss_Synchro_Udp_Sink(std::vector addresses, } } -bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(std::vector stocks) +bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(const std::vector& stocks) { std::ostringstream archive_stream; boost::archive::binary_oarchive oa{archive_stream}; diff --git a/src/core/monitor/gnss_synchro_udp_sink.h b/src/core/monitor/gnss_synchro_udp_sink.h index ebfb854a0..8f055e90c 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.h +++ b/src/core/monitor/gnss_synchro_udp_sink.h @@ -39,7 +39,7 @@ class Gnss_Synchro_Udp_Sink { public: Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t &port); - bool write_gnss_synchro(std::vector stocks); + bool write_gnss_synchro(const std::vector& stocks); private: boost::asio::io_service io_service; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 19843c718..455ba341f 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -94,7 +94,7 @@ ControlThread::ControlThread() ControlThread::ControlThread(std::shared_ptr configuration) { - configuration_ = configuration; + configuration_ = std::move(configuration); delete_configuration_ = false; restart_ = false; init(); @@ -129,7 +129,7 @@ void ControlThread::init() std::string empty_string = ""; std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); - if (ref_location_str.compare(empty_string) != 0) + if (ref_location_str != empty_string) { std::vector vect; std::stringstream ss(ref_location_str); @@ -156,7 +156,7 @@ void ControlThread::init() } } } - if (ref_time_str.compare(empty_string) == 0) + if (ref_time_str == empty_string) { // Make an educated guess time_t rawtime; @@ -191,7 +191,7 @@ void ControlThread::init() ControlThread::~ControlThread() // NOLINT(modernize-use-equals-default) { - if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); + if (msqid != -1) msgctl(msqid, IPC_RMID, nullptr); } @@ -269,7 +269,7 @@ int ControlThread::run() { //TODO re-enable the blocking read messages functions and fork the process read_control_messages(); - if (control_messages_ != 0) process_control_messages(); + if (control_messages_ != nullptr) process_control_messages(); } std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; flowgraph_->stop(); @@ -299,7 +299,7 @@ void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) LOG(WARNING) << "Unable to set control queue while flowgraph is running"; return; } - control_queue_ = std::move(control_queue); + control_queue_ = control_queue; cmd_interface_.set_msg_queue(control_queue_); } @@ -762,7 +762,7 @@ void ControlThread::read_control_messages() { DLOG(INFO) << "Reading control messages from queue"; gr::message::sptr queue_message = control_queue_->delete_head(); - if (queue_message != 0) + if (queue_message != nullptr) { control_messages_ = control_message_factory_->GetControlMessages(queue_message); } @@ -776,20 +776,20 @@ void ControlThread::read_control_messages() // Apply the corresponding control actions void ControlThread::process_control_messages() { - for (unsigned int i = 0; i < control_messages_->size(); i++) + for (auto & i : *control_messages_) { if (stop_) break; - if (control_messages_->at(i)->who == 200) + if (i->who == 200) { - apply_action(control_messages_->at(i)->what); + apply_action(i->what); } else { - if (control_messages_->at(i)->who == 300) // some TC commands require also actions from control_thread + if (i->who == 300) // some TC commands require also actions from control_thread { - apply_action(control_messages_->at(i)->what); + apply_action(i->what); } - flowgraph_->apply_action(control_messages_->at(i)->who, control_messages_->at(i)->what); + flowgraph_->apply_action(i->who, i->what); } processed_control_messages_++; } @@ -881,9 +881,9 @@ std::vector> ControlThread::get_visible_sats(time << "UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); - for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) + for (auto & it : gps_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -896,17 +896,17 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); - visible_gps.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); + visible_gps.push_back(it.second.i_satellite_PRN); } } std::map gal_eph_map = pvt_ptr->get_galileo_ephemeris(); - for (std::map::iterator it = gal_eph_map.begin(); it != gal_eph_map.end(); ++it) + for (auto & it : gal_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -919,17 +919,17 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); - visible_gal.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); + visible_gal.push_back(it.second.i_satellite_PRN); } } std::map gps_alm_map = pvt_ptr->get_gps_almanac(); - for (std::map::iterator it = gps_alm_map.begin(); it != gps_alm_map.end(); ++it) + for (auto & it : gps_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t aux_gtime; @@ -943,20 +943,20 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gps.begin(), visible_gps.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.i_satellite_PRN); if (it2 == visible_gps.end()) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); } } } std::map gal_alm_map = pvt_ptr->get_galileo_almanac(); - for (std::map::iterator it = gal_alm_map.begin(); it != gal_alm_map.end(); ++it) + for (auto & it : gal_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t gal_gtime; @@ -970,12 +970,12 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gal.begin(), visible_gal.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.i_satellite_PRN); if (it2 == visible_gal.end()) { - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); } } } diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 7caea97a2..8088e459c 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -169,6 +169,7 @@ #include #include #include +#include using google::LogMessage; @@ -181,7 +182,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default; std::unique_ptr GNSSBlockFactory::GetSignalSource( - std::shared_ptr configuration, gr::msg_queue::sptr queue, int ID) + const std::shared_ptr& configuration, gr::msg_queue::sptr queue, int ID) { std::string default_implementation = "File_Signal_Source"; std::string role = "SignalSource"; //backwards compatibility for old conf files @@ -198,12 +199,12 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( } std::string implementation = configuration->property(role + ".implementation", default_implementation); LOG(INFO) << "Getting SignalSource with implementation " << implementation; - return GetBlock(configuration, role, implementation, 0, 1, queue); + return GetBlock(configuration, role, implementation, 0, 1, std::move(queue)); } std::unique_ptr GNSSBlockFactory::GetSignalConditioner( - std::shared_ptr configuration, int ID) + const std::shared_ptr& configuration, int ID) { std::string default_implementation = "Pass_Through"; //backwards compatibility for old conf files @@ -271,7 +272,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( } -std::unique_ptr GNSSBlockFactory::GetObservables(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetObservables(const std::shared_ptr& configuration) { std::string default_implementation = "Hybrid_Observables"; std::string implementation = configuration->property("Observables.implementation", default_implementation); @@ -298,7 +299,7 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared } -std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetPVT(const std::shared_ptr& configuration) { std::string default_implementation = "RTKLIB_PVT"; std::string implementation = configuration->property("PVT.implementation", default_implementation); @@ -318,8 +319,8 @@ std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr GNSSBlockFactory::GetChannel_1C( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { //"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters @@ -378,7 +379,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1C", queue)); + "Channel", "1C", std::move(queue))); return channel_; } @@ -386,8 +387,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( //********* GPS L2C (M) CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2S( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " @@ -442,7 +443,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2S", queue)); + "Channel", "2S", std::move(queue))); return channel_; } @@ -450,8 +451,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( //********* GALILEO E1 B CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1B( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -509,7 +510,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1B", queue)); + "Channel", "1B", std::move(queue))); return channel_; } @@ -517,8 +518,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( //********* GALILEO E5a CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_5X( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -576,7 +577,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "5X", queue)); + "Channel", "5X", std::move(queue))); return channel_; } @@ -584,8 +585,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( //********* GLONASS L1 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -644,7 +645,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1G", queue)); + "Channel", "1G", std::move(queue))); return channel_; } @@ -652,8 +653,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( //********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -712,7 +713,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2G", queue)); + "Channel", "2G", std::move(queue))); return channel_; } @@ -720,8 +721,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( //********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -779,7 +780,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "L5", queue)); + "Channel", "L5", std::move(queue))); return channel_; } @@ -787,8 +788,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( //********* BeiDou B1I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B1( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -846,13 +847,13 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B1", queue)); + "Channel", "B1", std::move(queue))); return channel_; } std::unique_ptr>> GNSSBlockFactory::GetChannels( - std::shared_ptr configuration, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, const gr::msg_queue::sptr& queue) { std::string default_implementation = "Pass_Through"; std::string tracking_implementation; @@ -1137,10 +1138,10 @@ std::unique_ptr>> GNSSBlockFacto * (see below) */ std::unique_ptr GNSSBlockFactory::GetBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, + unsigned int out_streams, const gr::msg_queue::sptr& queue) { std::unique_ptr block; @@ -1825,9 +1826,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( */ std::unique_ptr GNSSBlockFactory::GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -1996,9 +1997,9 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( std::unique_ptr GNSSBlockFactory::GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -2147,9 +2148,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr GNSSBlockFactory::GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index ad014d356..8ead87090 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -57,75 +57,75 @@ class GNSSBlockFactory public: GNSSBlockFactory(); virtual ~GNSSBlockFactory(); - std::unique_ptr GetSignalSource(std::shared_ptr configuration, + std::unique_ptr GetSignalSource(const std::shared_ptr& configuration, gr::msg_queue::sptr queue, int ID = -1); - std::unique_ptr GetSignalConditioner(std::shared_ptr configuration, int ID = -1); + std::unique_ptr GetSignalConditioner(const std::shared_ptr& configuration, int ID = -1); - std::unique_ptr GetPVT(std::shared_ptr configuration); + std::unique_ptr GetPVT(const std::shared_ptr& configuration); - std::unique_ptr GetObservables(std::shared_ptr configuration); + std::unique_ptr GetObservables(const std::shared_ptr& configuration); - std::unique_ptr>> GetChannels(std::shared_ptr configuration, - gr::msg_queue::sptr queue); + std::unique_ptr>> GetChannels(const std::shared_ptr& configuration, + const gr::msg_queue::sptr& queue); /* * \brief Returns the block with the required configuration and implementation */ - std::unique_ptr GetBlock(std::shared_ptr configuration, - std::string role, std::string implementation, + std::unique_ptr GetBlock(const std::shared_ptr& configuration, + const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams, - gr::msg_queue::sptr queue = nullptr); + const gr::msg_queue::sptr& queue = nullptr); private: - std::unique_ptr GetChannel_1C(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1C(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_2S(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2S(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1B(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1B(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_5X(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_5X(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_L5(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_L5(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_2G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_B1(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_B1(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); std::unique_ptr GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); }; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 87760d8e3..d4c1acd56 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -66,8 +66,8 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati { connected_ = false; running_ = false; - configuration_ = configuration; - queue_ = std::move(queue); + configuration_ = std::move(configuration); + queue_ = queue; init(); } @@ -1344,11 +1344,11 @@ void GNSSFlowgraph::priorize_satellites(std::vector>::iterator it = visible_satellites.begin(); it != visible_satellites.end(); ++it) + for (auto & visible_satellite : visible_satellites) { - if (it->second.get_system() == "GPS") + if (visible_satellite.second.get_system() == "GPS") { - gs = Gnss_Signal(it->second, "1C"); + gs = Gnss_Signal(visible_satellite.second, "1C"); old_size = available_GPS_1C_signals_.size(); available_GPS_1C_signals_.remove(gs); if (old_size > available_GPS_1C_signals_.size()) @@ -1356,7 +1356,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "2S"); + gs = Gnss_Signal(visible_satellite.second, "2S"); old_size = available_GPS_2S_signals_.size(); available_GPS_2S_signals_.remove(gs); if (old_size > available_GPS_2S_signals_.size()) @@ -1364,7 +1364,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "L5"); + gs = Gnss_Signal(visible_satellite.second, "L5"); old_size = available_GPS_L5_signals_.size(); available_GPS_L5_signals_.remove(gs); if (old_size > available_GPS_L5_signals_.size()) @@ -1372,9 +1372,9 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond.get_system() == "Galileo") + else if (visible_satellite.second.get_system() == "Galileo") { - gs = Gnss_Signal(it->second, "1B"); + gs = Gnss_Signal(visible_satellite.second, "1B"); old_size = available_GAL_1B_signals_.size(); available_GAL_1B_signals_.remove(gs); if (old_size > available_GAL_1B_signals_.size()) @@ -1382,7 +1382,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "5X"); + gs = Gnss_Signal(visible_satellite.second, "5X"); old_size = available_GAL_5X_signals_.size(); available_GAL_5X_signals_.remove(gs); if (old_size > available_GAL_5X_signals_.size()) @@ -1405,7 +1405,7 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co { LOG(WARNING) << "Unable to update configuration while flowgraph connected"; } - configuration_ = configuration; + configuration_ = std::move(configuration); } @@ -1574,7 +1574,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_galileo_prn = tmp_set; } @@ -1590,7 +1590,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_gps_prn = tmp_set; } @@ -1606,7 +1606,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_sbas_prn = tmp_set; } @@ -1622,7 +1622,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_glonass_prn = tmp_set; } @@ -1638,7 +1638,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_beidou_prn = tmp_set; } diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 57b274757..0096c26a1 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -33,6 +33,7 @@ #include "control_message_factory.h" #include #include +#include TcpCmdInterface::TcpCmdInterface() @@ -64,7 +65,7 @@ void TcpCmdInterface::register_functions() void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { - PVT_sptr_ = PVT_sptr; + PVT_sptr_ = std::move(PVT_sptr); } @@ -284,7 +285,7 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { - control_queue_ = control_queue; + control_queue_ = std::move(control_queue); } @@ -330,7 +331,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) std::vector cmd_vector(std::istream_iterator{iss}, std::istream_iterator()); - if (cmd_vector.size() > 0) + if (!cmd_vector.empty()) { try { diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc index 764f65bb1..a5c02d4d4 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/core/system_parameters/rtcm.cc @@ -185,7 +185,7 @@ bool Rtcm::check_CRC(const std::string& message) const std::string Rtcm::bin_to_binary_data(const std::string& s) const { std::string s_aux; - int32_t remainder = static_cast(std::fmod(s.length(), 8)); + auto remainder = static_cast(std::fmod(s.length(), 8)); std::vector c; c.reserve(s.length()); @@ -238,7 +238,7 @@ std::string Rtcm::bin_to_hex(const std::string& s) const { std::string s_aux; std::stringstream ss; - int32_t remainder = static_cast(std::fmod(s.length(), 4)); + auto remainder = static_cast(std::fmod(s.length(), 4)); if (remainder != 0) { @@ -438,7 +438,7 @@ std::bitset<64> Rtcm::get_MT1001_4_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -500,7 +500,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -549,7 +549,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -622,11 +622,11 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -731,11 +731,11 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1065,9 +1065,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF029 = std::bitset<8>(len); std::string DF030_str_; - for (auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++) + for (char c : ant_descriptor) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF030_str_ += character.to_string(); } @@ -1084,9 +1083,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF032 = std::bitset<8>(len2); std::string DF033_str_; - for (auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++) + for (char c : ant_sn) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF033_str_ += character.to_string(); } @@ -1117,7 +1115,7 @@ std::bitset<61> Rtcm::get_MT1009_12_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -1181,7 +1179,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1230,7 +1228,7 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1307,11 +1305,11 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1418,11 +1416,11 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -2012,9 +2010,8 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do uint32_t i = 0; bool first = true; std::string text_binary; - for (auto it = message.cbegin(); it != message.cend(); it++) + for (char c : message) { - char c = *it; if (isgraph(c)) { i++; @@ -2336,7 +2333,7 @@ std::string Rtcm::get_MSM_header(uint32_t msg_number, bool more_messages) { // Find first element in observables block and define type of message - std::map::const_iterator observables_iter = observables.begin(); + auto observables_iter = observables.begin(); std::string sys(observables_iter->second.System, 1); Rtcm::set_DF002(msg_number); @@ -3382,33 +3379,33 @@ uint32_t Rtcm::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gn boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { last_lock_time = Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { last_lock_time = Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { lock_duration = current_time - Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { lock_duration = current_time - Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3425,33 +3422,33 @@ uint32_t Rtcm::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, con boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { last_lock_time = Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { last_lock_time = Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { lock_duration = current_time - Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { lock_duration = current_time - Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } @@ -4547,7 +4544,7 @@ int32_t Rtcm::set_DF126(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF127(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); + auto P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); DF127 = std::bitset<1>(P4); return 0; } @@ -4619,7 +4616,7 @@ int32_t Rtcm::set_DF135(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) int32_t Rtcm::set_DF136(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); + auto l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); DF136 = std::bitset<1>(l_n); return 0; } @@ -4912,7 +4909,7 @@ int32_t Rtcm::set_DF394(const std::map& gnss_synchro) int32_t Rtcm::set_DF395(const std::map& gnss_synchro) { DF395.reset(); - if (gnss_synchro.size() == 0) + if (gnss_synchro.empty()) { return 1; } @@ -4928,44 +4925,44 @@ int32_t Rtcm::set_DF395(const std::map& gnss_synchro) std::string sys(&gnss_synchro_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { mask_position = 32 - 15; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { mask_position = 32 - 4; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { mask_position = 32 - 16; DF395.set(mask_position, true); } - if ((sig.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig == "1C") && (sys == "R")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig == "2C") && (sys == "R")) { mask_position = 32 - 8; DF395.set(mask_position, true); @@ -5007,29 +5004,29 @@ std::string Rtcm::set_DF396(const std::map& observables) std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { list_of_signals.push_back(32 - 2); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { list_of_signals.push_back(32 - 15); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { list_of_signals.push_back(32 - 4); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { list_of_signals.push_back(32 - 16); } @@ -5058,32 +5055,32 @@ std::string Rtcm::set_DF396(const std::map& observables) sig = sig_.substr(0, 2); std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1C") && (sys == "G") && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "2S") && (sys == "G") && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "G") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1B") && (sys == "E") && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "E") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "7X") && (sys == "E") && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } @@ -5297,11 +5294,11 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e uint32_t lock_time_indicator; std::string sig_(gnss_synchro.Signal); std::string sys(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "1C") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "2S") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } @@ -5310,11 +5307,11 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "1C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "2C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5341,31 +5338,31 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) int32_t fine_phaserange_rate; std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); @@ -5428,31 +5425,31 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) sig_ = sig_.substr(0, 2); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); @@ -5493,23 +5490,23 @@ int32_t Rtcm::set_DF407(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e std::string sig_(gnss_synchro.Signal); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C")) && (sys_.compare("G") == 0)) + if ((sig_.compare("1C")) && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S")) && (sys_.compare("G") == 0)) + if ((sig_.compare("2S")) && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_.compare("E") == 0)) + if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_ == "E")) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index b719dba55..e1ac453be 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -305,12 +305,12 @@ int PositionSystemTest::configure_receiver() config->set_property("PVT.AR_GPS", "PPP-AR"); config->set_property("PVT.elevation_mask", std::to_string(15)); - config_f = 0; + config_f = nullptr; } else { config_f = std::make_shared(FLAGS_config_file_ptest); - config = 0; + config = nullptr; } return 0; } @@ -374,8 +374,8 @@ bool PositionSystemTest::save_mat_xy(std::vector* x, std::vector matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_xy write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); @@ -409,8 +409,8 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_x write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index e9a51e762..c5a7ca707 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -79,7 +79,7 @@ class TtffTest : public ::testing::Test public: void config_1(); void config_2(); - void print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_); + void print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr& config_); std::shared_ptr config; std::shared_ptr config2; @@ -297,7 +297,7 @@ void receive_msg() } -void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) +void TtffTest::print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr& config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -388,7 +388,7 @@ void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ for (double ttff_ : ttff) stm << ttff_ << " "; stm << std::endl; stm << "TTFF mean: " << mean << " [s]" << std::endl; - if (ttff.size() > 0) + if (!ttff.empty()) { stm << "TTFF max: " << *max_ttff << " [s]" << std::endl; stm << "TTFF min: " << *min_ttff << " [s]" << std::endl; @@ -629,7 +629,7 @@ int main(int argc, char **argv) msgsend_size = sizeof(msg.ttff); msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); receive_msg_thread.join(); - msgctl(sysv_msqid, IPC_RMID, NULL); + msgctl(sysv_msqid, IPC_RMID, nullptr); google::ShutDownCommandLineFlags(); return res;