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
t_const_iterator< T > cend() const
Definition: buffer.hpp:636
Definition: item_type.hpp:198
Definition: diff_object.hpp:63
osmium::item_type type() const noexcept
Definition: diff_object.hpp:156
Definition: diff_iterator.hpp:52
t_iterator< T > end()
Definition: buffer.hpp:595
Namespace for everything in the Osmium library.
Definition: assembler.hpp:66
t_iterator< T > begin()
Definition: buffer.hpp:539
osmium::io::InputIterator< osmium::io::Reader > end(osmium::io::Reader &)
Definition: reader_iterator.hpp:45
void apply_diff(TIterator it, TIterator end, THandlers &...handlers)
Definition: diff_visitor.hpp:72
Definition: buffer.hpp:97
t_const_iterator< T > cbegin() const
Definition: buffer.hpp:614