1#ifndef OSMIUM_DIFF_VISITOR_HPP
2#define OSMIUM_DIFF_VISITOR_HPP
46 template <
typename THandler>
47 inline void apply_diff_iterator_recurse(
const osmium::DiffObject& diff, THandler& handler) {
48 switch (diff.
type()) {
59 throw osmium::unknown_type{};
63 template <
typename THandler,
typename... TRest>
64 inline void apply_diff_iterator_recurse(
const osmium::DiffObject& diff, THandler& handler, TRest&... more) {
65 apply_diff_iterator_recurse(diff, handler);
66 apply_diff_iterator_recurse(diff, more...);
71 template <
typename TIterator,
typename... THandlers>
72 inline void apply_diff(TIterator it, TIterator end, THandlers&... handlers) {
75 diff_iterator dit{it, end};
76 diff_iterator dend{end, end};
78 for (; dit != dend; ++dit) {
79 detail::apply_diff_iterator_recurse(*dit, handlers...);
85 template <
typename TSource,
typename... THandlers>
86 inline void apply_diff(TSource& source, THandlers&... handlers) {
92 template <
typename... THandlers>
93 inline void apply_diff(osmium::memory::Buffer& buffer, THandlers&... handlers) {
94 apply_diff(buffer.begin(), buffer.end(), handlers...);
97 template <
typename... THandlers>
98 inline void apply_diff(
const osmium::memory::Buffer& buffer, THandlers&... handlers) {
99 apply_diff(buffer.cbegin(), buffer.cend(), handlers...);
Definition diff_iterator.hpp:57
osmium::item_type type() const noexcept
Definition diff_object.hpp:155
Namespace for everything in the Osmium library.
Definition assembler.hpp:53
DiffObjectDerived< osmium::Node > DiffNode
Definition diff_object.hpp:265
void apply_diff(TIterator it, TIterator end, THandlers &... handlers)
Definition diff_visitor.hpp:72
DiffObjectDerived< osmium::Way > DiffWay
Definition diff_object.hpp:266
@ relation
Definition item_type.hpp:50
@ node
Definition item_type.hpp:48
@ way
Definition item_type.hpp:49
DiffObjectDerived< osmium::Relation > DiffRelation
Definition diff_object.hpp:267