exception_ptr.h
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 class type_info;
00048
00049
00050
00051
00052
00053
00054
00055 namespace __exception_ptr
00056 {
00057
00058
00059
00060 class exception_ptr;
00061 }
00062
00063 using __exception_ptr::exception_ptr;
00064
00065
00066
00067
00068
00069 exception_ptr current_exception() throw();
00070
00071
00072 void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
00073
00074
00075 template<typename _Ex>
00076 exception_ptr
00077 copy_exception(_Ex __ex) throw();
00078
00079 namespace __exception_ptr
00080 {
00081 bool
00082 operator==(const exception_ptr&, const exception_ptr&) throw();
00083
00084 bool
00085 operator!=(const exception_ptr&, const exception_ptr&) throw();
00086
00087 class exception_ptr
00088 {
00089 void* _M_exception_object;
00090
00091 explicit exception_ptr(void* __e) throw();
00092
00093 void _M_addref() throw();
00094 void _M_release() throw();
00095
00096 void *_M_get() const throw();
00097
00098 void _M_safe_bool_dummy();
00099
00100 friend exception_ptr std::current_exception() throw();
00101 friend void std::rethrow_exception(exception_ptr);
00102
00103 public:
00104 exception_ptr() throw();
00105
00106 typedef void (exception_ptr::*__safe_bool)();
00107
00108
00109 exception_ptr(__safe_bool) throw();
00110
00111 exception_ptr(const exception_ptr&) throw();
00112
00113 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00114 exception_ptr(exception_ptr&& __o) throw()
00115 : _M_exception_object(__o._M_exception_object)
00116 { __o._M_exception_object = 0; }
00117 #endif
00118
00119 exception_ptr&
00120 operator=(const exception_ptr&) throw();
00121
00122 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00123 exception_ptr&
00124 operator=(exception_ptr&& __o) throw()
00125 {
00126 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
00127 return *this;
00128 }
00129 #endif
00130
00131 ~exception_ptr() throw();
00132
00133 void
00134 swap(exception_ptr&) throw();
00135
00136 #ifdef _GLIBCXX_EH_PTR_COMPAT
00137
00138 bool operator!() const throw();
00139 operator __safe_bool() const throw();
00140 #endif
00141
00142 friend bool
00143 operator==(const exception_ptr&, const exception_ptr&) throw();
00144
00145 const class std::type_info*
00146 __cxa_exception_type() const throw();
00147 };
00148
00149 }
00150
00151
00152 template<typename _Ex>
00153 exception_ptr
00154 copy_exception(_Ex __ex) throw()
00155 {
00156 __try
00157 {
00158 throw __ex;
00159 }
00160 __catch(...)
00161 {
00162 return current_exception ();
00163 }
00164 }
00165
00166
00167 }
00168
00169 }
00170
00171 #pragma GCC visibility pop
00172
00173 #endif