From a3c329a6f82d72152e0cc3c7b33027fce90c6d3e Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 1 Oct 2013 14:44:54 +0100 Subject: [PATCH] == Boost.Python std::shared_ptr == + ensure mapnik::memory_datasource is wrapped in std::shared_ptr in Python bindings + register implicit conversion from std::shared_ptr to std::shared_pre ref #2020 --- bindings/python/mapnik_datasource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp index 4ed1032d0..0fbd59438 100644 --- a/bindings/python/mapnik_datasource.cpp +++ b/bindings/python/mapnik_datasource.cpp @@ -190,7 +190,9 @@ void export_datasource() def("CreateDatasource",&create_datasource); - class_, boost::noncopyable>("MemoryDatasource", init<>()) + class_, std::shared_ptr, + boost::noncopyable>("MemoryDatasource", init<>()) .def("add_feature",&memory_datasource::push, "Adds a Feature:\n" ">>> ms = MemoryDatasource()\n" @@ -198,4 +200,6 @@ void export_datasource() ">>> ms.add_feature(Feature(1))\n") .def("num_features",&memory_datasource::size) ; + + implicitly_convertible,std::shared_ptr >(); }