@@ -233,7 +233,6 @@ void osmdata_t::node(osmium::Node const &node)
233233 }
234234 }
235235 }
236- m_progress.add_node (node.id ());
237236}
238237
239238void osmdata_t::way (osmium::Way &way)
@@ -252,7 +251,6 @@ void osmdata_t::way(osmium::Way &way)
252251 way_add (&way);
253252 }
254253 }
255- m_progress.add_way (way.id ());
256254}
257255
258256void osmdata_t::relation (osmium::Relation const &rel)
@@ -274,7 +272,6 @@ void osmdata_t::relation(osmium::Relation const &rel)
274272 relation_add (rel);
275273 }
276274 }
277- m_progress.add_rel (rel.id ());
278275}
279276
280277void osmdata_t::node_add (osmium::Node const &node) const
@@ -586,7 +583,8 @@ class multithreaded_processor
586583
587584} // anonymous namespace
588585
589- progress_display_t osmdata_t::process_file (osmium::io::File const &file)
586+ void osmdata_t::process_file (osmium::io::File const &file,
587+ progress_display_t &progress)
590588{
591589 osmium::io::Reader reader{file};
592590 type_id_version last{osmium::item_type::node, 0 , 0 };
@@ -599,21 +597,20 @@ progress_display_t osmdata_t::process_file(osmium::io::File const &file)
599597 " Input file contains deleted objects but "
600598 " you are not in append mode." };
601599 }
602- osmium::apply_item (object, *this );
600+ osmium::apply_item (object, *this , progress );
603601 }
604602 }
605603 flush ();
606604
607605 reader.close ();
608-
609- return m_progress;
610606}
611607
612- progress_display_t
613- osmdata_t ::process_files(std::vector<osmium::io::File> const &files )
608+ void osmdata_t::process_files (std::vector<osmium::io::File> const &files,
609+ progress_display_t &progress )
614610{
615611 if (files.size () == 1 ) {
616- return process_file (files.front ());
612+ process_file (files.front (), progress);
613+ return ;
617614 }
618615
619616 std::vector<data_source_t > data_sources;
@@ -638,7 +635,7 @@ osmdata_t::process_files(std::vector<osmium::io::File> const &files)
638635 " Input file contains deleted objects but "
639636 " you are not in append mode." };
640637 }
641- osmium::apply_item (element.object (), *this );
638+ osmium::apply_item (element.object (), *this , progress );
642639 }
643640
644641 auto *source = element.data_source ();
@@ -652,8 +649,6 @@ osmdata_t::process_files(std::vector<osmium::io::File> const &files)
652649 for (auto &data_source : data_sources) {
653650 data_source.close ();
654651 }
655-
656- return m_progress;
657652}
658653
659654void osmdata_t::process_dependents () const
0 commit comments