use const std::unique_ptr<> instead of boost::scoped_ptr<>

This commit is contained in:
artemp 2013-09-20 14:22:58 +01:00
parent 62af2e6765
commit 09ce29489e
31 changed files with 60 additions and 60 deletions

View file

@ -29,7 +29,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <memory> #include <memory>
#include <boost/scoped_ptr.hpp>
#ifndef Q_MOC_RUN #ifndef Q_MOC_RUN
#include <mapnik/map.hpp> #include <mapnik/map.hpp>

View file

@ -26,7 +26,7 @@
// boost // boost
#include <boost/concept_check.hpp> #include <boost/concept_check.hpp>
#include <boost/scoped_ptr.hpp>
// qt // qt
#include <QList> #include <QList>
#include <QIcon> #include <QIcon>
@ -114,7 +114,7 @@ public:
} }
private: private:
boost::scoped_ptr<node_base> impl_; const std::unique_ptr<node_base> impl_;
QList<node*> children_; QList<node*> children_;
node * parent_; node * parent_;
}; };

View file

@ -27,7 +27,7 @@
#include <mapnik/map.hpp> #include <mapnik/map.hpp>
#endif #endif
#include <boost/scoped_ptr.hpp>
class node; class node;
class StyleModel : public QAbstractItemModel class StyleModel : public QAbstractItemModel
@ -44,7 +44,7 @@ class StyleModel : public QAbstractItemModel
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
private: private:
//std::shared_ptr<mapnik::Map> map_; //std::shared_ptr<mapnik::Map> map_;
boost::scoped_ptr<node> root_; const std::unique_ptr<node> root_;
}; };
#endif // STYLE_MODEL_HPP #endif // STYLE_MODEL_HPP

View file

@ -37,7 +37,7 @@
#include <mapnik/request.hpp> #include <mapnik/request.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
// fwd declaration to avoid depedence on agg headers // fwd declaration to avoid depedence on agg headers
@ -157,7 +157,7 @@ private:
freetype_engine font_engine_; freetype_engine font_engine_;
face_manager<freetype_engine> font_manager_; face_manager<freetype_engine> font_manager_;
std::shared_ptr<label_collision_detector4> detector_; std::shared_ptr<label_collision_detector4> detector_;
boost::scoped_ptr<rasterizer> ras_ptr; const std::unique_ptr<rasterizer> ras_ptr;
box2d<double> query_extent_; box2d<double> query_extent_;
gamma_method_e gamma_method_; gamma_method_e gamma_method_;
double gamma_; double gamma_;

View file

@ -41,7 +41,7 @@
#include <cairo.h> #include <cairo.h>
// boost // boost
#include <boost/scoped_ptr.hpp>
namespace agg { namespace agg {
struct trans_affine; struct trans_affine;

View file

@ -37,7 +37,7 @@
#include <mapnik/pixel_position.hpp> #include <mapnik/pixel_position.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
// fwd declaration to avoid depedence on agg headers // fwd declaration to avoid depedence on agg headers
@ -136,7 +136,7 @@ private:
freetype_engine font_engine_; freetype_engine font_engine_;
face_manager<freetype_engine> font_manager_; face_manager<freetype_engine> font_manager_;
std::shared_ptr<label_collision_detector4> detector_; std::shared_ptr<label_collision_detector4> detector_;
boost::scoped_ptr<grid_rasterizer> ras_ptr; const std::unique_ptr<grid_rasterizer> ras_ptr;
box2d<double> query_extent_; box2d<double> query_extent_;
void setup(Map const& m); void setup(Map const& m);
}; };

View file

