File indexing completed on 2025-01-18 09:50:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ERRORS_DWA052500_H_
0010 # define ERRORS_DWA052500_H_
0011
0012 # include <boost/python/detail/prefix.hpp>
0013 # include <boost/function/function0.hpp>
0014
0015 namespace boost { namespace python {
0016
0017 struct BOOST_PYTHON_DECL error_already_set
0018 {
0019 virtual ~error_already_set();
0020 };
0021
0022
0023
0024 BOOST_PYTHON_DECL bool handle_exception_impl(function0<void>);
0025
0026 template <class T>
0027 bool handle_exception(T f)
0028 {
0029 return handle_exception_impl(function0<void>(boost::ref(f)));
0030 }
0031
0032 namespace detail { inline void rethrow() { throw; } }
0033
0034 inline void handle_exception()
0035 {
0036 handle_exception(detail::rethrow);
0037 }
0038
0039 BOOST_PYTHON_DECL void throw_error_already_set();
0040
0041 template <class T>
0042 inline T* expect_non_null(T* x)
0043 {
0044 if (x == 0)
0045 throw_error_already_set();
0046 return x;
0047 }
0048
0049
0050
0051 BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* pytype, PyObject* source);
0052
0053 }}
0054
0055 #endif