Overpass API regression suite coverage (Saxony) / template_db/ranges.h
template_db/ranges.h
19 of 20 instrumented lines run by the suite (95.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___TEMPLATE_DB__RANGES_H20#define DE__OSM3S___TEMPLATE_DB__RANGES_H22#include <utility>23#include <vector>26template< typename Index >27class Ranges28{29public:33 class Iterator34 {35 public:364637310647 q Iterator(typename std::vector< std::pair< Index, Index > >::const_iterator it_) : it(it_) {}41 const Iterator& operator++()48 private:49 typename std::vector< std::pair< Index, Index > >::const_iterator it;50 };57 Ranges intersect(const Ranges& rhs) const;58 Ranges union_(const Ranges& rhs) const;59 Ranges skip_start(Index lower_bound) const;60 void push_back(Index begin, Index end)62 void sort();64 bool is_global() const65140538596 q { return data.size() == 1 && data.begin()->first == Index::min() && data.begin()->second == Index::max(); }68private:69 std::vector< std::pair< Index, Index > > data;70};73#endif