From 868ea10358b9d85129579c4c340b907828f14cb3 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 3 Jan 2020 20:48:01 -0500 Subject: [PATCH] deprecate members in TimerOutput It looks like these identical functions have been around for a long time. While I prefer enter/exit_section(), we use the others in most places. --- include/deal.II/base/timer.h | 11 ++++++----- tests/base/timer_03.cc | 12 ++++++------ tests/base/timer_07.cc | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index 1acb5750d2..fdc03bb4f8 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -790,13 +790,12 @@ public: /** * Same as @p enter_subsection. + * + * @deprecated Use enter_subsection() instead. */ - void + DEAL_II_DEPRECATED void enter_section(const std::string §ion_name); - // TODO: make some of these functions DEPRECATED (I would keep - // enter/exit_section) - /** * Leave a section. If no name is given, the last section that was entered * is left. @@ -806,8 +805,10 @@ public: /** * Same as @p leave_subsection. + * + * @deprecated Use leave_subsection() instead. */ - void + DEAL_II_DEPRECATED void exit_section(const std::string §ion_name = ""); /** diff --git a/tests/base/timer_03.cc b/tests/base/timer_03.cc index aa61cea648..401a9a27c3 100644 --- a/tests/base/timer_03.cc +++ b/tests/base/timer_03.cc @@ -77,14 +77,14 @@ main() Timer t1, t2; TimerOutput tO(std::cout, TimerOutput::summary, TimerOutput::cpu_times); - tO.enter_section("Section1"); - tO.enter_section("Section2"); + tO.enter_subsection("Section1"); + tO.enter_subsection("Section2"); burn(50); - tO.exit_section("Section2"); - tO.enter_section("Section2"); + tO.leave_subsection("Section2"); + tO.enter_subsection("Section2"); burn(50); - tO.exit_section("Section2"); - tO.exit_section("Section1"); + tO.leave_subsection("Section2"); + tO.leave_subsection("Section1"); std::map cpu_times = tO.get_summary_data(TimerOutput::OutputData::total_cpu_time); diff --git a/tests/base/timer_07.cc b/tests/base/timer_07.cc index bb4eb351c6..4523a4be00 100644 --- a/tests/base/timer_07.cc +++ b/tests/base/timer_07.cc @@ -39,7 +39,7 @@ main(int argc, char **argv) std::cerr, TimerOutput::summary, TimerOutput::cpu_times); - timer_out.enter_section("Section1"); + timer_out.enter_subsection("Section1"); throw Timer07Exception(); } -- 2.39.5