![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __BUFFER_H 00005 #define __BUFFER_H 00006 00007 namespace dolfin { 00008 00009 class Buffer { 00010 public: 00011 00012 enum Type { info, debug, warning, error }; 00013 00014 Buffer(); 00015 Buffer(int lines, int cols); 00016 ~Buffer(); 00017 00018 void init(int lines, int cols); 00019 00020 int size() const; 00021 void add(const char* msg, Type type = info, int level = 0); 00022 const char* get(int line) const; 00023 Type type(int line) const; 00024 int level(int line) const; 00025 00026 private: 00027 00028 void clear(); 00029 00030 int lines; // Number of lines 00031 int cols; // Number of columns 00032 00033 int first; // Position of first row 00034 int last; // Position of last row 00035 bool full; // True if the buffer is full 00036 00037 char** buffer; // The buffer 00038 Type* types; // Line types 00039 int* levels; // Levels 00040 00041 }; 00042 00043 } 00044 00045 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.