[Tile-serving] [openstreetmap/osm2pgsql] Cleanup output construction (PR #1831)

Jochen Topf notifications at github.com
Thu Nov 24 10:51:18 UTC 2022


This code was a bit of a mess. Now the implementations of the derived classes are more similar and a bit simpler.

We'll use the "rule of five" in `output_t` and derived classes, so copy and move constructors and operators as well as (virtual) destructor are all spelled out.

As far as possible constructors etc. are made private/protected. We only ever create those classes though the  `create_output()` function or the `clone()` function. But we are using `std::make_shared()` internally so some constructors need to be public because, while conceptually the objects are created from inside the class itself, it is the `make_shared` function that actually does this and it can only use the public interface.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1831

-- Commit Summary --

  * Refactor creation/cloning of output_t and derived classes
  * Some smaller cleanups in output code
  * Simplify output_flex_t constructors

-- File Changes --

    M src/output-flex.cpp (71)
    M src/output-flex.hpp (32)
    M src/output-gazetteer.cpp (2)
    M src/output-gazetteer.hpp (34)
    M src/output-null.cpp (8)
    M src/output-null.hpp (6)
    M src/output-pgsql.cpp (6)
    M src/output-pgsql.hpp (16)
    M src/output.cpp (12)
    M src/output.hpp (46)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1831.patch
https://github.com/openstreetmap/osm2pgsql/pull/1831.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1831
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/pull/1831 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20221124/2e4280bd/attachment.htm>


More information about the Tile-serving mailing list