Add register_ptr_to_python to PersistenceDiagram bindings to match changes in Boost.Python dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Mon, 22 Aug 2016 11:17:45 -0700
branchdev
changeset 283 453eedc14be0
parent 282 c54290544583
child 284 67644b9c7668
Add register_ptr_to_python to PersistenceDiagram bindings to match changes in Boost.Python
bindings/python/persistence-diagram.cpp
--- a/bindings/python/persistence-diagram.cpp	Mon Oct 05 09:02:38 2015 -0700
+++ b/bindings/python/persistence-diagram.cpp	Mon Aug 22 11:17:45 2016 -0700
@@ -13,6 +13,7 @@
 #include<boost/shared_ptr.hpp>
 #include<boost/python/stl_iterator.hpp>
 #include<boost/python/def.hpp>
+#include<boost/python/register_ptr_to_python.hpp>
 namespace bp = boost::python;
 
 
@@ -210,6 +211,7 @@
         .def("__iter__",            bp::range(&dp::PersistenceDiagramD::begin, &dp::PersistenceDiagramD::end))
         .def("__len__",             &dp::PersistenceDiagramD::size)
     ;
+    bp::register_ptr_to_python<dp::PDgmPtr>();
 
     bp::def("init_diagrams",        &InitDiagrams<dp::SPersistence>::init,
                                      (bp::arg("persistence"),