Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <diff_object.hpp>
Public Member Functions | |
DiffObject () noexcept=default | |
DiffObject (const osmium::OSMObject &prev, const osmium::OSMObject &curr, const osmium::OSMObject &next) noexcept | |
bool | empty () const noexcept |
const osmium::OSMObject & | prev () const noexcept |
const osmium::OSMObject & | curr () const noexcept |
const osmium::OSMObject & | next () const noexcept |
bool | first () const noexcept |
bool | last () const noexcept |
osmium::item_type | type () const noexcept |
osmium::object_id_type | id () const noexcept |
osmium::object_version_type | version () const noexcept |
osmium::changeset_id_type | changeset () const noexcept |
osmium::Timestamp | start_time () const noexcept |
osmium::Timestamp | end_time () const noexcept |
bool | is_between (const osmium::Timestamp &from, const osmium::Timestamp &to) const noexcept |
bool | is_visible_at (const osmium::Timestamp ×tamp) const noexcept |
Private Attributes | |
const osmium::OSMObject * | m_prev = nullptr |
const osmium::OSMObject * | m_curr = nullptr |
const osmium::OSMObject * | m_next = nullptr |
A DiffObject holds pointers to three OSMObjects, the current object, the previous, and the next. They always have the same type (Node, Way, or Relation) and the same ID, but may have different versions.
It is used when iterating over OSM files with history data to make working with versioned OSM objects easier. Because you have access to the previous and next objects as well as the current one, comparisons between object versions is easy.
If the current object is the first version available, the previous pointer must be the same as the current one. If the current object is the last version available, the next pointer must be the same as the current one.
DiffObjects are immutable.
|
defaultnoexcept |
Default construct an empty DiffObject. Most methods of this class can not be called on empty DiffObjects.
|
inlinenoexcept |
Construct a non-empty DiffObject from the given OSMObjects. All OSMObjects must be of the same type (Node, Way, or Relation) and have the same ID.
|
inlinenoexcept |
Return the changeset ID of the current object.
|
inlinenoexcept |
Get the current object stored.
|
inlinenoexcept |
Check whether the DiffObject was created empty.
|
inlinenoexcept |
Return the timestamp when the current version of the object is not valid any more, ie the time when the next version of the object is valid. If this is the last version of the object, this will return a special "end of time" timestamp that is guaranteed to be larger than any normal timestamp.
|
inlinenoexcept |
Is the current object version the first (with this type and ID)?
|
inlinenoexcept |
Return the ID of the current object.
|
inlinenoexcept |
Current object version is valid between time "from" (inclusive) and time "to" (not inclusive).
This is a bit more complex than you'd think, because we have to handle the case properly where the start_time() == end_time().
|
inlinenoexcept |
Current object version is visible at the given timestamp.
|
inlinenoexcept |
Is the current object version the last (with this type and ID)?
|
inlinenoexcept |
Get the next object stored.
|
inlinenoexcept |
Get the previous object stored.
|
inlinenoexcept |
Return the timestamp when the current object version was created.
|
inlinenoexcept |
Return the type of the current object.
|
inlinenoexcept |
Return the version of the current object.
|
private |
|
private |
|
private |