From c7ae161659948a3ce0e6711e96b3f4459c157030 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 4 Jan 2013 00:13:40 -0800 Subject: [PATCH 1/3] iwyu --- .../mapnik/json/feature_collection_parser.hpp | 4 ++-- .../mapnik/json/feature_generator_grammar.hpp | 23 ++++++++++--------- include/mapnik/json/feature_grammar.hpp | 1 + include/mapnik/json/geojson_generator.hpp | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/mapnik/json/feature_collection_parser.hpp b/include/mapnik/json/feature_collection_parser.hpp index 5238f37a0..454d69a98 100644 --- a/include/mapnik/json/feature_collection_parser.hpp +++ b/include/mapnik/json/feature_collection_parser.hpp @@ -26,8 +26,8 @@ // mapnik #include #include -#include #include +#include // boost #include @@ -43,7 +43,7 @@ template class feature_collection_parser : private mapnik::noncopyable { typedef Iterator iterator_type; - typedef mapnik::Feature feature_type; + typedef mapnik::feature_impl feature_type; public: feature_collection_parser(mapnik::context_ptr const& ctx, mapnik::transcoder const& tr); ~feature_collection_parser(); diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 7968d3716..d5d16c47d 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include #include #include #include @@ -43,29 +44,29 @@ namespace boost { namespace spirit { namespace traits { template <> -struct is_container : mpl::false_ {} ; +struct is_container : mpl::false_ {} ; template <> -struct container_iterator +struct container_iterator { typedef mapnik::feature_kv_iterator2 type; }; template <> -struct begin_container +struct begin_container { static mapnik::feature_kv_iterator2 - call (mapnik::Feature const& f) + call (mapnik::feature_impl const& f) { return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.begin(),f.end()); } }; template <> -struct end_container +struct end_container { static mapnik::feature_kv_iterator2 - call (mapnik::Feature const& f) + call (mapnik::feature_impl const& f) { return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.end(),f.end()); } @@ -94,7 +95,7 @@ struct get_id template struct result { typedef int type; }; - int operator() (mapnik::Feature const& f) const + int operator() (mapnik::feature_impl const& f) const { return f.id(); } @@ -107,7 +108,7 @@ struct make_properties_range template struct result { typedef properties_range_type type; }; - properties_range_type operator() (mapnik::Feature const& f) const + properties_range_type operator() (mapnik::feature_impl const& f) const { return boost::make_iterator_range(f.begin(),f.end()); } @@ -173,7 +174,7 @@ struct escaped_string template struct feature_generator_grammar: - karma::grammar + karma::grammar { typedef boost::tuple pair_type; typedef make_properties_range::properties_range_type range_type; @@ -224,10 +225,10 @@ struct feature_generator_grammar: } // rules - karma::rule feature; + karma::rule feature; multi_geometry_generator_grammar geometry; escaped_string escaped_string_; - karma::rule properties; + karma::rule properties; karma::rule pair; karma::rule value; karma::rule value_null_; diff --git a/include/mapnik/json/feature_grammar.hpp b/include/mapnik/json/feature_grammar.hpp index 3acf72704..fbffaed07 100644 --- a/include/mapnik/json/feature_grammar.hpp +++ b/include/mapnik/json/feature_grammar.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include #include #include #include diff --git a/include/mapnik/json/geojson_generator.hpp b/include/mapnik/json/geojson_generator.hpp index 36c587c3b..acc644eb1 100644 --- a/include/mapnik/json/geojson_generator.hpp +++ b/include/mapnik/json/geojson_generator.hpp @@ -43,7 +43,7 @@ class MAPNIK_DECL feature_generator : private mapnik::noncopyable public: feature_generator(); ~feature_generator(); - bool generate(std::string & geojson, mapnik::Feature const& f); + bool generate(std::string & geojson, mapnik::feature_impl const& f); private: boost::scoped_ptr > grammar_; }; @@ -66,7 +66,7 @@ class MAPNIK_DECL feature_generator : private mapnik::noncopyable public: feature_generator() {} ~feature_generator() {} - bool generate(std::string & geojson, mapnik::Feature const& f); + bool generate(std::string & geojson, mapnik::feature_impl const& f); }; class MAPNIK_DECL geometry_generator : private mapnik::noncopyable From fd6381dc690d359f30007f26323c2db8a75369d3 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 4 Jan 2013 00:18:08 -0800 Subject: [PATCH 2/3] move feature_ptr typedef to feature.hpp to enable access without complexity of datasource header --- include/mapnik/datasource.hpp | 2 -- include/mapnik/feature.hpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index 92974c998..6ff92ae73 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -40,8 +40,6 @@ namespace mapnik { -typedef MAPNIK_DECL boost::shared_ptr feature_ptr; - struct MAPNIK_DECL Featureset : private mapnik::noncopyable { virtual feature_ptr next() = 0; diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index daa732be0..2782562e2 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -313,6 +313,8 @@ inline std::ostream& operator<< (std::ostream & out,feature_impl const& f) typedef feature_impl Feature; +typedef MAPNIK_DECL boost::shared_ptr feature_ptr; + } #endif // MAPNIK_FEATURE_HPP From eb15d0bd8a9a748b2381c9e09575a98f3c5861f5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 4 Jan 2013 00:18:53 -0800 Subject: [PATCH 3/3] iwyu --- include/mapnik/marker_helpers.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index 7d9861528..607908c07 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -24,6 +24,7 @@ #define MAPNIK_MARKER_HELPERS_HPP #include +#include #include #include #include @@ -303,17 +304,17 @@ void build_ellipse(T const& sym, mapnik::feature_impl const& feature, svg_storag double height = 0; if (width_expr && height_expr) { - width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); - height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); + width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); + height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); } else if (width_expr) { - width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); + width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); height = width; } else if (height_expr) { - height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); + height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); width = height; } svg::svg_converter_type styled_svg(svg_path, marker_ellipse.attributes()); @@ -386,11 +387,11 @@ void setup_transform_scaling(agg::trans_affine & tr, box2d const& bbox, expression_ptr const& width_expr = sym.get_width(); if (width_expr) - width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); + width = boost::apply_visitor(evaluate(feature), *width_expr).to_double(); expression_ptr const& height_expr = sym.get_height(); if (height_expr) - height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); + height = boost::apply_visitor(evaluate(feature), *height_expr).to_double(); if (width > 0 && height > 0) {