]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
modifies return old value
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Jun 2003 09:10:16 +0000 (09:10 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Jun 2003 09:10:16 +0000 (09:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@7808 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/logstream.h
deal.II/base/source/log.cc
deal.II/doc/news/c-4-0.html

index 9acea8a88601be2815899d838a8b6b4a28dcc6f5..278d636c22d1839b5da95212bd3a82230ce15baa 100644 (file)
@@ -50,7 +50,7 @@
  * @item @p{deallog.pop()} when leaving that stage entered with @p{push}.
  * @end{itemize}
  *
- * @author Guido Kanschat, Wolfgang Bangerth, 1999
+ * @author Guido Kanschat, Wolfgang Bangerth, 1999, 2003
  */
 class LogStream
 {
@@ -116,8 +116,11 @@ class LogStream
                                      * prefixes is printed. By calling
                                      * this function with @p{n=0}, no
                                      * console output will be written.
+                                     *
+                                     * The previous value of this
+                                     * parameter is returned.
                                      */
-    void depth_console (const unsigned int n);
+    unsigned int depth_console (const unsigned int n);
      
                                     /**
                                      * Maximum number of levels to be
@@ -127,16 +130,22 @@ class LogStream
                                      * this function should be used
                                      * with care, since it may spoile
                                      * the value of a log file.
+                                     *
+                                     * The previous value of this
+                                     * parameter is returned.
                                      */
-    void depth_file (const unsigned int n);
+    unsigned int depth_file (const unsigned int n);
 
                                      /**
                                      * Set time printing flag. If this flag
                                      * is true, each output line will
                                      * be prepended by the user time used
                                      * by the running program so far.
+                                     *
+                                     * The previous value of this
+                                     * parameter is returned.
                                      */
-    void log_execution_time (const bool flag);
+    bool log_execution_time (const bool flag);
 
                                     /**
                                      * Output time differences
@@ -154,8 +163,11 @@ class LogStream
                                      * The measurement of times is
                                      * not changed by this function,
                                      * just the output.
+                                     *
+                                     * The previous value of this
+                                     * parameter is returned.
                                      */
-    void log_time_differences (const bool flag);
+    bool log_time_differences (const bool flag);
     
                                     /**
                                      * Output a constant something
index c3dbdf7d28f6e879bb096ae84456de045d9fa620..b1fa60f5cc52217c9732d2a6dee1a208aff1e627 100644 (file)
@@ -111,31 +111,39 @@ void LogStream::pop ()
 }
 
 
-void
+unsigned int
 LogStream::depth_console (const unsigned n)
 {
+  const unsigned int h = std_depth;
   std_depth = n;
+  return h;
 }
 
 
-void
+unsigned int
 LogStream::depth_file (const unsigned n)
 {
+  const unsigned int h = file_depth;
   file_depth = n;
+  return h;
 }
 
 
-void
+bool
 LogStream::log_execution_time (const bool flag)
 {
+  const bool h = print_utime;
   print_utime = flag;
+  return h;
 }
 
 
-void
+bool
 LogStream::log_time_differences (const bool flag)
 {
+  const bool h = diff_utime;
   diff_utime = flag;
+  return h;
 }
 
 
index a328b23e5f21d5763a2977073eecfc984eb7c304..a978fd45fdd0f9e4b0901d6263407c922ca254db 100644 (file)
@@ -40,6 +40,17 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>base</h3>
 
 <ol>
+
+  <li> <p>
+  Improved: <code class="class">Logstream</code>::<code
+  class="member">depth_console</code>, <code
+  class="class">Logstream</code>::<code class="member">depth_file</code>, <code
+  class="class">Logstream</code>::<code class="member">log_execution_time</code> and <code
+  class="class">Logstream</code>::<code class="member">log_time_differences</code>
+  return the previous value.
+  <br>
+  (GK 2003/06/22)
+  </p>
 </ol>
 
 

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.