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()) {
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
Definition: diff_object.hpp:243
Definition: diff_object.hpp:66
osmium::item_type type() const noexcept
Definition: diff_object.hpp:155
InputIterator< Reader > end(Reader &)
Definition: reader_iterator.hpp:47
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
void apply_diff(TIterator it, TIterator end, THandlers &... handlers)
Definition: diff_visitor.hpp:72
Definition: item_type.hpp:197