Skip to content

Commit 3e5daee

Browse files
committed
Move idlist_t into its own header file
1 parent 96950d4 commit 3e5daee

File tree

7 files changed

+39
-17
lines changed

7 files changed

+39
-17
lines changed

src/dependency-manager.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* For a full list of authors see the git log.
1111
*/
1212

13+
#include "idlist.hpp"
1314
#include "osmtypes.hpp"
1415

1516
#include <osmium/index/id_set.hpp>

src/idlist.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef OSM2PGSQL_IDLIST_HPP
2+
#define OSM2PGSQL_IDLIST_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+
* \file
15+
*
16+
* This file contains the definition of the idlist_t class.
17+
*/
18+
19+
#include "osmtypes.hpp"
20+
21+
#include <vector>
22+
23+
struct idlist_t : public std::vector<osmid_t>
24+
{
25+
// Get all constructors from std::vector
26+
using vector<osmid_t>::vector;
27+
28+
// Even though we got all constructors from std::vector we need this on
29+
// some compilers/libraries for some reason.
30+
idlist_t() = default;
31+
32+
};
33+
34+
#endif // OSM2PGSQL_IDLIST_HPP

src/middle-pgsql.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <nlohmann/json.hpp>
3434

3535
#include "format.hpp"
36+
#include "idlist.hpp"
3637
#include "json-writer.hpp"
3738
#include "logging.hpp"
3839
#include "middle-pgsql.hpp"

src/osmdata.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <osmium/osm/box.hpp>
2525

2626
#include "dependency-manager.hpp"
27+
#include "idlist.hpp"
2728
#include "osmtypes.hpp"
2829
#include "pgsql-params.hpp"
2930

src/osmtypes.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -238,23 +238,6 @@ class taglist_t
238238
std::vector<tag_t> m_tags;
239239
}; // class taglist_t
240240

241-
struct idlist_t : public std::vector<osmid_t>
242-
{
243-
// Get all constructors from std::vector
244-
using vector<osmid_t>::vector;
245-
246-
// Even though we got all constructors from std::vector we need this on
247-
// some compilers/libraries for some reason.
248-
idlist_t() = default;
249-
250-
explicit idlist_t(osmium::NodeRefList const &list)
251-
{
252-
for (auto const &n : list) {
253-
push_back(n.ref());
254-
}
255-
}
256-
};
257-
258241
using rolelist_t = std::vector<char const *>;
259242

260243
#endif // OSM2PGSQL_OSMTYPES_HPP

src/pgsql-helper.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* For a full list of authors see the git log.
1111
*/
1212

13+
#include "idlist.hpp"
1314
#include "osmtypes.hpp"
1415

1516
#include <string>

tests/common-buffer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include "format.hpp"
14+
#include "idlist.hpp"
1415
#include "osmtypes.hpp"
1516

1617
#include <osmium/memory/buffer.hpp>

0 commit comments

Comments
 (0)