mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2025-08-16 16:03:23 +00:00
Add documentation to id_tracker
This is based on @zerebubuth's comments in
aa1ff6e5d0 (commitcomment-10961958)
This commit is contained in:
@ -5,12 +5,29 @@
|
|||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tracker for if an element needs to be revisited later in the process, also
|
||||||
|
* known as "pending". This information used to be stored in the database, but
|
||||||
|
* is ephemeral and lead to database churn, bloat, and was generally slow.
|
||||||
|
* An initial re-implementation stored it as a std::set<osmid_t>, which worked
|
||||||
|
* but was inefficient with memory overhead and pointer chasing.
|
||||||
|
*
|
||||||
|
* Instead, the size of the leaf nodes is increased. This was initially a
|
||||||
|
* vector<bool>, but the cost of exposing the iterator was too high.
|
||||||
|
* Instead, it's a uint32, with a function to find the next bit set in the block
|
||||||
|
*
|
||||||
|
* These details aren't exposed in the public interface, which just has
|
||||||
|
* pop_mark.
|
||||||
|
*/
|
||||||
struct id_tracker : public boost::noncopyable {
|
struct id_tracker : public boost::noncopyable {
|
||||||
id_tracker();
|
id_tracker();
|
||||||
~id_tracker();
|
~id_tracker();
|
||||||
|
|
||||||
void mark(osmid_t id);
|
void mark(osmid_t id);
|
||||||
bool is_marked(osmid_t id);
|
bool is_marked(osmid_t id);
|
||||||
|
/**
|
||||||
|
* Finds an osmid_t that is marked
|
||||||
|
*/
|
||||||
osmid_t pop_mark();
|
osmid_t pop_mark();
|
||||||
size_t size();
|
size_t size();
|
||||||
osmid_t last_returned() const;
|
osmid_t last_returned() const;
|
||||||
|
Reference in New Issue
Block a user