Overpass API regression suite coverage (Nova Scotia) / overpass_api/data/diff_set.h
overpass_api/data/diff_set.h
92 of 94 instrumented lines run by the suite (97.9%) 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__DATA__DIFF_SET_H20#define DE__OSM3S___OVERPASS_API__DATA__DIFF_SET_H23#include "../core/datatypes.h"25#include <map>26#include <string>27#include <utility>28#include <vector>31typedef std::vector< std::pair< std::string, std::string > > Tag_Container;34struct Node_With_Context35{36 Uint31_Index idx;37 Node_Skeleton elem;38 uint64 expiration_date;39 OSM_Element_Metadata_Skeleton< Node_Skeleton::Id_Type > meta;40 Tag_Container tags;42 Node_With_Context(Uint31_Index idx_, Node_Skeleton elem_,43 uint64 expiration_date_, OSM_Element_Metadata_Skeleton< Node_Skeleton::Id_Type > meta_44 = OSM_Element_Metadata_Skeleton< Node_Skeleton::Id_Type >(),45 Tag_Container tags_ = Tag_Container())46225856239 q : idx(idx_), elem(elem_), expiration_date(expiration_date_), meta(meta_), tags(tags_) {}48 bool operator<(const Node_With_Context& e) const56};59struct Way_With_Context60{61 Uint31_Index idx;62 Way_Skeleton elem;63 uint64 expiration_date;64 OSM_Element_Metadata_Skeleton< Way_Skeleton::Id_Type > meta;65 Tag_Container tags;66 std::vector< Quad_Coord > geometry;68 Way_With_Context(Uint31_Index idx_, Way_Skeleton elem_, const std::vector< Quad_Coord >& geometry_,69 uint64 expiration_date_, OSM_Element_Metadata_Skeleton< Way_Skeleton::Id_Type > meta_70 = OSM_Element_Metadata_Skeleton< Way_Skeleton::Id_Type >(),71 Tag_Container tags_ = Tag_Container())7240207847 q : idx(idx_), elem(elem_), expiration_date(expiration_date_), meta(meta_), tags(tags_), geometry(geometry_) {}74 bool operator<(const Way_With_Context& e) const82};85struct Relation_With_Context86{87 Uint31_Index idx;88 Relation_Skeleton elem;89 uint64 expiration_date;90 OSM_Element_Metadata_Skeleton< Relation_Skeleton::Id_Type > meta;91 Tag_Container tags;92 std::vector< std::vector< Quad_Coord > > geometry;94 Relation_With_Context(Uint31_Index idx_, Relation_Skeleton elem_,95 const std::vector< std::vector< Quad_Coord > >& geometry_,96 uint64 expiration_date_, OSM_Element_Metadata_Skeleton< Relation_Skeleton::Id_Type > meta_97 = OSM_Element_Metadata_Skeleton< Relation_Skeleton::Id_Type >(),98 Tag_Container tags_ = Tag_Container())99317125 q : idx(idx_), elem(elem_), expiration_date(expiration_date_), meta(meta_), tags(tags_), geometry(geometry_) {}101 bool operator<(const Relation_With_Context& e) const109};112struct Diff_Set113{114 std::vector< std::pair< Node_With_Context, Node_With_Context > > different_nodes;115 std::vector< std::pair< Way_With_Context, Way_With_Context > > different_ways;116 std::vector< std::pair< Relation_With_Context, Relation_With_Context > > different_relations;117 std::vector< Derived_Structure > lhs_deriveds;118 std::vector< Derived_Structure > rhs_deriveds;120 void clear()127 const Diff_Set& swap(Diff_Set& rhs)138 Set make_from_set() const;139 Set make_to_set() const;140};143class Output_Handler;146void print_diff_set(const Diff_Set& result,147 uint32 output_mode, Output_Handler* output,148 const std::map< uint32, std::string >& users, const std::map< uint32, std::string >& roles,149 bool add_deletion_information);152struct Double_Coords153{154public:155 explicit Double_Coords(const std::vector< Quad_Coord >& geometry)158394253147 q for (std::vector< Quad_Coord >::const_iterator it = geometry.begin(); it != geometry.end(); ++it)172 explicit Double_Coords(const std::vector< std::vector< Quad_Coord > >& geometry)178464613425 q for (std::vector< Quad_Coord >::const_iterator it2 = it->begin(); it2 != it->end(); ++it2)193 const std::pair< Quad_Coord, Quad_Coord* >& bounds()198604 q bounds_ = std::make_pair(Quad_Coord(::ll_upper_(min_lat, min_lon), ::ll_lower(min_lat, min_lon)), &max);208 const std::pair< Quad_Coord, Quad_Coord* >& center()220private:221 double min_lat;222 double max_lat;223 double min_lon;224 double max_lon;225 std::pair< Quad_Coord, Quad_Coord* > bounds_;226 std::pair< Quad_Coord, Quad_Coord* > center_;227 Quad_Coord max;228};231const std::pair< Quad_Coord, Quad_Coord* >* bound_variant(Double_Coords& double_coords, unsigned int mode);234#endif