File indexing completed on 2025-01-18 09:50:38
0001
0002
0003
0004
0005 #ifndef EXCEPTION_HANDLER_DWA2002810_HPP
0006 # define EXCEPTION_HANDLER_DWA2002810_HPP
0007
0008 # include <boost/python/detail/config.hpp>
0009 # include <boost/function/function0.hpp>
0010 # include <boost/function/function2.hpp>
0011
0012 namespace boost { namespace python { namespace detail {
0013
0014 struct exception_handler;
0015
0016 typedef function2<bool, exception_handler const&, function0<void> const&> handler_function;
0017
0018 struct BOOST_PYTHON_DECL exception_handler
0019 {
0020 private:
0021
0022 public:
0023 explicit exception_handler(handler_function const& impl);
0024
0025 inline bool handle(function0<void> const& f) const;
0026
0027 bool operator()(function0<void> const& f) const;
0028
0029 static exception_handler* chain;
0030
0031 private:
0032 static exception_handler* tail;
0033
0034 handler_function m_impl;
0035 exception_handler* m_next;
0036 };
0037
0038
0039 inline bool exception_handler::handle(function0<void> const& f) const
0040 {
0041 return this->m_impl(*this, f);
0042 }
0043
0044 BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f);
0045
0046 }}}
0047
0048 #endif