File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed
Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ set(osm2pgsql_lib_SOURCES
88 geometry-processor.cpp
99 input .cpp
1010 logging.cpp
11+ middle.cpp
1112 middle-pgsql.cpp
1213 middle-ram.cpp
1314 node-persistent-cache .cpp
Original file line number Diff line number Diff line change 1+
2+ #include " middle-pgsql.hpp"
3+ #include " middle-ram.hpp"
4+ #include " middle.hpp"
5+ #include " options.hpp"
6+
7+ std::shared_ptr<middle_t > create_middle (options_t const &options)
8+ {
9+ if (options.slim ) {
10+ return std::make_shared<middle_pgsql_t >(&options);
11+ }
12+
13+ return std::make_shared<middle_ram_t >(&options);
14+ }
15+
Original file line number Diff line number Diff line change 88#include " osmtypes.hpp"
99#include " thread-pool.hpp"
1010
11+ class options_t ;
12+
1113/* *
1214 * Interface for returning information about raw OSM input data from a cache.
1315 */
@@ -104,4 +106,7 @@ struct middle_t
104106
105107inline middle_t ::~middle_t () = default ;
106108
109+ // / Factory function: Instantiate the middle based on the command line options.
110+ std::shared_ptr<middle_t > create_middle (options_t const &options);
111+
107112#endif // OSM2PGSQL_MIDDLE_HPP
Original file line number Diff line number Diff line change 2727#include " format.hpp"
2828#include " input.hpp"
2929#include " logging.hpp"
30- #include " middle-pgsql.hpp"
31- #include " middle-ram.hpp"
30+ #include " middle.hpp"
3231#include " options.hpp"
3332#include " osmdata.hpp"
3433#include " output.hpp"
3938#include < exception>
4039#include < memory>
4140
42- static std::shared_ptr<middle_t > create_middle (options_t const &options)
43- {
44- if (options.slim ) {
45- return std::make_shared<middle_pgsql_t >(&options);
46- }
47-
48- return std::make_shared<middle_ram_t >(&options);
49- }
50-
5141int main (int argc, char *argv[])
5242{
5343 try {
You can’t perform that action at this time.
0 commit comments