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 REGISTERED_POINTEE_DWA2002710_HPP
|
---|
6 | # define REGISTERED_POINTEE_DWA2002710_HPP
|
---|
7 | # include <boost/python/converter/registered.hpp>
|
---|
8 | # include <boost/python/converter/pointer_type_id.hpp>
|
---|
9 | # include <boost/python/converter/registry.hpp>
|
---|
10 | # include <boost/type_traits/transform_traits.hpp>
|
---|
11 | # include <boost/type_traits/cv_traits.hpp>
|
---|
12 |
|
---|
13 | namespace boost { namespace python { namespace converter {
|
---|
14 |
|
---|
15 | struct registration;
|
---|
16 |
|
---|
17 | # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
---|
18 | template <class T>
|
---|
19 | struct registered_pointee
|
---|
20 | : registered<
|
---|
21 | typename remove_pointer<
|
---|
22 | typename remove_cv<
|
---|
23 | typename remove_reference<T>::type
|
---|
24 | >::type
|
---|
25 | >::type
|
---|
26 | >
|
---|
27 | {
|
---|
28 | };
|
---|
29 | # else
|
---|
30 | namespace detail
|
---|
31 | {
|
---|
32 | template <class T>
|
---|
33 | struct registered_pointee_base
|
---|
34 | {
|
---|
35 | static registration const& converters;
|
---|
36 | };
|
---|
37 | }
|
---|
38 |
|
---|
39 | template <class T>
|
---|
40 | struct registered_pointee
|
---|
41 | : detail::registered_pointee_base<
|
---|
42 | typename add_reference<
|
---|
43 | typename add_cv<T>::type
|
---|
44 | >::type
|
---|
45 | >
|
---|
46 | {
|
---|
47 | };
|
---|
48 |
|
---|
49 | //
|
---|
50 | // implementations
|
---|
51 | //
|
---|
52 | namespace detail
|
---|
53 | {
|
---|
54 | template <class T>
|
---|
55 | registration const& registered_pointee_base<T>::converters
|
---|
56 | = registry::lookup(pointer_type_id<T>());
|
---|
57 | }
|
---|
58 |
|
---|
59 | # endif
|
---|
60 | }}} // namespace boost::python::converter
|
---|
61 |
|
---|
62 | #endif // REGISTERED_POINTEE_DWA2002710_HPP
|
---|
Note: See
TracBrowser
for help on using the repository browser.