Skip to content

Commit 8e13b1c

Browse files
committed
Revert "only register pointer to python conversion once (ref mapnik#104)"
This reverts commit 57941cc.
1 parent b80071b commit 8e13b1c

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/mapnik_datasource.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ void export_datasource()
180180
.value("Collection",mapnik::datasource_geometry_t::Collection)
181181
;
182182

183-
class_<datasource,
184-
boost::noncopyable>("Datasource",no_init)
183+
class_<datasource,std::shared_ptr<datasource>,
184+
boost::noncopyable>("Datasource",no_init)
185185
.def("type",&datasource::type)
186186
.def("geometry_type",&datasource::get_geometry_type)
187187
.def("describe",&describe)
@@ -195,7 +195,6 @@ void export_datasource()
195195
"These vary depending on the type of data source.")
196196
.def(self == self)
197197
;
198-
199198
register_ptr_to_python<std::shared_ptr<datasource> >();
200199

201200
def("CreateDatasource",&create_datasource);

src/mapnik_feature.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ void export_feature()
211211
.def("push", &context_type::push)
212212
;
213213

214-
class_<mapnik::feature_impl, boost::noncopyable>("Feature",init<context_ptr,mapnik::value_integer>("Default ctor."))
214+
class_<mapnik::feature_impl,std::shared_ptr<mapnik::feature_impl>,
215+
boost::noncopyable>("Feature",init<context_ptr,mapnik::value_integer>("Default ctor."))
215216
.def("id",&mapnik::feature_impl::id)
216217
.add_property("geometry",
217218
make_function(&mapnik::feature_impl::get_geometry,return_value_policy<reference_existing_object>()),

src/mapnik_featureset.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void export_featureset()
5656
{
5757
using namespace boost::python;
5858
// Featureset implements Python iterator interface
59-
class_<mapnik::Featureset, boost::noncopyable>("Featureset", no_init)
59+
class_<mapnik::Featureset, std::shared_ptr<mapnik::Featureset>,
60+
boost::noncopyable>("Featureset", no_init)
6061
.def("__iter__", pass_through)
6162
.def("__next__", next)
6263
// Python2 support

src/mapnik_geometry.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void export_geometry()
259259
.def("to_wkt",&to_wkt_impl)
260260
;
261261

262-
class_<geometry<double>, boost::noncopyable>("Geometry",no_init)
262+
class_<geometry<double>, std::shared_ptr<geometry<double> >, boost::noncopyable>("Geometry",no_init)
263263
.def("envelope",&geometry_envelope_impl)
264264
.def("from_geojson", from_geojson_impl)
265265
.def("from_wkt", from_wkt_impl)
@@ -282,6 +282,5 @@ void export_geometry()
282282
//.def("to_svg",&to_svg)
283283
// TODO add other geometry_type methods
284284
;
285-
286285
register_ptr_to_python<std::shared_ptr<geometry<double>> >();
287286
}

src/mapnik_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ void export_image()
389389
.value("gray64f", mapnik::image_dtype_gray64f)
390390
;
391391

392-
class_<image_any, boost::noncopyable >("Image","This class represents a image.",init<int,int>())
392+
class_<image_any,std::shared_ptr<image_any>, boost::noncopyable >("Image","This class represents a image.",init<int,int>())
393393
.def(init<int,int,mapnik::image_dtype>())
394394
.def(init<int,int,mapnik::image_dtype,bool>())
395395
.def(init<int,int,mapnik::image_dtype,bool,bool>())

0 commit comments

Comments
 (0)