From 2b18ae14fee740e633bc46afe02f192d8db4e374 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 17 Aug 2017 11:03:02 +0200 Subject: [PATCH] Replace iterators by const iterators --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 110 +++++++++--------- src/algorithms/PVT/libs/rtklib_solver.cc | 16 +-- src/core/receiver/control_thread.cc | 24 ++-- src/core/receiver/gnss_flowgraph.cc | 30 ++--- 4 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 0f830414d..e42270b0b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -464,9 +464,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if (in[i][epoch].Flag_valid_pseudorange == true) { - std::map::iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN); - std::map::iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN); - std::map::iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); if(((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0)) || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0)) || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0)) @@ -617,20 +617,20 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite // ####################### RINEX FILES ################# - std::map::iterator galileo_ephemeris_iter; - std::map::iterator gps_ephemeris_iter; - std::map::iterator gps_cnav_ephemeris_iter; - std::map::iterator gnss_observables_iter; + std::map::const_iterator galileo_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_cnav_ephemeris_iter; + std::map::const_iterator gnss_observables_iter; if (!b_rinex_header_written) // & we have utc data in nav message! { - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin(); + galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if(type_of_rx == 1) // GPS L1 C/A only { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); @@ -640,7 +640,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 2) // GPS L2C only { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); @@ -649,7 +649,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 4) // Galileo E1B only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); @@ -659,7 +659,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if(type_of_rx == 5) // Galileo E5a only { std::string signal("5X"); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); @@ -669,7 +669,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if(type_of_rx == 6) // Galileo E5b only { std::string signal("7X"); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); @@ -678,7 +678,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 7) // GPS L1 C/A + GPS L2C { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); @@ -688,7 +688,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if(type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) { std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); @@ -698,7 +698,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 10) // GPS L1 C/A + Galileo E5a { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) { std::string gal_signal("5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); @@ -708,7 +708,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 11) // GPS L1 C/A + Galileo E5b { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) ) { std::string gal_signal("7X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); @@ -718,7 +718,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 14) // Galileo E1B + Galileo E5a { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) ) { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); @@ -728,7 +728,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 15) // Galileo E1B + Galileo E5b { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) ) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) ) { std::string gal_signal("1B 7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); @@ -766,9 +766,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); } } - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin(); + galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); // Log observables into the RINEX file if(flag_write_RINEX_obs_output) @@ -900,17 +900,17 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if(flag_write_RTCM_1019_output == true) { - for(std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } if(flag_write_RTCM_MSM_output == true) { - std::map::iterator gps_ephemeris_iter; - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); + std::map::const_iterator gps_ephemeris_iter; + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -920,16 +920,16 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if(flag_write_RTCM_1045_output == true) { - for(std::map::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ ) + for(std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); } } if(flag_write_RTCM_MSM_output == true) { - std::map::iterator gal_ephemeris_iter; - gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); - if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + std::map::const_iterator gal_ephemeris_iter; + gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -939,18 +939,18 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if(flag_write_RTCM_1019_output == true) { - for(std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } } if(flag_write_RTCM_MSM_output == true) { - std::map::iterator gps_ephemeris_iter; - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); - std::map::iterator gps_cnav_ephemeris_iter; - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) ) + std::map::const_iterator gps_ephemeris_iter; + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_ephemeris_iter; + gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) ) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -977,7 +977,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); unsigned int i = 0; - for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) + 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); if(gps_channel == 0) @@ -986,7 +986,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { // This is a channel with valid GPS signal gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { gps_channel = i; } @@ -997,7 +997,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if(system.compare("E") == 0) { galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { gal_channel = i; } @@ -1008,14 +1008,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if(flag_write_RTCM_MSM_output == true) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } if(flag_write_RTCM_MSM_output == true) { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1028,14 +1028,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if(type_of_rx == 1) // GPS L1 C/A { - for(std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } - std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); + std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1044,14 +1044,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite if((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo { - for(std::map::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_ephemeris_iter++ ) + for(std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); } - std::map::iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); + std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1059,15 +1059,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } if(type_of_rx == 7) // GPS L1 C/A + GPS L2C { - for(std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } - std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); - std::map::iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.begin(); + std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1077,7 +1077,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite { if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for(std::map::iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++ ) + for(std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ ) { d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); } @@ -1091,7 +1091,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite } unsigned int i = 0; - for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) + 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); if(gps_channel == 0) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index d2e9281fa..953d0d726 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -111,9 +111,9 @@ rtklib_solver::~rtklib_solver() bool rtklib_solver::get_PVT(const std::map & gnss_observables_map, double Rx_time, bool flag_averaging) { std::map::const_iterator gnss_observables_iter; - std::map::iterator galileo_ephemeris_iter; - std::map::iterator gps_ephemeris_iter; - std::map::iterator gps_cnav_ephemeris_iter; + std::map::const_iterator galileo_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_cnav_ephemeris_iter; this->set_averaging_flag(flag_averaging); @@ -139,7 +139,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ { // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) { //convert ephemeris from GNSS-SDR class to RTKLIB structure eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); @@ -163,7 +163,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ // 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) { bool found_E1_obs=false; for (int i = 0; i < valid_obs; i++) @@ -207,7 +207,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ if(sig_.compare("1C") == 0) { gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.end()) + if (gps_ephemeris_iter != gps_ephemeris_map.cend()) { //convert ephemeris from GNSS-SDR class to RTKLIB structure eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second); @@ -228,11 +228,11 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ if(sig_.compare("2S") == 0) { gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end()) + if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend()) { // 1. Find the same satellite in GPS L1 band gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != gps_ephemeris_map.end()) + if (gps_ephemeris_iter != gps_ephemeris_map.cend()) { // 2. If found, replace the existing GPS L1 ephemeris with the GPS L2 ephemeris // (more precise!), and attach the L2 observation to the L1 observation in RTKLIB structure diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index e0e845bc5..1a1517de5 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -186,9 +186,9 @@ bool ControlThread::read_assistance_from_XML() std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << std::endl; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) { - std::map::iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); + std::map::const_iterator gps_eph_iter; + for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { std::cout << "SUPL: Read XML Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; @@ -314,9 +314,9 @@ void ControlThread::assist_GNSS() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_eph_iter; - for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.begin(); - gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.end(); + std::map::const_iterator gps_eph_iter; + for(gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); + gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); gps_eph_iter++) { std::cout << "SUPL: Received Ephemeris for GPS SV " << gps_eph_iter->first << std::endl; @@ -351,9 +351,9 @@ void ControlThread::assist_GNSS() error = supl_client_ephemeris_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_alm_iter; - for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.begin(); - gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.end(); + std::map::const_iterator gps_alm_iter; + for(gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.cbegin(); + gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); gps_alm_iter++) { std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl; @@ -386,9 +386,9 @@ void ControlThread::assist_GNSS() error = supl_client_acquisition_.get_assistance(supl_mcc, supl_mns, supl_lac, supl_ci); if (error == 0) { - std::map::iterator gps_acq_iter; - for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.begin(); - gps_acq_iter != supl_client_acquisition_.gps_acq_map.end(); + std::map::const_iterator gps_acq_iter; + for(gps_acq_iter = supl_client_acquisition_.gps_acq_map.cbegin(); + gps_acq_iter != supl_client_acquisition_.gps_acq_map.cend(); gps_acq_iter++) { std::cout << "SUPL: Received Acquisition assistance for GPS SV " << gps_acq_iter->first << std::endl; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index a529e6318..30b0e4bf2 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -565,7 +565,7 @@ void GNSSFlowgraph::set_signals_list() /* * Sets a sequential list of GNSS satellites */ - std::set::iterator available_gnss_prn_iter; + std::set::const_iterator available_gnss_prn_iter; /* * \TODO Describe GNSS satellites more nicely, with RINEX notation @@ -649,8 +649,8 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create GPS L1 C/A signals */ - for (available_gnss_prn_iter = available_gps_prn.begin(); - available_gnss_prn_iter != available_gps_prn.end(); + for (available_gnss_prn_iter = available_gps_prn.cbegin(); + available_gnss_prn_iter != available_gps_prn.cend(); available_gnss_prn_iter++) { available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"), @@ -663,8 +663,8 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create GPS L2C M signals */ - for (available_gnss_prn_iter = available_gps_prn.begin(); - available_gnss_prn_iter != available_gps_prn.end(); + for (available_gnss_prn_iter = available_gps_prn.cbegin(); + available_gnss_prn_iter != available_gps_prn.cend(); available_gnss_prn_iter++) { available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"), @@ -677,8 +677,8 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create SBAS L1 C/A signals */ - for (available_gnss_prn_iter = available_sbas_prn.begin(); - available_gnss_prn_iter != available_sbas_prn.end(); + for (available_gnss_prn_iter = available_sbas_prn.cbegin(); + available_gnss_prn_iter != available_sbas_prn.cend(); available_gnss_prn_iter++) { available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("SBAS"), @@ -692,8 +692,8 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create the list of Galileo E1 B signals */ - for (available_gnss_prn_iter = available_galileo_prn.begin(); - available_gnss_prn_iter != available_galileo_prn.end(); + for (available_gnss_prn_iter = available_galileo_prn.cbegin(); + available_gnss_prn_iter != available_galileo_prn.cend(); available_gnss_prn_iter++) { available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"), @@ -706,8 +706,8 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create the list of Galileo E1 B signals */ - for (available_gnss_prn_iter = available_galileo_prn.begin(); - available_gnss_prn_iter != available_galileo_prn.end(); + for (available_gnss_prn_iter = available_galileo_prn.cbegin(); + available_gnss_prn_iter != available_galileo_prn.cend(); available_gnss_prn_iter++) { available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Galileo"), @@ -717,7 +717,7 @@ void GNSSFlowgraph::set_signals_list() /* * Ordering the list of signals from configuration file */ - std::list::iterator gnss_it = available_GNSS_signals_.begin(); + std::list::const_iterator gnss_it = available_GNSS_signals_.cbegin(); // Pre-assignation if not defined at ChannelX.signal=1C ...? In what order? @@ -742,9 +742,9 @@ void GNSSFlowgraph::set_signals_list() } // **** FOR DEBUGGING THE LIST OF GNSS SIGNALS **** - // std::list::iterator available_gnss_list_iter; - // for (available_gnss_list_iter = available_GNSS_signals_.begin(); available_gnss_list_iter - // != available_GNSS_signals_.end(); available_gnss_list_iter++) + // std::list::const_iterator available_gnss_list_iter; + // for (available_gnss_list_iter = available_GNSS_signals_.cbegin(); available_gnss_list_iter + // != available_GNSS_signals_.cend(); available_gnss_list_iter++) // { // std::cout << *available_gnss_list_iter << std::endl; // }