Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/python/to_python_converter.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 988 bytes
Line 
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 TO_PYTHON_CONVERTER_DWA200221_HPP
6# define TO_PYTHON_CONVERTER_DWA200221_HPP
7
8# include <boost/python/detail/prefix.hpp>
9
10# include <boost/python/converter/registry.hpp>
11# include <boost/python/converter/as_to_python_function.hpp>
12# include <boost/python/type_id.hpp>
13
14namespace boost { namespace python { 
15
16template <class T, class Conversion>
17struct to_python_converter
18{
19    to_python_converter();
20};
21
22//
23// implementation
24//
25
26template <class T, class Conversion>
27to_python_converter<T,Conversion>::to_python_converter()
28{
29    typedef converter::as_to_python_function<
30        T, Conversion
31        > normalized;
32       
33    converter::registry::insert(
34        &normalized::convert
35        , type_id<T>());
36}
37
38}} // namespace boost::python
39
40#endif // TO_PYTHON_CONVERTER_DWA200221_HPP
Note: See TracBrowser for help on using the repository browser.