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