Skip to content

Commit 57941cc

Browse files
committed
only register pointer to python conversion once (ref #104)
1 parent 0c8f07c commit 57941cc

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/mapnik_datasource.cpp

Lines changed: 3 additions & 2 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,std::shared_ptr<datasource>,
184-
boost::noncopyable>("Datasource",no_init)
183+
class_<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,6 +195,7 @@ void export_datasource()
195195
"These vary depending on the type of data source.")
196196
.def(self == self)
197197
;
198+
198199
register_ptr_to_python<std::shared_ptr<datasource> >();
199200

200201
def("CreateDatasource",&create_datasource);

src/mapnik_feature.cpp

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

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

src/mapnik_featureset.cpp

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

src/mapnik_geometry.cpp

Lines changed: 2 additions & 1 deletion
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>, std::shared_ptr<geometry<double> >, boost::noncopyable>("Geometry",no_init)
262+
class_<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,5 +282,6 @@ void export_geometry()
282282
//.def("to_svg",&to_svg)
283283
// TODO add other geometry_type methods
284284
;
285+
285286
register_ptr_to_python<std::shared_ptr<geometry<double>> >();
286287
}

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,std::shared_ptr<image_any>, boost::noncopyable >("Image","This class represents a image.",init<int,int>())
392+
class_<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)