Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

LogStream.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 
00004 #ifndef __LOG_STREAM_H
00005 #define __LOG_STREAM_H
00006 
00007 #include <string>
00008 #include <dolfin/constants.h>
00009 
00010 namespace dolfin {
00011 
00012   class LogStream {
00013   public:
00014     
00015     enum Type {COUT, ENDL};
00016     
00017     LogStream(Type type);
00018     ~LogStream();
00019     
00020     LogStream& operator<<(const char* s);
00021     LogStream& operator<<(const std::string& s);
00022     LogStream& operator<<(int a);
00023     LogStream& operator<<(unsigned int a);
00024     LogStream& operator<<(real a);
00025     LogStream& operator<<(const LogStream& stream);
00026 
00027     void show() const;
00028     
00029   private:
00030     
00031     void add(const char* msg);
00032     
00033     Type type;
00034     char* buffer;
00035     int current;
00036     
00037   };
00038   
00039   extern LogStream dolfin::cout;
00040   extern LogStream dolfin::endl;
00041   
00042 }
00043 
00044 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.