@ -33,7 +33,7 @@
#if BOOST_VERSION >= 104600 #if BOOST_VERSION >= 104600
#include <boost/range/algorithm.hpp> #include <boost/range/algorithm.hpp>
#endif #endif
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <vector> #include <vector>
@ -124,7 +124,7 @@ class hextree : private mapnik::noncopyable
unsigned colors_; unsigned colors_;
// flag indicating existance of invisible pixels (a < InsertPolicy::MIN_ALPHA) // flag indicating existance of invisible pixels (a < InsertPolicy::MIN_ALPHA)
bool has_holes_; bool has_holes_;
boost::scoped_ptr<node> root_; const std::unique_ptr<node> root_;
// working palette for quantization, sorted on mean(r,g,b,a) for easier searching NN // working palette for quantization, sorted on mean(r,g,b,a) for easier searching NN
std::vector<rgba> sorted_pal_; std::vector<rgba> sorted_pal_;
// index remaping of sorted_pal_ indexes to indexes of returned image palette // index remaping of sorted_pal_ indexes to indexes of returned image palette

View file

@ -30,7 +30,7 @@
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <vector> #include <vector>
@ -49,7 +49,7 @@ public:
~feature_collection_parser(); ~feature_collection_parser();
bool parse(iterator_type first, iterator_type last, std::vector<mapnik::feature_ptr> & features); bool parse(iterator_type first, iterator_type last, std::vector<mapnik::feature_ptr> & features);
private: private:
boost::scoped_ptr<feature_collection_grammar<iterator_type,feature_type> > grammar_; const std::unique_ptr<feature_collection_grammar<iterator_type,feature_type> > grammar_;
}; };
}} }}

View file

@ -30,7 +30,7 @@
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <vector> #include <vector>
@ -49,7 +49,7 @@ public:
~feature_parser(); ~feature_parser();
bool parse(iterator_type first, iterator_type last, mapnik::feature_impl & f); bool parse(iterator_type first, iterator_type last, mapnik::feature_impl & f);
private: private:
boost::scoped_ptr<feature_grammar<iterator_type,feature_type> > grammar_; const std::unique_ptr<feature_grammar<iterator_type,feature_type> > grammar_;
}; };
}} }}

View file

@ -27,7 +27,7 @@
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include <mapnik/noncopyable.hpp> #include <mapnik/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <string> #include <string>
#include <iterator> #include <iterator>
@ -46,7 +46,7 @@ public:
~feature_generator(); ~feature_generator();
bool generate(std::string & geojson, mapnik::feature_impl const& f); bool generate(std::string & geojson, mapnik::feature_impl const& f);
private: private:
boost::scoped_ptr<feature_generator_grammar<sink_type> > grammar_; const std::unique_ptr<feature_generator_grammar<sink_type> > grammar_;
}; };
class MAPNIK_DECL geometry_generator : private mapnik::noncopyable class MAPNIK_DECL geometry_generator : private mapnik::noncopyable
@ -57,7 +57,7 @@ public:
~geometry_generator(); ~geometry_generator();
bool generate(std::string & geojson, mapnik::geometry_container const& g); bool generate(std::string & geojson, mapnik::geometry_container const& g);
private: private:
boost::scoped_ptr<multi_geometry_generator_grammar<sink_type> > grammar_; const std::unique_ptr<multi_geometry_generator_grammar<sink_type> > grammar_;
}; };
#else #else

View file

@ -29,7 +29,7 @@
#include <mapnik/noncopyable.hpp> #include <mapnik/noncopyable.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// stl // stl
//#include <vector> //#include <vector>
@ -49,7 +49,7 @@ public:
~geometry_parser(); ~geometry_parser();
bool parse(iterator_type first, iterator_type last, boost::ptr_vector<mapnik::geometry_type>&); bool parse(iterator_type first, iterator_type last, boost::ptr_vector<mapnik::geometry_type>&);
private: private:
boost::scoped_ptr<geometry_grammar<iterator_type> > grammar_; const std::unique_ptr<geometry_grammar<iterator_type> > grammar_;
}; };
}} }}

View file

@ -40,7 +40,7 @@
// boost // boost
#include <boost/variant/static_visitor.hpp> #include <boost/variant/static_visitor.hpp>
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
// stl // stl

