From 8dab109a172fffc02fde41f887ce02cfacd7c83a Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 16 Apr 1999 10:54:36 +0000 Subject: [PATCH] Change variable name 'std' to something more reasonable since that name confused egcs (which is understandable, since std also denotes the not yet fully implemented standard namespace). Also add some doc. git-svn-id: https://svn.dealii.org/trunk@1160 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/logstream.h | 50 ++++++++++++++++----------- deal.II/base/source/log.cc | 2 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/deal.II/base/include/base/logstream.h b/deal.II/base/include/base/logstream.h index 9b407c8620..338f8617c2 100644 --- a/deal.II/base/include/base/logstream.h +++ b/deal.II/base/include/base/logstream.h @@ -54,7 +54,7 @@ class LogStream * to #cerr#, but can be set to another * stream through the constructor. */ - ostream *std; + ostream *std_out; /** * Pointer to a stream, where a copy of @@ -65,9 +65,34 @@ class LogStream * by the #attach# function. */ ostream *file; - + + /** + * Flag which stores whether the + * last operation was a + * newline-generation. We use this flag + * to generate the list of prefixes at + * the next output, rather than + * immediately after the newline, since + * this might disturb the screen lay-out. + */ bool was_endl; + + /** + * Value denoting the number of + * prefixes to be printed to the + * standard output. If more than + * this number of prefixes is + * pushed to the stack, then no + * output will be generated until + * the number of prefixes shrinks + * back below this number. + */ unsigned int std_depth; + + /** + * Same for the maximum depth of + * prefixes for output to a file. + */ unsigned int file_depth; public: @@ -162,15 +187,6 @@ class LogStream * Declare this function as a friend. */ friend void endl (LogStream &); - - /** - * Kludge to make one of the egcs snapshots - * happy. Necessary since it produces an internal - * compiler error when accessing #s.std#. - * Remove this function at the first - * possible time. - */ - ostream & get_std_stream (); }; @@ -193,12 +209,7 @@ LogStream::push (const string& text) prefixes.push(pre); } -inline -ostream & -LogStream::get_std_stream () -{ - return *std; -} + template inline void @@ -207,12 +218,11 @@ writestuff(LogStream& s, const T& t) // print the object #t# to each of the // two streams, if necessary if (s.prefixes.size() <= s.std_depth) - s.get_std_stream() << t; + *(s.std_out) << t; if (s.file && (s.prefixes.size() <= s.file_depth)) *(s.file) << t; -} -; +}; diff --git a/deal.II/base/source/log.cc b/deal.II/base/source/log.cc index fc7ad7b23e..e8ecafae51 100644 --- a/deal.II/base/source/log.cc +++ b/deal.II/base/source/log.cc @@ -10,7 +10,7 @@ LogStream deallog; LogStream::LogStream() - : std(&cerr), file(0), was_endl(true), + : std_out(&cerr), file(0), was_endl(true), std_depth(10000), file_depth(10000) { prefixes.push("DEAL:"); -- 2.39.5