1 #ifndef OSMIUM_HANDLER_CHECK_ORDER_HPP 2 #define OSMIUM_HANDLER_CHECK_ORDER_HPP 58 std::runtime_error(what),
63 std::runtime_error(what),
96 if (m_max_way_id > std::numeric_limits<osmium::object_id_type>::min()) {
99 if (m_max_relation_id > std::numeric_limits<osmium::object_id_type>::min()) {
103 if (m_max_node_id == node.
id()) {
104 throw out_of_order_error{
"Node ID twice in input. Maybe you are using a history or change file?", node.
id()};
109 m_max_node_id = node.
id();
113 if (m_max_relation_id > std::numeric_limits<osmium::object_id_type>::min()) {
117 if (m_max_way_id == way.
id()) {
118 throw out_of_order_error{
"Way ID twice in input. Maybe you are using a history or change file?", way.
id()};
123 m_max_way_id = way.
id();
127 if (m_max_relation_id == relation.
id()) {
128 throw out_of_order_error{
"Relation ID twice in input. Maybe you are using a history or change file?", relation.
id()};
130 if (
id_order{}(relation.
id(), m_max_relation_id)) {
133 m_max_relation_id = relation.
id();
137 return m_max_node_id;
145 return m_max_relation_id;
154 #endif // OSMIUM_HANDLER_CHECK_ORDER_HPP
Definition: object_comparisons.hpp:87
osmium::object_id_type object_id
Definition: check_order.hpp:55
Definition: check_order.hpp:87
Definition: relation.hpp:168
void node(const osmium::Node &node)
Definition: check_order.hpp:95
Definition: location.hpp:551
Definition: handler.hpp:71
void way(const osmium::Way &way)
Definition: check_order.hpp:112
osmium::object_id_type max_node_id() const noexcept
Definition: check_order.hpp:136
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
osmium::object_id_type max_relation_id() const noexcept
Definition: check_order.hpp:144
int64_t object_id_type
Type for OSM object (node, way, or relation) IDs.
Definition: types.hpp:45
Definition: check_order.hpp:53
out_of_order_error(const char *what, osmium::object_id_type id)
Definition: check_order.hpp:62
object_id_type id() const noexcept
Get ID of this object.
Definition: object.hpp:122
void relation(const osmium::Relation &relation)
Definition: check_order.hpp:126
out_of_order_error(const std::string &what, osmium::object_id_type id)
Definition: check_order.hpp:57
osmium::object_id_type max_way_id() const noexcept
Definition: check_order.hpp:140