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()) {
50 handler.node(static_cast<const osmium::DiffNode&>(diff));
53 handler.way(static_cast<const osmium::DiffWay&>(diff));
56 handler.relation(static_cast<const osmium::DiffRelation&>(diff));
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>
97 template <
typename... THandlers>
104 #endif // OSMIUM_DIFF_VISITOR_HPP