From: Guido Kanschat Date: Tue, 24 Jun 2003 09:10:16 +0000 (+0000) Subject: modifies return old value X-Git-Tag: v8.0.0~16401 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c92ccf671e7a6d5c7687ce04c76506a0199a8a;p=dealii.git modifies return old value git-svn-id: https://svn.dealii.org/trunk@7808 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/logstream.h b/deal.II/base/include/base/logstream.h index 9acea8a886..278d636c22 100644 --- a/deal.II/base/include/base/logstream.h +++ b/deal.II/base/include/base/logstream.h @@ -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 diff --git a/deal.II/base/source/log.cc b/deal.II/base/source/log.cc index c3dbdf7d28..b1fa60f5cc 100644 --- a/deal.II/base/source/log.cc +++ b/deal.II/base/source/log.cc @@ -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; } diff --git a/deal.II/doc/news/c-4-0.html b/deal.II/doc/news/c-4-0.html index a328b23e5f..a978fd45fd 100644 --- a/deal.II/doc/news/c-4-0.html +++ b/deal.II/doc/news/c-4-0.html @@ -40,6 +40,17 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

base

    + +
  1. + Improved: Logstream::depth_console, Logstream::depth_file, Logstream::log_execution_time and Logstream::log_time_differences + return the previous value. +
    + (GK 2003/06/22) +