From: Wolfgang Bangerth Date: Wed, 26 Aug 1998 08:21:45 +0000 (+0000) Subject: Reformatting and small bug fix for a compiler error in the latest egcs snapshot. X-Git-Tag: v8.0.0~22735 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32478348720dfe9056631f96068235329bc9d3b6;p=dealii.git Reformatting and small bug fix for a compiler error in the latest egcs snapshot. git-svn-id: https://svn.dealii.org/trunk@519 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/job_identifier.h b/deal.II/base/include/base/job_identifier.h index 9322595409..4bd3e282de 100644 --- a/deal.II/base/include/base/job_identifier.h +++ b/deal.II/base/include/base/job_identifier.h @@ -3,16 +3,15 @@ #ifndef __jobidentifier_H #define __jobidentifier_H -#include #include -/** 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: diff --git a/deal.II/base/include/base/logstream.h b/deal.II/base/include/base/logstream.h index 8a97998319..a8d0bcc42a 100644 --- a/deal.II/base/include/base/logstream.h +++ b/deal.II/base/include/base/logstream.h @@ -1,20 +1,25 @@ -// $Id$ - +/*---------------------------- logstream.h ---------------------------*/ +/* $Id$ */ #ifndef __logstream_H #define __logstream_H +/*---------------------------- logstream.h ---------------------------*/ + #include #include #include + + /** - A class that simplifies the process of execution logging by - providing -
  • a push and pop mechanism for prefixes and -
  • the possibility of distributing information to files and the -console. -
-*/ + * 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 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 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 ---------------------------*/ diff --git a/deal.II/base/source/job_identifier.cc b/deal.II/base/source/job_identifier.cc index 72264338e0..9c04be267d 100644 --- a/deal.II/base/source/job_identifier.cc +++ b/deal.II/base/source/job_identifier.cc @@ -1,6 +1,8 @@ // $Id$ #include +#include + JobIdentifier dealjobid; diff --git a/deal.II/base/source/log.cc b/deal.II/base/source/log.cc index ec904aac4b..e79981eb79 100644 --- a/deal.II/base/source/log.cc +++ b/deal.II/base/source/log.cc @@ -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:"); }