Overpass API regression suite coverage (Nova Scotia) / overpass_api/statements/for.cc
overpass_api/statements/for.cc
131 of 138 instrumented lines run by the suite (94.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#include <cctype>20#include <iostream>21#include <map>22#include <set>23#include <sstream>24#include <string>25#include <stdlib.h>26#include <vector>28#include "for.h"31Generic_Statement_Maker< For_Statement > For_Statement::statement_maker("for");34For_Statement::For_Statement35 (int line_number_, const std::map< std::string, std::string >& input_attributes, Parsed_Query& global_settings)50void For_Statement::add_statement(Statement* statement, std::string text)70template< typename Index, typename Object, typename Valuation_Target >71void collect_for_targets_by_string(72 const std::map< Index, std::vector< Object > >& container,73 const Valuation_Target& target,74 const Eval_Task& task, Set_With_Context& context_from)89template< typename Index, typename Object, typename Valuation_Target >90void collect_for_targets_by_container(91 const std::map< Index, std::vector< Object > >& container,92 const Valuation_Target& target,93 const Eval_Container_Task& task, Set_With_Context& context_from)10182035 q std::vector< std::string > valuation = task.eval(context_from.get_context(it_idx->first, *it_elem), 0);110struct Base_Valuation_Target111{11215218 q Base_Valuation_Target(std::map< std::string, Set >& element_groups_) : element_groups(&element_groups_) {}113protected:114 std::map< std::string, Set >* element_groups;115};118struct Node_Valuation_Target : Base_Valuation_Target119{121 std::map< Uint32_Index, std::vector< Node_Skeleton > >& operator()(const std::string& rhs) const123};126struct Attic_Node_Valuation_Target : Base_Valuation_Target127{1281918 q Attic_Node_Valuation_Target(std::map< std::string, Set >& rhs) : Base_Valuation_Target(rhs) {}129 std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > >& operator()(const std::string& rhs) const131};134struct Way_Valuation_Target : Base_Valuation_Target135{137 std::map< Uint31_Index, std::vector< Way_Skeleton > >& operator()(const std::string& rhs) const139};142struct Attic_Way_Valuation_Target : Base_Valuation_Target143{1441918 q Attic_Way_Valuation_Target(std::map< std::string, Set >& rhs) : Base_Valuation_Target(rhs) {}145 std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& operator()(const std::string& rhs) const147};150struct Relation_Valuation_Target : Base_Valuation_Target151{1521918 q Relation_Valuation_Target(std::map< std::string, Set >& rhs) : Base_Valuation_Target(rhs) {}153 std::map< Uint31_Index, std::vector< Relation_Skeleton > >& operator()(const std::string& rhs) const155};158struct Attic_Relation_Valuation_Target : Base_Valuation_Target159{1601918 q Attic_Relation_Valuation_Target(std::map< std::string, Set >& rhs) : Base_Valuation_Target(rhs) {}161 std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& operator()(const std::string& rhs) const163};166struct Area_Valuation_Target : Base_Valuation_Target167{169 std::map< Uint31_Index, std::vector< Area_Skeleton > >& operator()(const std::string& rhs) const171};174struct Derived_Valuation_Target : Base_Valuation_Target175{1761918 q Derived_Valuation_Target(std::map< std::string, Set >& rhs) : Base_Valuation_Target(rhs) {}177 std::map< Uint31_Index, std::vector< Derived_Structure > >& operator()(const std::string& rhs) const179};182void For_Statement::execute(Resource_Manager& rman)2021918 q const Set* base_set = (input == get_result_name() ? &base_result_set : rman.get_set(input));2141413 q collect_for_targets_by_string(base_set->attic_nodes, Attic_Node_Valuation_Target(element_groups),2181413 q collect_for_targets_by_string(base_set->attic_ways, Attic_Way_Valuation_Target(element_groups),2201413 q collect_for_targets_by_string(base_set->relations, Relation_Valuation_Target(element_groups),2221413 q collect_for_targets_by_string(base_set->attic_relations, Attic_Relation_Valuation_Target(element_groups),2261413 q collect_for_targets_by_string(base_set->deriveds, Derived_Valuation_Target(element_groups),23555 q collect_for_targets_by_container(base_set->attic_nodes, Attic_Node_Valuation_Target(element_groups),23955 q collect_for_targets_by_container(base_set->attic_ways, Attic_Way_Valuation_Target(element_groups),24155 q collect_for_targets_by_container(base_set->relations, Relation_Valuation_Target(element_groups),24355 q collect_for_targets_by_container(base_set->attic_relations, Attic_Relation_Valuation_Target(element_groups),24755 q collect_for_targets_by_container(base_set->deriveds, Derived_Valuation_Target(element_groups),