exception

Go to the documentation of this file.
00001 // Exception Handling support header for -*- C++ -*-
00002 
00003 // Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002
00004 // Free Software Foundation
00005 //
00006 // This file is part of GCC.
00007 //
00008 // GCC is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2, or (at your option)
00011 // any later version.
00012 // 
00013 // GCC is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 // 
00018 // You should have received a copy of the GNU General Public License
00019 // along with GCC; see the file COPYING.  If not, write to
00020 // the Free Software Foundation, 51 Franklin Street, Fifth Floor,
00021 // Boston, MA 02110-1301, USA.
00022 
00023 // As a special exception, you may use this file as part of a free software
00024 // library without restriction.  Specifically, if other files instantiate
00025 // templates or use macros or inline functions from this file, or you compile
00026 // this file and link it with other files to produce an executable, this
00027 // file does not by itself cause the resulting executable to be covered by
00028 // the GNU General Public License.  This exception does not however
00029 // invalidate any other reasons why the executable file might be covered by
00030 // the GNU General Public License.
00031 
00037 #ifndef __EXCEPTION__
00038 #define __EXCEPTION__
00039 
00040 #pragma GCC visibility push(default)
00041 
00042 extern "C++" {
00043 
00044 namespace std 
00045 {
00054   class exception 
00055   {
00056   public:
00057     exception() throw() { }
00058     virtual ~exception() throw();
00061     virtual const char* what() const throw();
00062   };
00063 
00066   class bad_exception : public exception 
00067   {
00068   public:
00069     bad_exception() throw() { }
00070     // This declaration is not useless:
00071     // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
00072     virtual ~bad_exception() throw();
00073   };
00074 
00076   typedef void (*terminate_handler) ();
00078   typedef void (*unexpected_handler) ();
00079 
00081   terminate_handler set_terminate(terminate_handler) throw();
00084   void terminate() __attribute__ ((__noreturn__));
00085 
00087   unexpected_handler set_unexpected(unexpected_handler) throw();
00090   void unexpected() __attribute__ ((__noreturn__));
00091 
00102   bool uncaught_exception() throw();
00103 } // namespace std
00104 
00105 namespace __gnu_cxx
00106 {
00117   void __verbose_terminate_handler ();
00118 } // namespace __gnu_cxx
00119   
00120 } // extern "C++"
00121 
00122 #pragma GCC visibility pop
00123 
00124 #endif

Generated on Tue Feb 2 16:55:56 2010 for GNU C++ STL by  doxygen 1.4.7