]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change variable name 'std' to something more reasonable since that name confused...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 16 Apr 1999 10:54:36 +0000 (10:54 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 16 Apr 1999 10:54:36 +0000 (10:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@1160 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/logstream.h
deal.II/base/source/log.cc

index 9b407c8620da1d4c895d207547c8b2f05119d1b2..338f8617c26486e55722ae5d5e8eaa22d6064e58 100644 (file)
@@ -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 <class T>
 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;
-}
-;
+};
 
 
 
index fc7ad7b23e85574d2749cd195acda597aebd74cb..e8ecafae514de026fb6063dc0aa071290380c608 100644 (file)
@@ -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:");

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.