source: NonGTP/Boost/boost/python/exception_translator.hpp @ 857

Revision 857, 919 bytes checked in by igarcia, 19 years ago (diff)
RevLine 
[857]1// Copyright David Abrahams 2002.
2// Distributed under the Boost Software License, Version 1.0. (See
3// accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5#ifndef EXCEPTION_TRANSLATOR_DWA2002810_HPP
6# define EXCEPTION_TRANSLATOR_DWA2002810_HPP
7
8# include <boost/python/detail/prefix.hpp>
9
10# include <boost/bind.hpp>
11# include <boost/type.hpp>
12# include <boost/python/detail/translate_exception.hpp>
13# include <boost/python/detail/exception_handler.hpp>
14
15namespace boost { namespace python {
16
17template <class ExceptionType, class Translate>
18void register_exception_translator(Translate translate, boost::type<ExceptionType>* = 0)
19{
20    detail::register_exception_handler(
21        bind<bool>(detail::translate_exception<ExceptionType,Translate>(), _1, _2, translate)
22        );
23}
24
25}} // namespace boost::python
26
27#endif // EXCEPTION_TRANSLATOR_DWA2002810_HPP
Note: See TracBrowser for help on using the repository browser.