Overpass API regression suite coverage (Nova Scotia) / overpass_api/statements/make.h
overpass_api/statements/make.h
25 of 34 instrumented lines run by the suite (73.5%) 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__STATEMENTS__MAKE_H20#define DE__OSM3S___OVERPASS_API__STATEMENTS__MAKE_H23#include "set_prop.h"24#include "statement.h"26#include <map>27#include <string>28#include <vector>31/* === The statement <em>make</em> ===33The statement <em>make</em> produces per execution one derived element.34The content of this output element is controlled by the parameters of the statement.36It is necessary to set a fixed type as type for the generated element.37After that, an arbitrary number of tags can be set.39As opposed to the <em>convert</em> statement, setting a generic key requires to prepend with the name of a set.40At execution time, a <em>make</em> statement with a generic key sets tags for all keys41that appear at least once in any of the elements from the chosen set.42Explicitly defined tags always override keys generated by the generic key mechanism.43Similarly, explicitly with a shrek canceled tags are skipped by the generic key mechanism.45Finally, it is possible to explicitly set the id of the generated object.46If you do not set an id then an unique id from a global ascending counter is assigned.48The base syntax is50 make <Type> <List of Tags>52where <List of Tags> is a comma separated list of items,53each of which must be one the following55 <Key> = <Evaluator>56 <Set>:: = <Evaluator>57 !<Key>58 ::id = <Evaluator>60It is a syntax error to set the same key twice.61Also, at most one generic key can be set.62*/64class Make_Statement : public Output_Statement65{66public:67 Make_Statement(int line_number_, const std::map< std::string, std::string >& attributes,68 Parsed_Query& global_settings);70 virtual void add_statement(Statement* statement, std::string text);71 virtual void execute(Resource_Manager& rman);72 virtual ~Make_Statement();73 static Generic_Statement_Maker< Make_Statement > statement_maker;75 virtual std::string dump_xml(const std::string& indent) const820 for (std::vector< Set_Prop_Statement* >::const_iterator it = evaluators.begin(); it != evaluators.end(); ++it)87 virtual std::string dump_compact_ql(const std::string& indent) const101 virtual std::string dump_pretty_ql(const std::string& indent) const115private:116 std::string type;117 std::vector< Set_Prop_Statement* > evaluators;118 Set_Prop_Statement* geom_evaluator;119 Set_Prop_Statement* id_evaluator;120 Set_Prop_Statement* multi_evaluator;121};124#endif