Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef BOOST_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP_INCLUDED
00006 #define BOOST_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP_INCLUDED
00007
00014 #define NUMPY_OBJECT_MANAGER_TRAITS(manager) \
00015 template <> \
00016 struct object_manager_traits<manager> \
00017 { \
00018 BOOST_STATIC_CONSTANT(bool, is_specialized = true); \
00019 static inline python::detail::new_reference adopt(PyObject* x) \
00020 { \
00021 return python::detail::new_reference(python::pytype_check((PyTypeObject*)get_pytype(), x)); \
00022 } \
00023 static bool check(PyObject* x) \
00024 { \
00025 return ::PyObject_IsInstance(x, (PyObject*)get_pytype()); \
00026 } \
00027 static manager* checked_downcast(PyObject* x) \
00028 { \
00029 return python::downcast<manager>((checked_downcast_impl)(x, (PyTypeObject*)get_pytype())); \
00030 } \
00031 static PyTypeObject const * get_pytype(); \
00032 }
00033
00034 #endif // !BOOST_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP_INCLUDED
00035