From da62f2ba42d1bd572d99cb419fc556628eb0cc07 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 19 Aug 2023 11:02:30 +0200 Subject: [PATCH] Get output_requirements struct its own include file --- src/middle-ram.cpp | 1 + src/options.hpp | 25 ------------------------ src/output-requirements.hpp | 38 +++++++++++++++++++++++++++++++++++++ src/output.cpp | 4 +++- src/output.hpp | 3 ++- tests/test-middle.cpp | 1 + 6 files changed, 45 insertions(+), 27 deletions(-) create mode 100644 src/output-requirements.hpp diff --git a/src/middle-ram.cpp b/src/middle-ram.cpp index f34161101..a00339970 100644 --- a/src/middle-ram.cpp +++ b/src/middle-ram.cpp @@ -10,6 +10,7 @@ #include "logging.hpp" #include "middle-ram.hpp" #include "options.hpp" +#include "output-requirements.hpp" #include #include diff --git a/src/options.hpp b/src/options.hpp index 1e18c31c3..dea7367a0 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -49,31 +49,6 @@ struct database_options_t std::string build_conninfo(database_options_t const &opt); -/** - * Outputs can signal their requirements to the middle by setting these fields. - */ -struct output_requirements -{ - /** - * Need full node objects with tags, attributes (only if --extra-attributes - * is set) and locations. If false, only node locations are needed. - */ - bool full_nodes = false; - - /** - * Need full way objects with tags, attributes (only if --extra-attributes - * is set) and way nodes. If false, only way nodes are needed. - */ - bool full_ways = false; - - /** - * Need full relation objects with tags, attributes (only if - * --extra-attributes is set) and members. If false, no data from relations - * is needed. - */ - bool full_relations = false; -}; - /** * Structure for storing command-line and other options */ diff --git a/src/output-requirements.hpp b/src/output-requirements.hpp new file mode 100644 index 000000000..9deb1a099 --- /dev/null +++ b/src/output-requirements.hpp @@ -0,0 +1,38 @@ +#ifndef OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP +#define OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP + +/** + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of osm2pgsql (https://osm2pgsql.org/). + * + * Copyright (C) 2006-2023 by the osm2pgsql developer community. + * For a full list of authors see the git log. + */ + +/** + * Outputs can signal their requirements to the middle by setting these fields. + */ +struct output_requirements +{ + /** + * Need full node objects with tags, attributes (only if --extra-attributes + * is set) and locations. If false, only node locations are needed. + */ + bool full_nodes = false; + + /** + * Need full way objects with tags, attributes (only if --extra-attributes + * is set) and way nodes. If false, only way nodes are needed. + */ + bool full_ways = false; + + /** + * Need full relation objects with tags, attributes (only if + * --extra-attributes is set) and members. If false, no data from relations + * is needed. + */ + bool full_relations = false; +}; + +#endif // OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP diff --git a/src/output.cpp b/src/output.cpp index 4c1d5787c..a26206f7d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -7,12 +7,14 @@ * For a full list of authors see the git log. */ +#include "output.hpp" + #include "db-copy.hpp" #include "format.hpp" +#include "options.hpp" #include "output-gazetteer.hpp" #include "output-null.hpp" #include "output-pgsql.hpp" -#include "output.hpp" #ifdef HAVE_LUA # include "output-flex.hpp" diff --git a/src/output.hpp b/src/output.hpp index 35a787f61..c82a62d36 100644 --- a/src/output.hpp +++ b/src/output.hpp @@ -18,13 +18,14 @@ #include -#include "options.hpp" #include "osmtypes.hpp" +#include "output-requirements.hpp" class db_copy_thread_t; class thread_pool_t; struct middle_query_t; +struct options_t; class output_t { diff --git a/tests/test-middle.cpp b/tests/test-middle.cpp index 75c5dff84..f6ef975eb 100644 --- a/tests/test-middle.cpp +++ b/tests/test-middle.cpp @@ -18,6 +18,7 @@ #include "dependency-manager.hpp" #include "middle-pgsql.hpp" #include "middle-ram.hpp" +#include "output-requirements.hpp" #include "common-buffer.hpp" #include "common-cleanup.hpp"