View file

@ -30,7 +30,7 @@
#include <mapnik/processed_text.hpp> #include <mapnik/processed_text.hpp>
//boost //boost
#include <boost/scoped_ptr.hpp>
// agg // agg
#include "agg_trans_affine.h" #include "agg_trans_affine.h"
@ -112,7 +112,7 @@ protected:
bool points_on_line_; bool points_on_line_;
text_placement_info_ptr placement_; text_placement_info_ptr placement_;
boost::scoped_ptr<placement_finder<DetectorT> > finder_; std::unique_ptr<placement_finder<DetectorT> > finder_;
}; };
template <typename FaceManagerT, typename DetectorT> template <typename FaceManagerT, typename DetectorT>

View file

@ -31,7 +31,7 @@
// boost // boost
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/version.hpp> #include <boost/version.hpp>
// stl // stl
@ -50,7 +50,7 @@ public:
wkt_parser(); wkt_parser();
bool parse(std::string const& wkt, boost::ptr_vector<geometry_type> & paths); bool parse(std::string const& wkt, boost::ptr_vector<geometry_type> & paths);
private: private:
boost::scoped_ptr<mapnik::wkt::wkt_collection_grammar<iterator_type> > grammar_; const std::unique_ptr<mapnik::wkt::wkt_collection_grammar<iterator_type> > grammar_;
}; };
#endif #endif

View file

@ -122,7 +122,7 @@ feature_ptr occi_featureset::next()
} }
else else
{ {
boost::scoped_ptr<SDOGeometry> geom(dynamic_cast<SDOGeometry*>(rs_->getObject(1))); const std::unique_ptr<SDOGeometry> geom(dynamic_cast<SDOGeometry*>(rs_->getObject(1)));
if (geom.get()) if (geom.get())
{ {
convert_geometry(geom.get(), feature); convert_geometry(geom.get(), feature);

View file

@ -30,7 +30,7 @@
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
// oci // oci
@ -70,7 +70,7 @@ private:
occi_connection_ptr conn_; occi_connection_ptr conn_;
oracle::occi::ResultSet* rs_; oracle::occi::ResultSet* rs_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
mapnik::value_integer feature_id_; mapnik::value_integer feature_id_;
mapnik::context_ptr ctx_; mapnik::context_ptr ctx_;
bool use_wkb_; bool use_wkb_;

View file

@ -30,7 +30,7 @@
#include <mapnik/geom_util.hpp> #include <mapnik/geom_util.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// ogr // ogr
#include <ogrsf_frmts.h> #include <ogrsf_frmts.h>
@ -54,7 +54,7 @@ private:
mapnik::context_ptr ctx_; mapnik::context_ptr ctx_;
OGRLayer& layer_; OGRLayer& layer_;
OGRFeatureDefn* layerdef_; OGRFeatureDefn* layerdef_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
const char* fidcolumn_; const char* fidcolumn_;
mutable int count_; mutable int count_;
}; };

View file

@ -25,7 +25,7 @@
#include <set> #include <set>
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp>
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include "ogr_featureset.hpp" #include "ogr_featureset.hpp"
@ -48,7 +48,7 @@ private:
filterT filter_; filterT filter_;
std::vector<int> ids_; std::vector<int> ids_;
std::vector<int>::iterator itr_; std::vector<int>::iterator itr_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
const char* fidcolumn_; const char* fidcolumn_;
OGREnvelope feature_envelope_; OGREnvelope feature_envelope_;
}; };

View file

@ -27,7 +27,7 @@
#include <set> #include <set>
// boost // boost
#include <boost/scoped_ptr.hpp>
// mapnik // mapnik
#include <mapnik/geom_util.hpp> #include <mapnik/geom_util.hpp>
@ -57,7 +57,7 @@ public:
private: private:
filterT filter_; filterT filter_;
box2d<double> query_ext_; box2d<double> query_ext_;
boost::scoped_ptr<transcoder> tr_; const std::unique_ptr<transcoder> tr_;
std::vector<int> attr_ids_; std::vector<int> attr_ids_;
mutable box2d<double> feature_ext_; mutable box2d<double> feature_ext_;
mutable int total_geom_size; mutable int total_geom_size;

