Overpass API regression suite coverage (Nova Scotia) / overpass_api/osm-backend/area_updater.h
overpass_api/osm-backend/area_updater.h
0 of 41 instrumented lines run by the suite (0.0%) at 8edf11b0419c (this file on GitHub).
runnever runcolumns: line, executions, queries (click for the queries that run the line)
1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.2 *3 * This file is part of Overpass_API.4 *5 * Overpass_API is free software: you can redistribute it and/or modify6 * it under the terms of the GNU Affero General Public License as7 * published by the Free Software Foundation, either version 3 of the8 * License, or (at your option) any later version.9 *10 * Overpass_API is distributed in the hope that it will be useful,11 * but WITHOUT ANY WARRANTY; without even the implied warranty of12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * GNU General Public License for more details.14 *15 * You should have received a copy of the GNU Affero General Public License16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.17 */19#ifndef DE__OSM3S___OVERPASS_API__OSM_BACKEND__AREA_UPDATER_H20#define DE__OSM3S___OVERPASS_API__OSM_BACKEND__AREA_UPDATER_H22#include <algorithm>23#include <iostream>24#include <map>25#include <set>26#include <vector>28#include "../../template_db/block_backend.h"29#include "../../template_db/random_file.h"30#include "../../template_db/transaction.h"31#include "../core/datatypes.h"32#include "../core/settings.h"35struct Area_Pair_Comparator_By_Id {36 bool operator() (const std::pair< Area_Location, Uint31_Index >& a,37 const std::pair< Area_Location, Uint31_Index >& b)41};43struct Area_Pair_Equal_Id {44 bool operator() (const std::pair< Area_Location, Uint31_Index >& a,45 const std::pair< Area_Location, Uint31_Index >& b)49};51struct Area_Updater : public Area_Usage_Listener52{53 Area_Updater(Transaction& transaction_);54 Area_Updater(std::string db_dir_);59 void set_area60 (uint32 id, const Uint31_Index& index,61 const std::vector< std::pair< std::string, std::string > >& tags,62 const std::set< uint32 >& used_indices);63 void set_area(const Uint31_Index& index, const Area_Location& area);64 void add_blocks(const std::map< Uint31_Index, std::vector< Area_Block > >& area_blocks_);65 void commit();66 virtual void flush();68private:69 Transaction* transaction;70 bool external_transaction;71 std::string db_dir;72 std::map< Uint31_Index, std::vector< Area_Block > > area_blocks;73 unsigned int total_area_blocks_count;74 std::set< Area::Id_Type > ids_to_modify;75 std::vector< std::pair< Area_Location, Uint31_Index > > areas_to_insert;76 static Area_Pair_Comparator_By_Id area_comparator_by_id;77 static Area_Pair_Equal_Id area_equal_id;79 void update();80 void update_area_ids81 (std::map< Uint31_Index, std::set< Area_Skeleton > >& locations_to_delete,82 std::map< Uint31_Index, std::set< Area_Block > >& blocks_to_delete);83 void update_members84 (const std::map< Uint31_Index, std::set< Area_Skeleton > >& locations_to_delete,85 const std::map< Uint31_Index, std::set< Area_Block > >& blocks_to_delete);86 void prepare_delete_tags87 (std::vector< Tag_Entry< uint32 > >& tags_to_delete,88 const std::map< Uint31_Index, std::set< Area_Skeleton > >& to_delete);89 void update_area_tags_local90 (const std::vector< Tag_Entry< uint32 > >& tags_to_delete);91 void update_area_tags_global92 (const std::vector< Tag_Entry< uint32 > >& tags_to_delete);93};95/** Implementation (inline functions): --------------------------------------*/97inline void Area_Updater::commit()103inline void Area_Updater::flush()1140 std::cerr<<"File_Error: "<<strerror(e.error_number)<<' '<<e.error_number<<' '<<e.filename<<' '<<e.origin<<'\n';118inline void Area_Updater::set_area119 (uint32 id, const Uint31_Index& index,120 const std::vector< std::pair< std::string, std::string > >& tags,121 const std::set< uint32 >& used_indices)12401290135inline void Area_Updater::set_area(const Uint31_Index& index, const Area_Location& area)141#endif