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

gul_std.h

Go to the documentation of this file.
00001 /* LIBGUL - Geometry Utility Library
00002  * Copyright (C) 1998-1999 Norbert Irmer
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
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   class for redirecting cout/cerr to a debugger window and/or stream.
00079   this class registers an 'atexit' function to restore the original
00080   'streambufs'  
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 

Generated on Mon Jan 21 04:17:32 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001