View file

@ -37,7 +37,7 @@
// boost // boost
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <memory> #include <memory>
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <vector> #include <vector>

View file

@ -30,7 +30,7 @@
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
using mapnik::Featureset; using mapnik::Featureset;
using mapnik::box2d; using mapnik::box2d;
@ -53,7 +53,7 @@ public:
private: private:
std::shared_ptr<IResultSet> rs_; std::shared_ptr<IResultSet> rs_;
context_ptr ctx_; context_ptr ctx_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
unsigned totalGeomSize_; unsigned totalGeomSize_;
mapnik::value_integer feature_id_; mapnik::value_integer feature_id_;
bool key_field_; bool key_field_;

View file

@ -33,7 +33,7 @@
#include "shape_io.hpp" #include "shape_io.hpp"
//boost //boost
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
using mapnik::Featureset; using mapnik::Featureset;
@ -60,7 +60,7 @@ private:
shape_io shape_; shape_io shape_;
box2d<double> query_ext_; box2d<double> query_ext_;
mutable box2d<double> feature_bbox_; mutable box2d<double> feature_bbox_;
boost::scoped_ptr<transcoder> tr_; const std::unique_ptr<transcoder> tr_;
long file_length_; long file_length_;
std::vector<int> attr_ids_; std::vector<int> attr_ids_;
mapnik::value_integer row_limit_; mapnik::value_integer row_limit_;

View file

@ -34,7 +34,7 @@
#include <mapnik/value_types.hpp> #include <mapnik/value_types.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include "shape_datasource.hpp" #include "shape_datasource.hpp"
@ -62,7 +62,7 @@ private:
filterT filter_; filterT filter_;
context_ptr ctx_; context_ptr ctx_;
shape_io & shape_; shape_io & shape_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
std::vector<std::streampos> offsets_; std::vector<std::streampos> offsets_;
std::vector<std::streampos>::iterator itr_; std::vector<std::streampos>::iterator itr_;
std::vector<int> attr_ids_; std::vector<int> attr_ids_;

View file

@ -29,7 +29,7 @@
#include <mapnik/wkb.hpp> #include <mapnik/wkb.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
// sqlite // sqlite
@ -52,7 +52,7 @@ public:
private: private:
std::shared_ptr<sqlite_resultset> rs_; std::shared_ptr<sqlite_resultset> rs_;
mapnik::context_ptr ctx_; mapnik::context_ptr ctx_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
mapnik::box2d<double> bbox_; mapnik::box2d<double> bbox_;
mapnik::wkbFormat format_; mapnik::wkbFormat format_;
bool spatial_index_; bool spatial_index_;

View file

@ -7,7 +7,7 @@
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp> // needed for wrapping the transcoder // needed for wrapping the transcoder
class hello_featureset : public mapnik::Featureset class hello_featureset : public mapnik::Featureset
{ {
@ -25,7 +25,7 @@ private:
// members are up to you, but these are recommended // members are up to you, but these are recommended
mapnik::box2d<double> box_; mapnik::box2d<double> box_;
mapnik::value_integer feature_id_; mapnik::value_integer feature_id_;
boost::scoped_ptr<mapnik::transcoder> tr_; const std::unique_ptr<mapnik::transcoder> tr_;
mapnik::context_ptr ctx_; mapnik::context_ptr ctx_;
}; };

View file

