00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GUL_STD_H
00021 #define GUL_STD_H
00022
00023 #include <string>
00024 #include <map>
00025 #include <stack>
00026 #include <string>
00027 #include "gul_types.h"
00028
00029 namespace gul {
00030
00031 using gul::poolalloc;
00032 using gul::pool_bytealloc;
00033 using std::basic_string;
00034
00035 #if !defined(__GNUC__)
00036 using std::char_traits;
00037 #else
00038 #if (__GNUC__ >= 3)
00039 using std::char_traits;
00040 #else
00041 using std::string_char_traits;
00042 #endif
00043 #endif
00044
00045 using std::map;
00046 using std::pair;
00047 using std::less;
00048 using std::deque;
00049 using std::stack;
00050 using std::basic_string;
00051
00052 #if !defined(__GNUC__)
00053 typedef basic_string<char,char_traits<char>,gul::poolalloc<char> > poolstring;
00054 #else
00055 #if (__GNUC__ >= 3)
00056 typedef basic_string<char,char_traits<char>,gul::poolalloc<char> > poolstring;
00057 #else
00058 typedef basic_string<char,string_char_traits<char>,gul::pool_bytealloc > poolstring;
00059 #endif
00060 #endif
00061
00062 template< class K, class T >
00063 class poolmap : public map< K, T, less<K>, poolalloc< pair<K,T> > >
00064 {
00065 };
00066
00067 template< class T >
00068 class pooldeque : public deque<T,poolalloc<T> >
00069 {
00070 };
00071
00072 template< class T >
00073 class poolstack : public stack<T,pooldeque<T> >
00074 {
00075 };
00076
00077
00078
00079
00080
00081
00082 class streambufrec : public pool_object
00083 {
00084 public:
00085 std::streambuf *cerr_buf;
00086 std::streambuf *cout_buf;
00087 streambufrec *next;
00088 streambufrec *prev;
00089 };
00090
00091 class debug_streambuf : public std::streambuf
00092 {
00093 public:
00094 int m_bptr;
00095 char m_buf[1024];
00096 FILE *m_logfile;
00097 streambufrec *m_oldsb;
00098 static bool initialized;
00099
00100 GULAPI debug_streambuf( FILE *logfile );
00101 GULAPI ~debug_streambuf();
00102
00103 static void atexit_func( void );
00104
00105 protected:
00106 int overflow( int c );
00107 };
00108
00109 }
00110
00111 #endif
00112