[Positioning] const_iterators instead of iterators
This commit is contained in:
parent
910d9a04d9
commit
c5eff5f857
|
@ -1,7 +1,4 @@
|
|||
|
||||
- const_iterator
|
||||
Utiliser const_iterator quand on ne modifie pas la valeur pointée.
|
||||
|
||||
- InputCSV
|
||||
° Différencier une requête normale d'une requête de calibration, en
|
||||
utilisant les champs de direction.
|
||||
|
|
|
@ -34,12 +34,13 @@ Building::Building(const Building &b)
|
|||
Building::~Building()
|
||||
{
|
||||
// Empty Area list
|
||||
for (vector<Area*>::iterator i = areas.begin() ; i != areas.end() ; ++i)
|
||||
for (vector<Area*>::const_iterator i = areas.begin() ;
|
||||
i != areas.end() ; ++i)
|
||||
delete *i ;
|
||||
areas.clear() ;
|
||||
|
||||
// Empty Waypoint list
|
||||
for (vector<Waypoint*>::iterator i = waypoints.begin() ;
|
||||
for (vector<Waypoint*>::const_iterator i = waypoints.begin() ;
|
||||
i != waypoints.end() ; ++i)
|
||||
{
|
||||
// Delete current waypoint only if it is not linked to another building
|
||||
|
|
|
@ -121,7 +121,7 @@ const Request& InputCSV::get_next_request()
|
|||
tokenizer<escaped_list_separator<char> > tok(
|
||||
current_line, escaped_list_separator<char>('\\', ';', '\"')) ;
|
||||
|
||||
tokenizer<escaped_list_separator<char> >::iterator ti(tok.begin()) ;
|
||||
tokenizer<escaped_list_separator<char> >::const_iterator ti(tok.begin()) ;
|
||||
|
||||
// Read Mobile MAC field
|
||||
if (ti == tok.end())
|
||||
|
|
|
@ -52,7 +52,7 @@ void Measurement::update_average_ss()
|
|||
{
|
||||
average_ss = 0 ;
|
||||
|
||||
for (vector<int>::iterator i = ss_list.begin() ;
|
||||
for (vector<int>::const_iterator i = ss_list.begin() ;
|
||||
i != ss_list.end() ; ++i)
|
||||
{
|
||||
float ss_mwatts =
|
||||
|
|
|
@ -29,7 +29,7 @@ unordered_map<string, AccessPoint> Stock::aps =
|
|||
*/
|
||||
const Mobile& Stock::get_mobile(const string &mac)
|
||||
{
|
||||
unordered_map<string, Mobile>::iterator i = mobiles.find(mac) ;
|
||||
unordered_map<string, Mobile>::const_iterator i = mobiles.find(mac) ;
|
||||
if (i != mobiles.end())
|
||||
return i->second ;
|
||||
throw out_of_range("No Mobile with MAC address « " + mac + " »!") ;
|
||||
|
@ -45,7 +45,7 @@ const Mobile& Stock::get_mobile(const string &mac)
|
|||
*/
|
||||
const AccessPoint& Stock::get_ap(const string &mac)
|
||||
{
|
||||
unordered_map<string, AccessPoint>::iterator i = aps.find(mac) ;
|
||||
unordered_map<string, AccessPoint>::const_iterator i = aps.find(mac) ;
|
||||
if (i != aps.end())
|
||||
return i->second ;
|
||||
throw out_of_range("No AccessPoint with MAC address « " + mac + " »!") ;
|
||||
|
|
Loading…
Reference in New Issue