@ -31,7 +31,7 @@
#include <mapnik/expression.hpp> #include <mapnik/expression.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <deque> #include <deque>
@ -91,8 +91,8 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
geometry_type const& geom = feature.get_geometry(i); geometry_type const& geom = feature.get_geometry(i);
if (geom.size() > 2) if (geom.size() > 2)
{ {
boost::scoped_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString)); const std::unique_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString));
boost::scoped_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon));
std::deque<segment_t> face_segments; std::deque<segment_t> face_segments;
double x0 = 0; double x0 = 0;
double y0 = 0; double y0 = 0;
@ -124,7 +124,7 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
for (; itr!=end; ++itr) for (; itr!=end; ++itr)
{ {
boost::scoped_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(),itr->get<1>()); faces->move_to(itr->get<0>(),itr->get<1>());
faces->line_to(itr->get<2>(),itr->get<3>()); faces->line_to(itr->get<2>(),itr->get<3>());
faces->line_to(itr->get<2>(),itr->get<3>() + height); faces->line_to(itr->get<2>(),itr->get<3>() + height);

View file

@ -360,8 +360,8 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
if (geom.size() > 2) if (geom.size() > 2)
{ {
boost::scoped_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString)); const std::unique_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString));
boost::scoped_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon));
std::deque<segment_t> face_segments; std::deque<segment_t> face_segments;
double x0 = 0; double x0 = 0;
double y0 = 0; double y0 = 0;
@ -392,7 +392,7 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
std::deque<segment_t>::const_iterator end=face_segments.end(); std::deque<segment_t>::const_iterator end=face_segments.end();
for (; itr != end; ++itr) for (; itr != end; ++itr)
{ {
boost::scoped_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(), itr->get<1>()); faces->move_to(itr->get<0>(), itr->get<1>());
faces->line_to(itr->get<2>(), itr->get<3>()); faces->line_to(itr->get<2>(), itr->get<3>());
faces->line_to(itr->get<2>(), itr->get<3>() + height); faces->line_to(itr->get<2>(), itr->get<3>() + height);

View file

@ -32,7 +32,7 @@
#include <mapnik/expression.hpp> #include <mapnik/expression.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
// stl // stl
#include <deque> #include <deque>
@ -78,8 +78,8 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
geometry_type & geom = feature.get_geometry(i); geometry_type & geom = feature.get_geometry(i);
if (geom.size() > 2) if (geom.size() > 2)
{ {
boost::scoped_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString)); const std::unique_ptr<geometry_type> frame(new geometry_type(geometry_type::types::LineString));
boost::scoped_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> roof(new geometry_type(geometry_type::types::Polygon));
std::deque<segment_t> face_segments; std::deque<segment_t> face_segments;
double x0(0); double x0(0);
double y0(0); double y0(0);
@ -106,7 +106,7 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
std::deque<segment_t>::const_iterator itr=face_segments.begin(); std::deque<segment_t>::const_iterator itr=face_segments.begin();
for (;itr!=face_segments.end();++itr) for (;itr!=face_segments.end();++itr)
{ {
boost::scoped_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon)); const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(),itr->get<1>()); faces->move_to(itr->get<0>(),itr->get<1>());
faces->line_to(itr->get<2>(),itr->get<3>()); faces->line_to(itr->get<2>(),itr->get<3>());
faces->line_to(itr->get<2>(),itr->get<3>() + height); faces->line_to(itr->get<2>(),itr->get<3>() + height);

View file

@ -26,7 +26,7 @@
#include <mapnik/image_reader.hpp> #include <mapnik/image_reader.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp>
namespace mapnik namespace mapnik
{ {

View file

@ -62,7 +62,7 @@ text_symbolizer_helper<FaceManagerT, DetectorT>::text_symbolizer_helper(text_sym
angle_(0.0), angle_(0.0),
placement_valid_(false), placement_valid_(false),
points_on_line_(false), points_on_line_(false),
finder_(0) finder_()
{ {
initialize_geometries(); initialize_geometries();
if (!geometries_to_process_.size()) return; if (!geometries_to_process_.size()) return;

View file

@ -28,7 +28,7 @@
// boost // boost
#include <boost/scoped_ptr.hpp>
namespace mapnik namespace mapnik