File indexing completed on 2025-01-18 09:50:37
0001
0002
0003
0004
0005 #ifndef REGISTRATIONS_DWA2002223_HPP
0006 # define REGISTRATIONS_DWA2002223_HPP
0007
0008 # include <boost/python/detail/prefix.hpp>
0009
0010 # include <boost/python/type_id.hpp>
0011
0012 # include <boost/python/converter/convertible_function.hpp>
0013 # include <boost/python/converter/constructor_function.hpp>
0014 # include <boost/python/converter/to_python_function_type.hpp>
0015
0016 # include <boost/detail/workaround.hpp>
0017
0018 namespace boost { namespace python { namespace converter {
0019
0020 struct lvalue_from_python_chain
0021 {
0022 convertible_function convert;
0023 lvalue_from_python_chain* next;
0024 };
0025
0026 struct rvalue_from_python_chain
0027 {
0028 convertible_function convertible;
0029 constructor_function construct;
0030 PyTypeObject const* (*expected_pytype)();
0031 rvalue_from_python_chain* next;
0032 };
0033
0034 struct BOOST_PYTHON_DECL registration
0035 {
0036 public:
0037 explicit registration(type_info target, bool is_shared_ptr = false);
0038 ~registration();
0039
0040
0041 PyObject* to_python(void const volatile*) const;
0042
0043
0044
0045 PyTypeObject* get_class_object() const;
0046
0047
0048
0049 PyTypeObject const* expected_from_python_type() const;
0050 PyTypeObject const* to_python_target_type() const;
0051
0052 public:
0053 const python::type_info target_type;
0054
0055
0056 lvalue_from_python_chain* lvalue_chain;
0057
0058
0059 rvalue_from_python_chain* rvalue_chain;
0060
0061
0062 PyTypeObject* m_class_object;
0063
0064
0065 to_python_function_t m_to_python;
0066 PyTypeObject const* (*m_to_python_target_type)();
0067
0068
0069
0070
0071 const bool is_shared_ptr;
0072
0073 # if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
0074 private:
0075 void operator=(registration);
0076 # endif
0077 };
0078
0079
0080
0081
0082 inline registration::registration(type_info target_type, bool is_shared_ptr)
0083 : target_type(target_type)
0084 , lvalue_chain(0)
0085 , rvalue_chain(0)
0086 , m_class_object(0)
0087 , m_to_python(0)
0088 , m_to_python_target_type(0)
0089 , is_shared_ptr(is_shared_ptr)
0090 {}
0091
0092 inline bool operator<(registration const& lhs, registration const& rhs)
0093 {
0094 return lhs.target_type < rhs.target_type;
0095 }
0096
0097 }}}
0098
0099 #endif