File indexing completed on 2025-01-18 09:50:37
0001
0002
0003
0004
0005 #ifndef PYOBJECT_TRAITS_DWA2002720_HPP
0006 # define PYOBJECT_TRAITS_DWA2002720_HPP
0007
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/python/converter/pyobject_type.hpp>
0010
0011 namespace boost { namespace python { namespace converter {
0012
0013 template <class> struct pyobject_traits;
0014
0015 template <>
0016 struct pyobject_traits<PyObject>
0017 {
0018
0019 static bool check(PyObject*) { return true; }
0020 static PyObject* checked_downcast(PyObject* x) { return x; }
0021 #ifndef BOOST_PYTHON_NO_PY_SIGNATURES
0022 static PyTypeObject const* get_pytype() { return 0; }
0023 #endif
0024 };
0025
0026
0027
0028
0029
0030 # define BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(T) \
0031 template <> struct pyobject_traits<Py##T##Object> \
0032 : pyobject_type<Py##T##Object, &Py##T##_Type> {}
0033
0034
0035 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Type);
0036 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(List);
0037 #if PY_VERSION_HEX < 0x03000000
0038 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Int);
0039 #endif
0040 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Long);
0041 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Dict);
0042 BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Tuple);
0043
0044 }}}
0045
0046 #endif