]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reformatting and small bug fix for a compiler error in the latest egcs snapshot.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Aug 1998 08:21:45 +0000 (08:21 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Aug 1998 08:21:45 +0000 (08:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@519 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9322595409c14b981583041584b2bd3013637663..4bd3e282ded820ea5f93254d941c38a42b678e7a 100644 (file)
@@ -3,16 +3,15 @@
 #ifndef __jobidentifier_H
 #define __jobidentifier_H
 
-#include <ctime>
 #include <string>
 
-/** Identification of a program run. #JobIdentifier# determines the
-    start time of a program run and stores it as a program
-    identifier. There exists a library object #dealjobid# of this
-    class. This object can be accessed by all output functions to
-    provide an id for the current job.
-*/
-
+/**
+ * Identification of a program run. #JobIdentifier# determines the
+ * start time of a program run and stores it as a program
+ * identifier. There exists a library object #dealjobid# of this
+ * class. This object can be accessed by all output functions to
+ * provide an id for the current job.
+ */
 class JobIdentifier
 {
 public:
index 8a97998319619ed090b48ce47f1580f826c73d5b..a8d0bcc42aadff70c21b4c4a70f74820212503da 100644 (file)
@@ -1,20 +1,25 @@
-// $Id$
-
+/*----------------------------   logstream.h     ---------------------------*/
+/*      $Id$                 */
 #ifndef __logstream_H
 #define __logstream_H
+/*----------------------------   logstream.h     ---------------------------*/
+
 
 #include <stack>
 #include <string>
 #include <iostream>
 
+
+
 /**
-   A class that simplifies the process of execution logging by
-   providing
-<UL><LI>a push and pop mechanism for prefixes and
-<LI>the possibility of distributing information to files and the
-console.
-</UL>
-*/
+ * A class that simplifies the process of execution logging by
+ * providing
+ * \begin{itemize}
+ * \item a push and pop mechanism for prefixes and
+ * \item the possibility of distributing information to files and the
+ *   console.
+ * \end{itemize}
+ */
 class LogStream
 {
 public:
@@ -23,82 +28,108 @@ public:
   ostream* file;
 
   bool was_endl;
-  unsigned std_depth, fil_depth;
+  unsigned std_depth, file_depth;
   
 public:
-                                  /** Standard constructor, since we
-                                      intend to provide an object
-                                      clog in the library.
-                                  */
+                                  /**
+                                   * Standard constructor, since we
+                                   * intend to provide an object
+                                   * clog in the library.
+                                   */
   LogStream();
-                                  /** Enable output to a second
-                                      stream.
-                                  */
+    
+                                  /**
+                                   * Enable output to a second
+                                   * stream.
+                                   */
   void attach(ostream& o);
-                                  /** Disable output to the second
-                                      stream. 
-                                  */
+    
+                                  /**
+                                   * Disable output to the second
+                                   * stream. 
+                                   */
   void detach()
       {
        file = 0;
       }
-                                  /** Push another prefix on the
-                                      stack. Prefixes are
-                                      automatically separated by a
-                                      colon and there is a double
-                                      colon after the last prefix.
-                                  */
-  void push(const string& text)
+    
+                                    /**
+                                     * Push another prefix on the
+                                     * stack. Prefixes are
+                                     * automatically separated by a
+                                     * colon and there is a double
+                                     * colon after the last prefix.
+                                     */
+    void push(const string& text)
       {
        string pre=prefixes.top();
        pre += text;
        pre += string(":");
        prefixes.push(pre);
       }
-                                  /** Remove the last prefix.
-                                   */
-  void pop()
+    
+                                    /**
+                                     * Remove the last prefix.
+                                     */
+    void pop()
       {
-       prefixes.pop();
+       prefixes.pop();
       }
-                                  /** Maximum number of levels to be
-                                      printed on the console. This
-                                      function allows to restrict
-                                      console output to the upmost
-                                      levels of iterations. Only
-                                      output with less than #n#
-                                      prefixes is printed. By calling
-                                      this function with #n=0#, no
-                                      console output will be written.
-                                  */
-  void depth_console(unsigned n)
+     
+                                    /**
+                                     * Maximum number of levels to be
+                                     * printed on the console. This
+                                     * function allows to restrict
+                                     * console output to the upmost
+                                     * levels of iterations. Only
+                                     * output with less than #n#
+                                     * prefixes is printed. By calling
+                                     * this function with #n=0#, no
+                                     * console output will be written.
+                                     */
+    void depth_console(unsigned n)
       {
-       std_depth = n;
+       std_depth = n;
       }
-                                  /** Maximum number of levels to be
-                                      written to the log file. The
-                                      functionality is the same as
-                                      #depth_console#, nevertheless,
-                                      this function should be used
-                                      with care, since it may spoile
-                                      the value of a log file.
-                                  */
-  void depth_file(unsigned n)
+     
+                                    /**
+                                     * Maximum number of levels to be
+                                     * written to the log file. The
+                                     * functionality is the same as
+                                     * #depth_console#, nevertheless,
+                                     * this function should be used
+                                     * with care, since it may spoile
+                                     * the value of a log file.
+                                     */
+    void depth_file(unsigned n)
       {
-       fil_depth = n;
+       file_depth = n;
       }
+
+    ostream & get_std_stream () const {
+      return std;
+    };
 };
 
+
+
+
+/* ----------------------------- Inline functions and templates ---------------- */
+
+
 template <class T>
 inline void
 writestuff(LogStream& s, const T& t)
 {
   if (s.prefixes.size()<=s.std_depth)
-    s.std << t;
-  if (s.file && (s.prefixes.size()<=s.fil_depth))
+    s.get_std_stream () << t;
+  if (s.file && (s.prefixes.size()<=s.file_depth))
     *(s.file) << t;
 }
 
+
+
+
 template <class T>
 inline LogStream&
 operator << (LogStream& s, const T& t)
@@ -143,4 +174,10 @@ operator << (LogStream& s, void (*f)(LogStream&))
 
 extern LogStream deallog;
 
+
+
+
+/*----------------------------   logstream.h     ---------------------------*/
+/* end of #ifndef __logstream_H */
 #endif
+/*----------------------------   logstream.h     ---------------------------*/
index 72264338e03725e6854900026ac6cc8dafee94df..9c04be267dd1a42289553352e2837bebed2f8986 100644 (file)
@@ -1,6 +1,8 @@
 // $Id$
 
 #include <base/jobidentifier.h>
+#include <ctime>
+
 
 JobIdentifier dealjobid;
 
index ec904aac4b8d4a10d12e33388fc57a6577650294..e79981eb793237846438c7d7ab395d66f8d803ed 100644 (file)
@@ -7,7 +7,7 @@ LogStream deallog;
 
 LogStream::LogStream()
                : std(cerr), file(0), was_endl(true),
-                 std_depth(10000), fil_depth(10000)
+                 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.