Skip to content

Commit da62f2b

Browse files
committed
Get output_requirements struct its own include file
1 parent ea0178e commit da62f2b

File tree

6 files changed

+45
-27
lines changed

6 files changed

+45
-27
lines changed

src/middle-ram.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "logging.hpp"
1111
#include "middle-ram.hpp"
1212
#include "options.hpp"
13+
#include "output-requirements.hpp"
1314

1415
#include <osmium/builder/osm_object_builder.hpp>
1516
#include <osmium/util/delta.hpp>

src/options.hpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,6 @@ struct database_options_t
4949

5050
std::string build_conninfo(database_options_t const &opt);
5151

52-
/**
53-
* Outputs can signal their requirements to the middle by setting these fields.
54-
*/
55-
struct output_requirements
56-
{
57-
/**
58-
* Need full node objects with tags, attributes (only if --extra-attributes
59-
* is set) and locations. If false, only node locations are needed.
60-
*/
61-
bool full_nodes = false;
62-
63-
/**
64-
* Need full way objects with tags, attributes (only if --extra-attributes
65-
* is set) and way nodes. If false, only way nodes are needed.
66-
*/
67-
bool full_ways = false;
68-
69-
/**
70-
* Need full relation objects with tags, attributes (only if
71-
* --extra-attributes is set) and members. If false, no data from relations
72-
* is needed.
73-
*/
74-
bool full_relations = false;
75-
};
76-
7752
/**
7853
* Structure for storing command-line and other options
7954
*/

src/output-requirements.hpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#ifndef OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP
2+
#define OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP
3+
4+
/**
5+
* SPDX-License-Identifier: GPL-2.0-or-later
6+
*
7+
* This file is part of osm2pgsql (https://osm2pgsql.org/).
8+
*
9+
* Copyright (C) 2006-2023 by the osm2pgsql developer community.
10+
* For a full list of authors see the git log.
11+
*/
12+
13+
/**
14+
* Outputs can signal their requirements to the middle by setting these fields.
15+
*/
16+
struct output_requirements
17+
{
18+
/**
19+
* Need full node objects with tags, attributes (only if --extra-attributes
20+
* is set) and locations. If false, only node locations are needed.
21+
*/
22+
bool full_nodes = false;
23+
24+
/**
25+
* Need full way objects with tags, attributes (only if --extra-attributes
26+
* is set) and way nodes. If false, only way nodes are needed.
27+
*/
28+
bool full_ways = false;
29+
30+
/**
31+
* Need full relation objects with tags, attributes (only if
32+
* --extra-attributes is set) and members. If false, no data from relations
33+
* is needed.
34+
*/
35+
bool full_relations = false;
36+
};
37+
38+
#endif // OSM2PGSQL_OUTPUT_REQUIREMENTS_HPP

src/output.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
* For a full list of authors see the git log.
88
*/
99

10+
#include "output.hpp"
11+
1012
#include "db-copy.hpp"
1113
#include "format.hpp"
14+
#include "options.hpp"
1215
#include "output-gazetteer.hpp"
1316
#include "output-null.hpp"
1417
#include "output-pgsql.hpp"
15-
#include "output.hpp"
1618

1719
#ifdef HAVE_LUA
1820
# include "output-flex.hpp"

src/output.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818

1919
#include <osmium/index/id_set.hpp>
2020

21-
#include "options.hpp"
2221
#include "osmtypes.hpp"
22+
#include "output-requirements.hpp"
2323

2424
class db_copy_thread_t;
2525
class thread_pool_t;
2626

2727
struct middle_query_t;
28+
struct options_t;
2829

2930
class output_t
3031
{

tests/test-middle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "dependency-manager.hpp"
1919
#include "middle-pgsql.hpp"
2020
#include "middle-ram.hpp"
21+
#include "output-requirements.hpp"
2122

2223
#include "common-buffer.hpp"
2324
#include "common-cleanup.hpp"

0 commit comments

Comments
 (0)