]> https://gitweb.dealii.org/ - dealii.git/commitdiff
deprecate members in TimerOutput 9219/head
authorTimo Heister <timo.heister@gmail.com>
Sat, 4 Jan 2020 01:48:01 +0000 (20:48 -0500)
committerTimo Heister <timo.heister@gmail.com>
Sat, 4 Jan 2020 01:48:01 +0000 (20:48 -0500)
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
tests/base/timer_03.cc
tests/base/timer_07.cc

index 1acb5750d246ad5d196e17c021cde1a4e79a4441..fdc03bb4f8527d84a51f87e76248e9981c63caed 100644 (file)
@@ -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 &section_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 &section_name = "");
 
   /**
index aa61cea6485cfe8abe55be0dfdca73ab14af9195..401a9a27c3b2a7fc3b0b087e8b64daaf0a8cf56a 100644 (file)
@@ -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<std::string, double> cpu_times =
     tO.get_summary_data(TimerOutput::OutputData::total_cpu_time);
index bb4eb351c613996e473994e85499c62fffbcb55a..4523a4be009e13463984cecbedf43512f5a84abe 100644 (file)
@@ -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();
     }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.