• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright Jim Bosch 2010-2012.
2 // Copyright Stefan Seefeld 2016.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #define BOOST_PYTHON_NUMPY_INTERNAL
8 #include <boost/python/numpy/internal.hpp>
9 
10 namespace boost { namespace python {
11 namespace converter
12 {
13 NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyVoidArrType_Type, numpy::void_)
14 } // namespace boost::python::converter
15 
16 namespace numpy
17 {
18 
void_(Py_ssize_t size)19 void_::void_(Py_ssize_t size)
20   : object(python::detail::new_reference
21       (PyObject_CallFunction((PyObject*)&PyVoidArrType_Type, const_cast<char*>("i"), size)))
22 {}
23 
view(dtype const & dt) const24 void_ void_::view(dtype const & dt) const
25 {
26   return void_(python::detail::new_reference
27     (PyObject_CallMethod(this->ptr(), const_cast<char*>("view"), const_cast<char*>("O"), dt.ptr())));
28 }
29 
copy() const30 void_ void_::copy() const
31 {
32   return void_(python::detail::new_reference
33     (PyObject_CallMethod(this->ptr(), const_cast<char*>("copy"), const_cast<char*>(""))));
34 }
35 
36 }}} // namespace boost::python::numpy
37