Overpass API regression suite coverage (Nova Scotia) / overpass_api/core/parsed_query.h

overpass_api/core/parsed_query.h

14 of 16 instrumented lines run by the suite (87.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 modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * 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 of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.
17 */
19#ifndef DE__OSM3S___OVERPASS_API__CORE__PARSED_QUERY_H
20#define DE__OSM3S___OVERPASS_API__CORE__PARSED_QUERY_H
23#include "../frontend/output_handler.h"
24#include "../frontend/output_handler_parser.h"
25#include "geometry.h"
28/* This class collects all the information gathered during parsing.
29 Thus it models a query immediately before execution. */
30class Parsed_Query
32public:
332448612 q Parsed_Query() : output_handler(0), global_bbox_limitation(Bbox_Double::invalid), last_dispensed_id(0ull) {}
342448612 q ~Parsed_Query() { delete output_handler; }
3610737612 q Output_Handler* get_output_handler() const { return output_handler; }
37 void set_output_handler(Output_Handler_Parser* parser,
38 Tokenizer_Wrapper* token, Error_Output* error_output);
392020 q void set_global_bbox(const Bbox_Double& bbox) { global_bbox_limitation = bbox; }
410 const std::map< std::string, std::string >& get_input_params() const { return input_params; }
420 void set_input_params(const std::map< std::string, std::string >& input_params_) { input_params = input_params_; }
44 void trigger_print_bounds() const;
452379522 q const Bbox_Double& get_global_bbox_limitation() const { return global_bbox_limitation; }
47121208107 q Derived_Skeleton::Id_Type dispense_derived_id() { return ++last_dispensed_id; }
49private:
50 // The class has ownership of objects - hence no assignment or copies are allowed
51 Parsed_Query(const Parsed_Query&);
52 Parsed_Query& operator=(const Parsed_Query&);
54 Output_Handler* output_handler;
55 Bbox_Double global_bbox_limitation;
56 std::map< std::string, std::string > input_params;
57 Derived_Skeleton::Id_Type last_dispensed_id;
58};
61inline void Parsed_Query::set_output_handler(Output_Handler_Parser* parser,
62 Tokenizer_Wrapper* token, Error_Output* error_output)
64948612 q delete output_handler;
65948612 q output_handler = parser->new_output_handler(input_params, token, error_output);
69inline void Parsed_Query::trigger_print_bounds() const
71595595 q if (global_bbox_limitation.valid() && output_handler)
722020 q output_handler->print_global_bbox(global_bbox_limitation);
76#endif