Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _EXCEPTION_PTR_H
00032 #define _EXCEPTION_PTR_H
00033
00034 #pragma GCC visibility push(default)
00035
00036 #include <bits/c++config.h>
00037 #include <exception_defines.h>
00038
00039 #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
00040 # error This platform does not support exception propagation.
00041 #endif
00042
00043 extern "C++" {
00044
00045 namespace std
00046 {
00047
00048
00049
00050
00051 namespace __exception_ptr
00052 {
00053 class exception_ptr;
00054 }
00055
00056 using __exception_ptr::exception_ptr;
00057
00058
00059
00060
00061
00062 exception_ptr current_exception() throw();
00063
00064
00065 void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
00066
00067 namespace __exception_ptr
00068 {
00069
00070
00071
00072
00073 class exception_ptr
00074 {
00075 void* _M_exception_object;
00076
00077 explicit exception_ptr(void* __e) throw();
00078
00079 void _M_addref() throw();
00080 void _M_release() throw();
00081
00082 void *_M_get() const throw() __attribute__ ((__pure__));
00083
00084 void _M_safe_bool_dummy() throw() __attribute__ ((__const__));
00085
00086 friend exception_ptr std::current_exception() throw();
00087 friend void std::rethrow_exception(exception_ptr);
00088
00089 public:
00090 exception_ptr() throw();
00091
00092 typedef void (exception_ptr::*__safe_bool)();
00093
00094
00095 exception_ptr(__safe_bool) throw();
00096
00097 exception_ptr(const exception_ptr&) throw();
00098
00099 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00100 exception_ptr(exception_ptr&& __o) throw()
00101 : _M_exception_object(__o._M_exception_object)
00102 { __o._M_exception_object = 0; }
00103 #endif
00104
00105 exception_ptr&
00106 operator=(const exception_ptr&) throw();
00107
00108 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00109 exception_ptr&
00110 operator=(exception_ptr&& __o) throw()
00111 {
00112 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
00113 return *this;
00114 }
00115 #endif
00116
00117 ~exception_ptr() throw();
00118
00119 void
00120 swap(exception_ptr&) throw();
00121
00122 #ifdef _GLIBCXX_EH_PTR_COMPAT
00123
00124 bool operator!() const throw() __attribute__ ((__pure__));
00125 operator __safe_bool() const throw();
00126 #endif
00127
00128 friend bool
00129 operator==(const exception_ptr&, const exception_ptr&) throw()
00130 __attribute__ ((__pure__));
00131
00132 const type_info*
00133 __cxa_exception_type() const throw() __attribute__ ((__pure__));
00134 };
00135
00136 bool
00137 operator==(const exception_ptr&, const exception_ptr&) throw()
00138 __attribute__ ((__pure__));
00139
00140 bool
00141 operator!=(const exception_ptr&, const exception_ptr&) throw()
00142 __attribute__ ((__pure__));
00143 }
00144
00145
00146
00147 template<typename _Ex>
00148 exception_ptr
00149 copy_exception(_Ex __ex) throw()
00150 {
00151 __try
00152 {
00153 #ifdef __EXCEPTIONS
00154 throw __ex;
00155 #endif
00156 }
00157 __catch(...)
00158 {
00159 return current_exception();
00160 }
00161 }
00162
00163
00164 }
00165
00166 }
00167
00168 #pragma GCC visibility pop
00169
00170 #endif