Overpass API regression suite coverage (Nova Scotia) / overpass_api/statements/filter.cc
overpass_api/statements/filter.cc
87 of 100 instrumented lines run by the suite (87.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#include "filter.h"20#include "tag_value.h"21#include "../data/tag_store.h"23#include <algorithm>24#include <sstream>27class Filter_Constraint : public Query_Constraint28{29 public:36 void filter(const Statement& query, Resource_Manager& rman, Set& into);39 private:40 Filter_Statement* stmt;41};44template< typename Index, typename Maybe_Attic >45void eval_elems(std::map< Index, std::vector< Maybe_Attic > >& items,46 Set_With_Context& into_context, Eval_Task& task)4863262 q for (typename std::map< Index, std::vector< Maybe_Attic > >::iterator it_idx = items.begin();5445877757 q for (typename std::vector< Maybe_Attic >::const_iterator it_elem = it_idx->second.begin();67void Filter_Constraint::filter(const Statement& query, Resource_Manager& rman, Set& into)96//-----------------------------------------------------------------------------99Filter_Statement::Statement_Maker Filter_Statement::statement_maker;100Filter_Statement::Criterion_Maker Filter_Statement::criterion_maker;103Statement* Filter_Statement::Criterion_Maker::create_criterion(const Token_Node_Ptr& tree_it,104 const std::string& type, const std::string& into,105 Statement::Factory& stmt_factory, Parsed_Query& global_settings, Error_Output* error_output)11130069 q if (tree_it->token == ":" && tree_it->rhs && tree_it->lhs && tree_it.lhs()->token == "if")11329268 q tree_it.rhs(), Statement::elem_eval_possible, Statement::Single_Return_Type_Checker(Statement::string));133Filter_Statement::Filter_Statement134 (int line_number_, const std::map< std::string, std::string >& input_attributes, Parsed_Query& global_settings)143Filter_Statement::~Filter_Statement()151void Filter_Statement::add_statement(Statement* statement, std::string text)166void Filter_Statement::execute(Resource_Manager& rman)178Query_Constraint* Filter_Statement::get_query_constraint()