Rev | Line | |
---|
[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 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 |
|
---|
| 14 | namespace boost { namespace python {
|
---|
| 15 |
|
---|
| 16 | template <class T, class Conversion>
|
---|
| 17 | struct to_python_converter
|
---|
| 18 | {
|
---|
| 19 | to_python_converter();
|
---|
| 20 | };
|
---|
| 21 |
|
---|
| 22 | //
|
---|
| 23 | // implementation
|
---|
| 24 | //
|
---|
| 25 |
|
---|
| 26 | template <class T, class Conversion>
|
---|
| 27 | to_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.