From b51b357123890af166bb11e3835f36f64c17b46e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 6 Dec 2012 11:59:28 +0100 Subject: [PATCH 01/20] Fix float data conversion to string Fixes precision digits, closing #430 Also avoids forcing a trailing '.0', closing #1627 --- include/mapnik/util/conversions.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/mapnik/util/conversions.hpp b/include/mapnik/util/conversions.hpp index 3e4193abc..ad15627ae 100644 --- a/include/mapnik/util/conversions.hpp +++ b/include/mapnik/util/conversions.hpp @@ -68,7 +68,11 @@ struct double_policy : boost::spirit::karma::real_policies { typedef boost::spirit::karma::real_policies base_type; static int floatfield(T n) { return base_type::fmtflags::fixed; } - static unsigned precision(T n) { return 16 ;} + static unsigned precision(T n) { return 15 - trunc(log10(n)); } + template + static bool dot(OutputIterator& sink, T n, unsigned precision) { + return n ? *sink = '.', true : false; + } }; @@ -77,7 +81,7 @@ template <> inline bool to_string(std::string & str, double value) { namespace karma = boost::spirit::karma; - typedef boost::spirit::karma::real_generator > double_type; + typedef karma::real_generator > double_type; std::back_insert_iterator sink(str); return karma::generate(sink, double_type(), value); } From 9416a57b85ffe101c850cf4b9267a2c27a97e7b1 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 11 Dec 2012 10:47:01 +0100 Subject: [PATCH 02/20] Add test for backward compatibility of double to string conversion The testcase is ready to host more conversion tests but is currently really only targetting the double-to-string. refs #430, #1632 --- tests/cpp_tests/conversions_test.cpp | 76 ++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/cpp_tests/conversions_test.cpp diff --git a/tests/cpp_tests/conversions_test.cpp b/tests/cpp_tests/conversions_test.cpp new file mode 100644 index 000000000..b31dc1f55 --- /dev/null +++ b/tests/cpp_tests/conversions_test.cpp @@ -0,0 +1,76 @@ +#include +#include +#include +#include + +int main( int, char*[] ) +{ + using mapnik::util::to_string; + + std::string out; + + // Test double + + to_string(out, double(1)); + BOOST_TEST_EQ( out, "1" ); + out.clear(); + + to_string(out, double(0.1)); + BOOST_TEST_EQ( out, "0.1" ); + out.clear(); + + to_string(out, double(0.123)); + BOOST_TEST_EQ( out, "0.123" ); + out.clear(); + + to_string(out, double(1e-06)); + BOOST_TEST_EQ( out, "1e-06" ); + out.clear(); + + to_string(out, double(1e-05)); + BOOST_TEST_EQ( out, "0.00001" ); + out.clear(); + + to_string(out, double(0.0001)); + BOOST_TEST_EQ( out, "0.0001" ); + out.clear(); + + to_string(out, double(0.0001234567890123456)); + BOOST_TEST_EQ( out, "0.0001234567890123456" ); + out.clear(); + + to_string(out, double(1000000000000000)); + BOOST_TEST_EQ( out, "1000000000000000" ); + out.clear(); + + to_string(out, double(100000000000000.1)); + BOOST_TEST_EQ( out, "100000000000000.1" ); + out.clear(); + + to_string(out, double(1.00001)); + BOOST_TEST_EQ( out, "1.00001" ); + out.clear(); + + to_string(out, double(1234000000000000)); + BOOST_TEST_EQ( out, "1234000000000000" ); + out.clear(); + + to_string(out, double(1.234e+16)); + BOOST_TEST_EQ( out, "1.234e+16" ); + out.clear(); + + // Test int + + to_string(out, int(2)); + BOOST_TEST_EQ( out, "2" ); + out.clear(); + + if (!::boost::detail::test_errors()) { + std::clog << "C++ exceptions: \x1b[1;32m✓ \x1b[0m\n"; +#if BOOST_VERSION >= 104600 + ::boost::detail::report_errors_remind().called_report_errors_function = true; +#endif + } else { + return ::boost::report_errors(); + } +} From 53ba3483dba76d85d3fa04be71062098deaa4370 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 14:31:14 -0800 Subject: [PATCH 03/20] remove unused 'using' usage --- plugins/input/geos/geos_datasource.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/input/geos/geos_datasource.cpp b/plugins/input/geos/geos_datasource.cpp index 4cd780941..9e24bf968 100644 --- a/plugins/input/geos/geos_datasource.cpp +++ b/plugins/input/geos/geos_datasource.cpp @@ -55,7 +55,6 @@ using mapnik::datasource_exception; using mapnik::datasource; using mapnik::parameters; using mapnik::filter_in_box; -using mapnik::filter_at_point; DATASOURCE_PLUGIN(geos_datasource) From 1acdb1ad3e7b803ed2648fa64c569f7226bd1365 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 14:45:19 -0800 Subject: [PATCH 04/20] fixup query_tolerance test to use nose eq_ rather than asserts --- tests/python_tests/query_tolerance_test.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/python_tests/query_tolerance_test.py b/tests/python_tests/query_tolerance_test.py index 9a8c40d8a..a2ab9535c 100644 --- a/tests/python_tests/query_tolerance_test.py +++ b/tests/python_tests/query_tolerance_test.py @@ -14,7 +14,8 @@ if 'shape' in mapnik.DatasourceCache.plugin_names(): def test_query_tolerance(): srs = '+init=epsg:4326' lyr = mapnik.Layer('test') - lyr.datasource = mapnik.Shapefile(file='../data/shp/arrows.shp') + ds = mapnik.Shapefile(file='../data/shp/arrows.shp') + lyr.datasource = ds lyr.srs = srs _width = 256 _map = mapnik.Map(_width,_width, srs) @@ -24,16 +25,20 @@ if 'shape' in mapnik.DatasourceCache.plugin_names(): _map_env = _map.envelope() tol = (_map_env.maxx - _map_env.minx) / _width * 3 # 0.046875 for arrows.shp and zoom_all - assert tol == 0.046875 + eq_(tol,0.046875) # check point really exists x, y = 2.0, 4.0 features = _map.query_point(0,x,y).features - assert len(features) == 1 + eq_(len(features),1) # check inside tolerance limit x = 2.0 + tol * 0.9 features = _map.query_point(0,x,y).features - assert len(features) == 1 + eq_(len(features),1) # check outside tolerance limit x = 2.0 + tol * 1.1 features = _map.query_point(0,x,y).features - assert len(features) == 0 \ No newline at end of file + eq_(len(features),0) + +if __name__ == "__main__": + setup() + [eval(run)() for run in dir() if 'test_' in run] From e928c483bffd322c460a9ce33d59c6c8a696144d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 14:46:52 -0800 Subject: [PATCH 05/20] properly support tolerance in shape filter_at_point - refs #1640 --- include/mapnik/geom_util.hpp | 17 ++++++++++++++--- plugins/input/shape/shape_datasource.cpp | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index c875d8b75..971b6b27f 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -212,11 +212,22 @@ struct filter_in_box struct filter_at_point { coord2d pt_; - explicit filter_at_point(const coord2d& pt) - : pt_(pt) {} + double tol_; + explicit filter_at_point(const coord2d& pt, double tol=0) + : pt_(pt), + tol_(tol) {} bool pass(const box2d& extent) const { - return extent.contains(pt_); + if (tol_ == 0) + { + return extent.contains(pt_); + } + else + { + box2d extent2 = extent; + extent2.pad(tol_); + return extent2.contains(pt_); + } } }; diff --git a/plugins/input/shape/shape_datasource.cpp b/plugins/input/shape/shape_datasource.cpp index b7f3833d4..3a4dff4c8 100644 --- a/plugins/input/shape/shape_datasource.cpp +++ b/plugins/input/shape/shape_datasource.cpp @@ -296,7 +296,7 @@ featureset_ptr shape_datasource::features_at_point(coord2d const& pt, double tol mapnik::progress_timer __stats__(std::clog, "shape_datasource::features_at_point"); #endif - filter_at_point filter(pt); + filter_at_point filter(pt,tol); // collect all attribute names std::vector const& desc_vector = desc_.get_descriptors(); std::vector::const_iterator itr = desc_vector.begin(); From a4f3be02b5b2782d656306011d2095e3202fcc4a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 18:06:53 -0800 Subject: [PATCH 06/20] print null for features with value_null type in debugging output --- include/mapnik/feature.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 30e3f4a2e..3b6bf4751 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -287,7 +287,14 @@ public: std::size_t index = itr->second; if (index < data_.size()) { - ss << " " << itr->first << ":" << data_[itr->second] << std::endl; + if (data_[itr->second] == mapnik::value_null()) + { + ss << " " << itr->first << ":null" << std::endl; + } + else + { + ss << " " << itr->first << ":" << data_[itr->second] << std::endl; + } } } ss << ")" << std::endl; From 2353deced405ca2e30f2313be659c11c3b389bee Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 18:13:33 -0800 Subject: [PATCH 07/20] enable conversion from Py_None to mapnik::value_null - refs #1642,#794 --- bindings/python/mapnik_feature.cpp | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp index c4d7f75b6..841b8be65 100644 --- a/bindings/python/mapnik_feature.cpp +++ b/bindings/python/mapnik_feature.cpp @@ -156,18 +156,53 @@ struct UnicodeString_from_python_str } }; + +struct value_null_from_python +{ + value_null_from_python() + { + boost::python::converter::registry::push_back( + &convertible, + &construct, + boost::python::type_id()); + } + + static void* convertible(PyObject* obj_ptr) + { + if (obj_ptr == Py_None) return obj_ptr; + return 0; + } + + static void construct( + PyObject* obj_ptr, + boost::python::converter::rvalue_from_python_stage1_data* data) + { + if (obj_ptr != Py_None) boost::python::throw_error_already_set(); + void* storage = ( + (boost::python::converter::rvalue_from_python_storage*) + data)->storage.bytes; + new (storage) mapnik::value_null(); + data->convertible = storage; + } +}; + void export_feature() { using namespace boost::python; using mapnik::Feature; // Python to mapnik::value converters + // NOTE: order matters here. For example value_null must be listed before + // bool otherwise Py_None will be interpreted as bool (false) implicitly_convertible(); implicitly_convertible(); implicitly_convertible(); + implicitly_convertible(); implicitly_convertible(); + // http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters/ UnicodeString_from_python_str(); + value_null_from_python(); class_ ("Context",init<>("Default ctor.")) From 22b159d93dbc18324c4c24fbfcb9bfea40840304 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 19:37:46 -0800 Subject: [PATCH 08/20] enable [attr!=null] filtering - which finishes #794 and closes #1642 - refs #796 --- include/mapnik/value.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 8d986582f..c1604df73 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -182,22 +182,21 @@ struct not_equals bool operator() (value_null, value_null) const { - // TODO - needs review - https://github.com/mapnik/mapnik/issues/794 return false; } template bool operator() (value_null, const T &) const { - // TODO - needs review - https://github.com/mapnik/mapnik/issues/794 - return false; + // https://github.com/mapnik/mapnik/issues/1642 + return true; } template bool operator() (const T &, value_null) const { - // TODO - needs review - https://github.com/mapnik/mapnik/issues/794 - return false; + // https://github.com/mapnik/mapnik/issues/1642 + return true; } }; From 9abcda54c7b4b965d10eb3a035fcd5b59f3b71e4 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 19:38:27 -0800 Subject: [PATCH 09/20] ensure boolean types are converted first - refs #1642 --- bindings/python/mapnik_feature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp index 841b8be65..d20af1793 100644 --- a/bindings/python/mapnik_feature.cpp +++ b/bindings/python/mapnik_feature.cpp @@ -194,11 +194,11 @@ void export_feature() // Python to mapnik::value converters // NOTE: order matters here. For example value_null must be listed before // bool otherwise Py_None will be interpreted as bool (false) - implicitly_convertible(); - implicitly_convertible(); implicitly_convertible(); implicitly_convertible(); implicitly_convertible(); + implicitly_convertible(); + implicitly_convertible(); // http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters/ UnicodeString_from_python_str(); From d716daa4d1ac09f607fc9009c2e1cfb5afb3cdfc Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 19:39:06 -0800 Subject: [PATCH 10/20] add tests for #1642, refs #794, #796 --- tests/python_tests/filter_test.py | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tests/python_tests/filter_test.py b/tests/python_tests/filter_test.py index 5fdc7bb89..e2d1f89dd 100644 --- a/tests/python_tests/filter_test.py +++ b/tests/python_tests/filter_test.py @@ -192,5 +192,78 @@ def test_string_matching_on_precision(): expr = mapnik.Expression("[num].match('.*(^0|00)$')") eq_(expr.evaluate(f),True) +def test_creation_of_null_value(): + context = mapnik.Context() + context.push('nv') + f = mapnik.Feature(context,0) + f["nv"] = None + eq_(f["nv"],None) + eq_(f["nv"] is None,True) + # test boolean + f["nv"] = 0 + eq_(f["nv"],0) + eq_(f["nv"] is not None,True) + +def test_creation_of_bool(): + context = mapnik.Context() + context.push('bool') + f = mapnik.Feature(context,0) + f["bool"] = True + eq_(f["bool"],True) + eq_(isinstance(f["bool"],bool),True) + f["bool"] = False + eq_(f["bool"],False) + eq_(isinstance(f["bool"],bool),True) + # test NoneType + f["bool"] = None + eq_(f["bool"],None) + eq_(isinstance(f["bool"],bool),False) + # test integer + f["bool"] = 0 + eq_(f["bool"],0) + # ugh, boost_python's built into converter does not work right + #eq_(isinstance(f["bool"],bool),False) + +null_equality = [ + ['hello',False,unicode], + [0,False,int], + [0.0,False,float], + [False,False,bool], + [None,True,None] +] + +def test_expressions_with_null_equality(): + for eq in null_equality: + context = mapnik.Context() + f = mapnik.Feature(context,0) + f["prop"] = eq[0] + eq_(f["prop"],eq[0]) + if eq[0] is None: + eq_(f["prop"] is None, True) + else: + eq_(isinstance(f['prop'],eq[2]),True,'%s is not an instance of %s' % (f['prop'],eq[2])) + expr = mapnik.Expression("[prop] = null") + eq_(expr.evaluate(f),eq[1]) + expr = mapnik.Expression("[prop] is null") + eq_(expr.evaluate(f),eq[1]) + +def test_expressions_with_null_equality(): + for eq in null_equality: + context = mapnik.Context() + f = mapnik.Feature(context,0) + f["prop"] = eq[0] + eq_(f["prop"],eq[0]) + if eq[0] is None: + eq_(f["prop"] is None, True) + else: + eq_(isinstance(f['prop'],eq[2]),True,'%s is not an instance of %s' % (f['prop'],eq[2])) + # TODO - support `is not` syntax: + # https://github.com/mapnik/mapnik/issues/796 + expr = mapnik.Expression("not [prop] is null") + eq_(expr.evaluate(f),not eq[1]) + # https://github.com/mapnik/mapnik/issues/1642 + expr = mapnik.Expression("[prop] != null") + eq_(expr.evaluate(f),not eq[1]) + if __name__ == "__main__": [eval(run)() for run in dir() if 'test_' in run] From 9575bb8786eb59f711cfeafca65f0a36e2b7c3fd Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 11 Dec 2012 19:40:46 -0800 Subject: [PATCH 11/20] return value_null for null integer stored in shapefile dbf - closes #1638 - refs #1642 --- plugins/input/shape/dbfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index d2583200c..69e1a45fb 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -160,7 +160,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f) { if (record_[fields_[col].offset_] == '*') { - f.put(name,0); + f.put(name,mapnik::value_null()); break; } if ( fields_[col].dec_>0 ) From 3fd7909ba0aa0f1ce843f8613556dc41bfb1710a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 12 Dec 2012 15:09:07 -0800 Subject: [PATCH 12/20] fix compile on windows with msvc 2010 - closes #1646 --- include/mapnik/png_io.hpp | 8 ++- include/mapnik/util/conversions.hpp | 5 +- plugins/input/python/python_datasource.cpp | 60 +++++++++------------- src/palette.cpp | 2 +- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/include/mapnik/png_io.hpp b/include/mapnik/png_io.hpp index d669e479a..25bd8d97b 100644 --- a/include/mapnik/png_io.hpp +++ b/include/mapnik/png_io.hpp @@ -30,9 +30,13 @@ #include #include #include + // zlib #include +// boost +#include + extern "C" { #include @@ -118,12 +122,12 @@ void save_as_png(T1 & file, png_set_IHDR(png_ptr, info_ptr,image.width(),image.height(),8, (trans_mode == 0) ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA,PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); - png_bytep row_pointers[image.height()]; + boost::scoped_array row_pointers(new png_bytep[image.height()]); for (unsigned int i = 0; i < image.height(); i++) { row_pointers[i] = (png_bytep)image.getRow(i); } - png_set_rows(png_ptr, info_ptr, (png_bytepp)&row_pointers); + png_set_rows(png_ptr, info_ptr, row_pointers.get()); png_write_png(png_ptr, info_ptr, (trans_mode == 0) ? PNG_TRANSFORM_STRIP_FILLER_AFTER : PNG_TRANSFORM_IDENTITY, NULL); png_destroy_write_struct(&png_ptr, &info_ptr); } diff --git a/include/mapnik/util/conversions.hpp b/include/mapnik/util/conversions.hpp index ad15627ae..48f2daa3d 100644 --- a/include/mapnik/util/conversions.hpp +++ b/include/mapnik/util/conversions.hpp @@ -28,12 +28,15 @@ // stl #include +#include // log10 + // boost #include #include // boost #include +#include // trunc to avoid needing C++11 #if BOOST_VERSION >= 104500 #include @@ -68,7 +71,7 @@ struct double_policy : boost::spirit::karma::real_policies { typedef boost::spirit::karma::real_policies base_type; static int floatfield(T n) { return base_type::fmtflags::fixed; } - static unsigned precision(T n) { return 15 - trunc(log10(n)); } + static unsigned precision(T n) { return static_cast(15 - boost::math::trunc(log10(n))); } template static bool dot(OutputIterator& sink, T n, unsigned precision) { return n ? *sink = '.', true : false; diff --git a/plugins/input/python/python_datasource.cpp b/plugins/input/python/python_datasource.cpp index 7ef0a3cfa..bceeb20bb 100644 --- a/plugins/input/python/python_datasource.cpp +++ b/plugins/input/python/python_datasource.cpp @@ -62,7 +62,6 @@ mapnik::layer_descriptor python_datasource::get_descriptor() const void python_datasource::bind() const { using namespace boost; - using namespace boost::python; if (is_bound_) return; @@ -81,34 +80,34 @@ void python_datasource::bind() const + factory_ + '"'); } // extract the module and the callable - str module_name("__main__"), callable_name; + boost::python::str module_name("__main__"), callable_name; if (factory_split.size() == 1) { - callable_name = str(factory_split[0]); + callable_name = boost::python::str(factory_split[0]); } else { - module_name = str(factory_split[0]); - callable_name = str(factory_split[1]); + module_name = boost::python::str(factory_split[0]); + callable_name = boost::python::str(factory_split[1]); } ensure_gil lock; // import the main module from Python (in case we're embedding the // interpreter directly) and also import the callable. - object main_module = import("__main__"); - object callable_module = import(module_name); - object callable = callable_module.attr(callable_name); + boost::python::object main_module = boost::python::import("__main__"); + boost::python::object callable_module = boost::python::import(module_name); + boost::python::object callable = callable_module.attr(callable_name); // prepare the arguments - dict kwargs; + boost::python::dict kwargs; typedef std::map::value_type kv_type; BOOST_FOREACH(const kv_type& kv, kwargs_) { - kwargs[str(kv.first)] = str(kv.second); + kwargs[boost::python::str(kv.first)] = boost::python::str(kv.second); } // get our wrapped data source datasource_ = callable(*boost::python::make_tuple(), **kwargs); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } @@ -118,8 +117,6 @@ void python_datasource::bind() const mapnik::datasource::datasource_t python_datasource::type() const { - using namespace boost::python; - typedef boost::optional return_type; if (!is_bound_) bind(); @@ -127,11 +124,11 @@ mapnik::datasource::datasource_t python_datasource::type() const try { ensure_gil lock; - object data_type = datasource_.attr("data_type"); - long data_type_integer = extract(data_type); + boost::python::object data_type = datasource_.attr("data_type"); + long data_type_integer = boost::python::extract(data_type); return mapnik::datasource::datasource_t(data_type_integer); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } @@ -140,16 +137,14 @@ mapnik::datasource::datasource_t python_datasource::type() const mapnik::box2d python_datasource::envelope() const { - using namespace boost::python; - if (!is_bound_) bind(); try { ensure_gil lock; - return extract >(datasource_.attr("envelope")); + return boost::python::extract >(datasource_.attr("envelope")); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } @@ -157,8 +152,6 @@ mapnik::box2d python_datasource::envelope() const boost::optional python_datasource::get_geometry_type() const { - using namespace boost::python; - typedef boost::optional return_type; if (!is_bound_) bind(); @@ -171,16 +164,16 @@ boost::optional python_datasource::get_geometry_ { return return_type(); } - object py_geometry_type = datasource_.attr("geometry_type"); + boost::python::object py_geometry_type = datasource_.attr("geometry_type"); // if the attribute value is 'None', return a 'none' value - if (py_geometry_type.ptr() == object().ptr()) + if (py_geometry_type.ptr() == boost::python::object().ptr()) { return return_type(); } - long geom_type_integer = extract(py_geometry_type); + long geom_type_integer = boost::python::extract(py_geometry_type); return mapnik::datasource::geometry_t(geom_type_integer); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } @@ -188,8 +181,6 @@ boost::optional python_datasource::get_geometry_ mapnik::featureset_ptr python_datasource::features(mapnik::query const& q) const { - using namespace boost::python; - if (!is_bound_) bind(); try @@ -198,9 +189,9 @@ mapnik::featureset_ptr python_datasource::features(mapnik::query const& q) const if (envelope().intersects(q.get_bbox())) { ensure_gil lock; - object features(datasource_.attr("features")(q)); + boost::python::object features(datasource_.attr("features")(q)); // if 'None' was returned, return an empty feature set - if(features.ptr() == object().ptr()) + if(features.ptr() == boost::python::object().ptr()) { return mapnik::featureset_ptr(); } @@ -209,7 +200,7 @@ mapnik::featureset_ptr python_datasource::features(mapnik::query const& q) const // otherwise return an empty featureset pointer return mapnik::featureset_ptr(); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } @@ -217,23 +208,22 @@ mapnik::featureset_ptr python_datasource::features(mapnik::query const& q) const mapnik::featureset_ptr python_datasource::features_at_point(mapnik::coord2d const& pt, double tol) const { - using namespace boost::python; if (!is_bound_) bind(); try { ensure_gil lock; - object features(datasource_.attr("features_at_point")(pt)); + boost::python::object features(datasource_.attr("features_at_point")(pt)); // if we returned none, return an empty set - if(features.ptr() == object().ptr()) + if(features.ptr() == boost::python::object().ptr()) { return mapnik::featureset_ptr(); } // otherwise, return a feature set which can iterate over the iterator return boost::make_shared(features); } - catch ( error_already_set ) + catch ( boost::python::error_already_set ) { throw mapnik::datasource_exception(extractException()); } diff --git a/src/palette.cpp b/src/palette.cpp index 669a44130..1829015a3 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -24,7 +24,7 @@ #include // stl -#include +#include #include namespace mapnik From 772c7f52fc5a6653068423b6dd8b0faf2de67548 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 12 Dec 2012 15:59:27 -0800 Subject: [PATCH 13/20] knock out some msvc compiler warnings --- include/mapnik/image_filter.hpp | 2 +- include/mapnik/markers_placement.hpp | 2 +- include/mapnik/octree.hpp | 2 +- plugins/input/gdal/gdal_featureset.cpp | 8 ++++---- src/agg/process_line_pattern_symbolizer.cpp | 2 +- src/agg/process_line_symbolizer.cpp | 2 +- src/cairo_renderer.cpp | 2 +- src/grid/process_line_symbolizer.cpp | 2 +- src/load_map.cpp | 6 +++--- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index bf4af9389..d1967d504 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -114,7 +114,7 @@ namespace mapnik { namespace filter { namespace detail { -static const float blur_matrix[] = {0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111,0.1111}; +static const float blur_matrix[] = {0.1111f,0.1111f,0.1111f,0.1111f,0.1111f,0.1111f,0.1111f,0.1111f,0.1111f}; static const float emboss_matrix[] = {-2,-1,0,-1,1,1,0,1,2}; static const float sharpen_matrix[] = {0,-1,0,-1,5,-1,0,-1,0 }; static const float edge_detect_matrix[] = {0,1,0,1,-4,1,0,1,0 }; diff --git a/include/mapnik/markers_placement.hpp b/include/mapnik/markers_placement.hpp index f25cf9fe0..74b35011a 100644 --- a/include/mapnik/markers_placement.hpp +++ b/include/mapnik/markers_placement.hpp @@ -293,7 +293,7 @@ private: last_y = next_y; } } - unsigned points = round(length / s); + unsigned points = static_cast(round(length / s)); if (points == 0) return 0.0; //Path to short return length / points; } diff --git a/include/mapnik/octree.hpp b/include/mapnik/octree.hpp index 35b64c0d1..5535f2747 100644 --- a/include/mapnik/octree.hpp +++ b/include/mapnik/octree.hpp @@ -250,7 +250,7 @@ public: // select best of all reducible: unsigned red_idx = leaf_level_-1; - unsigned bestv = (*reducible_[red_idx].begin())->reduce_cost; + unsigned bestv = static_cast((*reducible_[red_idx].begin())->reduce_cost); for(unsigned i=red_idx; i>=InsertPolicy::MIN_LEVELS; i--) { if (!reducible_[i].empty()) diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 08fef0f6b..9adc6f321 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -200,8 +200,8 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) // if layer-level filter_factor is set, apply it if (filter_factor_) { - im_width *= filter_factor_; - im_height *= filter_factor_; + im_width = int(im_width * filter_factor_ + 0.5); + im_height = int(im_height * filter_factor_ + 0.5); MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Applying layer filter_factor=" << filter_factor_; } @@ -209,8 +209,8 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) else { double sym_downsample_factor = q.get_filter_factor(); - im_width *= sym_downsample_factor; - im_height *= sym_downsample_factor; + im_width = int(im_width * sym_downsample_factor + 0.5); + im_height = int(im_height * sym_downsample_factor + 0.5); } // case where we need to avoid upsampling so that the diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index c7f2a7098..29ce388b7 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -132,7 +132,7 @@ void agg_renderer::process(line_pattern_symbolizer const& sym, if (sym.clip()) { double padding = (double)(query_extent_.width()/pixmap_.width()); - float half_stroke = (*mark)->width()/2.0; + double half_stroke = (*mark)->width()/2.0; if (half_stroke > 1) padding *= half_stroke; clipping_extent.pad(padding); diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index ede7fb94e..0d99247df 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -89,7 +89,7 @@ void agg_renderer::process(line_symbolizer const& sym, if (sym.clip()) { double padding = (double)(query_extent_.width()/pixmap_.width()); - float half_stroke = stroke_.get_width()/2.0; + double half_stroke = stroke_.get_width()/2.0; if (half_stroke > 1) padding *= half_stroke; if (fabs(sym.offset()) > 0) diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index 32dd776a4..1b9e90540 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -1052,7 +1052,7 @@ void cairo_renderer_base::process(line_symbolizer const& sym, if (sym.clip()) { double padding = (double)(query_extent_.width()/width_); - float half_stroke = stroke_.get_width()/2.0; + double half_stroke = stroke_.get_width()/2.0; if (half_stroke > 1) padding *= half_stroke; if (fabs(sym.offset()) > 0) diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index b026b7544..be50bdfef 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -74,7 +74,7 @@ void grid_renderer::process(line_symbolizer const& sym, if (sym.clip()) { double padding = (double)(query_extent_.width()/pixmap_.width()); - float half_stroke = stroke_.get_width()/2.0; + double half_stroke = stroke_.get_width()/2.0; if (half_stroke > 1) padding *= half_stroke; if (fabs(sym.offset()) > 0) diff --git a/src/load_map.cpp b/src/load_map.cpp index 4d4e1b978..1f7efe210 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -1125,7 +1125,7 @@ void map_parser::parse_polygon_pattern_symbolizer(rule & rule, symbol.set_alignment(p_alignment); // opacity - optional opacity = sym.get_opt_attr("opacity"); + optional opacity = sym.get_opt_attr("opacity"); if (opacity) symbol.set_opacity(*opacity); // gamma @@ -1212,7 +1212,7 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym) shield_symbol.set_shield_displacement(shield_dx,shield_dy); // opacity - optional opacity = sym.get_opt_attr("opacity"); + optional opacity = sym.get_opt_attr("opacity"); if (opacity) { shield_symbol.set_opacity(*opacity); @@ -1484,7 +1484,7 @@ void map_parser::parse_raster_symbolizer(rule & rule, xml_node const & sym) } // opacity - optional opacity = sym.get_opt_attr("opacity"); + optional opacity = sym.get_opt_attr("opacity"); if (opacity) raster_sym.set_opacity(*opacity); // filter factor From dd327140f4586b22eb2fa6e40c1c29e9d7316d30 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 13 Dec 2012 09:33:55 +0000 Subject: [PATCH 14/20] + add attribute collection policy --- include/mapnik/feature_style_processor.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mapnik/feature_style_processor.hpp b/include/mapnik/feature_style_processor.hpp index 152269ba1..cbbf6085b 100644 --- a/include/mapnik/feature_style_processor.hpp +++ b/include/mapnik/feature_style_processor.hpp @@ -40,6 +40,12 @@ class layer; class projection; class proj_transform; +enum eAttributeCollectionPolicy +{ + DEFAULT = 0, + COLLECT_ALL = 1 +}; + template class feature_style_processor { From 7ded35ef94a792ff2313e2087a5684c938fc1497 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 13 Dec 2012 09:35:03 +0000 Subject: [PATCH 15/20] + support attribute collection policy accross renderer backends --- include/mapnik/agg_renderer.hpp | 4 ++++ include/mapnik/cairo_renderer.hpp | 5 ++++ .../mapnik/feature_style_processor_impl.hpp | 23 ++++++++++++------- include/mapnik/grid/grid_renderer.hpp | 4 ++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp index 9ace3429a..68823917e 100644 --- a/include/mapnik/agg_renderer.hpp +++ b/include/mapnik/agg_renderer.hpp @@ -119,6 +119,10 @@ public: }; void painted(bool painted); + inline eAttributeCollectionPolicy attribute_collection_policy() const + { + return DEFAULT; + } protected: template diff --git a/include/mapnik/cairo_renderer.hpp b/include/mapnik/cairo_renderer.hpp index 5adba78da..b188050f8 100644 --- a/include/mapnik/cairo_renderer.hpp +++ b/include/mapnik/cairo_renderer.hpp @@ -123,6 +123,11 @@ public: // nothing to do } + inline eAttributeCollectionPolicy attribute_collection_policy() const + { + return DEFAULT; + } + void render_marker(pixel_position const& pos, marker const& marker, const agg::trans_affine & mtx, double opacity=1.0, bool recenter=true); void render_box(box2d const& b); protected: diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp index ec7d98f76..eeebdf01f 100644 --- a/include/mapnik/feature_style_processor_impl.hpp +++ b/include/mapnik/feature_style_processor_impl.hpp @@ -382,10 +382,20 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces // Don't even try to do more work if there are no active styles. if (active_styles.size() > 0) { - // push all property names - BOOST_FOREACH(std::string const& name, names) + if (p.attribute_collection_policy() == COLLECT_ALL) { - q.add_property_name(name); + layer_descriptor lay_desc = ds->get_descriptor(); + BOOST_FOREACH(attribute_descriptor const& desc, lay_desc.get_descriptors()) + { + q.add_property_name(desc.get_name()); + } + } + else + { + BOOST_FOREACH(std::string const& name, names) + { + q.add_property_name(name); + } } // Update filter_factor for all enabled raster layers. @@ -397,14 +407,11 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces ds->type() == datasource::Raster && ds->params().get("filter_factor",0.0) == 0.0) { - rule::symbolizers const& symbols = r.get_symbolizers(); - rule::symbolizers::const_iterator symIter = symbols.begin(); - rule::symbolizers::const_iterator symEnd = symbols.end(); - while (symIter != symEnd) + BOOST_FOREACH (rule::symbolizers::value_type sym, r.get_symbolizers()) { // if multiple raster symbolizers, last will be respected // should we warn or throw? - boost::apply_visitor(d_collector,*symIter++); + boost::apply_visitor(d_collector,sym); } q.set_filter_factor(filt_factor); } diff --git a/include/mapnik/grid/grid_renderer.hpp b/include/mapnik/grid/grid_renderer.hpp index d8d6af67a..55e9cd901 100644 --- a/include/mapnik/grid/grid_renderer.hpp +++ b/include/mapnik/grid/grid_renderer.hpp @@ -109,6 +109,10 @@ public: { pixmap_.painted(painted); } + inline eAttributeCollectionPolicy attribute_collection_policy() const + { + return DEFAULT; + } private: buffer_type & pixmap_; From 9453d93f1508fa0e9e7cc45ae7798a329f0d62af Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 14 Dec 2012 19:22:04 +0000 Subject: [PATCH 16/20] + update conversion tests to have 0.0 and negative numbers --- tests/cpp_tests/conversions_test.cpp | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/cpp_tests/conversions_test.cpp b/tests/cpp_tests/conversions_test.cpp index b31dc1f55..b48dff321 100644 --- a/tests/cpp_tests/conversions_test.cpp +++ b/tests/cpp_tests/conversions_test.cpp @@ -10,39 +10,74 @@ int main( int, char*[] ) std::string out; // Test double + to_string(out, double(0)); + BOOST_TEST_EQ( out, "0" ); + out.clear(); to_string(out, double(1)); BOOST_TEST_EQ( out, "1" ); out.clear(); + to_string(out, double(-1)); + BOOST_TEST_EQ( out, "-1" ); + out.clear(); + to_string(out, double(0.1)); BOOST_TEST_EQ( out, "0.1" ); out.clear(); + to_string(out, double(-0.1)); + BOOST_TEST_EQ( out, "-0.1" ); + out.clear(); + to_string(out, double(0.123)); BOOST_TEST_EQ( out, "0.123" ); out.clear(); + to_string(out, double(-0.123)); + BOOST_TEST_EQ( out, "-0.123" ); + out.clear(); + to_string(out, double(1e-06)); BOOST_TEST_EQ( out, "1e-06" ); out.clear(); + to_string(out, double(-1e-06)); + BOOST_TEST_EQ( out, "-1e-06" ); + out.clear(); + to_string(out, double(1e-05)); BOOST_TEST_EQ( out, "0.00001" ); out.clear(); + to_string(out, double(-1e-05)); + BOOST_TEST_EQ( out, "-0.00001" ); + out.clear(); + to_string(out, double(0.0001)); BOOST_TEST_EQ( out, "0.0001" ); out.clear(); + to_string(out, double(-0.0001)); + BOOST_TEST_EQ( out, "-0.0001" ); + out.clear(); + to_string(out, double(0.0001234567890123456)); BOOST_TEST_EQ( out, "0.0001234567890123456" ); out.clear(); + to_string(out, double(-0.0001234567890123456)); + BOOST_TEST_EQ( out, "-0.0001234567890123456" ); + out.clear(); + to_string(out, double(1000000000000000)); BOOST_TEST_EQ( out, "1000000000000000" ); out.clear(); + to_string(out, double(-1000000000000000)); + BOOST_TEST_EQ( out, "-1000000000000000" ); + out.clear(); + to_string(out, double(100000000000000.1)); BOOST_TEST_EQ( out, "100000000000000.1" ); out.clear(); @@ -59,6 +94,10 @@ int main( int, char*[] ) BOOST_TEST_EQ( out, "1.234e+16" ); out.clear(); + to_string(out, double(-1.234e+16)); + BOOST_TEST_EQ( out, "-1.234e+16" ); + out.clear(); + // Test int to_string(out, int(2)); From 4040eebf109906fb943b2be0a5511c6fed33876d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 14 Dec 2012 13:52:39 -0800 Subject: [PATCH 17/20] catch c++ abort --- tests/cpp_tests/conversions_test.cpp | 202 ++++++++++++++------------- 1 file changed, 105 insertions(+), 97 deletions(-) diff --git a/tests/cpp_tests/conversions_test.cpp b/tests/cpp_tests/conversions_test.cpp index b48dff321..a24c807b7 100644 --- a/tests/cpp_tests/conversions_test.cpp +++ b/tests/cpp_tests/conversions_test.cpp @@ -7,105 +7,113 @@ int main( int, char*[] ) { using mapnik::util::to_string; - std::string out; - - // Test double - to_string(out, double(0)); - BOOST_TEST_EQ( out, "0" ); - out.clear(); - - to_string(out, double(1)); - BOOST_TEST_EQ( out, "1" ); - out.clear(); - - to_string(out, double(-1)); - BOOST_TEST_EQ( out, "-1" ); - out.clear(); - - to_string(out, double(0.1)); - BOOST_TEST_EQ( out, "0.1" ); - out.clear(); - - to_string(out, double(-0.1)); - BOOST_TEST_EQ( out, "-0.1" ); - out.clear(); - - to_string(out, double(0.123)); - BOOST_TEST_EQ( out, "0.123" ); - out.clear(); - - to_string(out, double(-0.123)); - BOOST_TEST_EQ( out, "-0.123" ); - out.clear(); - - to_string(out, double(1e-06)); - BOOST_TEST_EQ( out, "1e-06" ); - out.clear(); - - to_string(out, double(-1e-06)); - BOOST_TEST_EQ( out, "-1e-06" ); - out.clear(); - - to_string(out, double(1e-05)); - BOOST_TEST_EQ( out, "0.00001" ); - out.clear(); - - to_string(out, double(-1e-05)); - BOOST_TEST_EQ( out, "-0.00001" ); - out.clear(); - - to_string(out, double(0.0001)); - BOOST_TEST_EQ( out, "0.0001" ); - out.clear(); - - to_string(out, double(-0.0001)); - BOOST_TEST_EQ( out, "-0.0001" ); - out.clear(); - - to_string(out, double(0.0001234567890123456)); - BOOST_TEST_EQ( out, "0.0001234567890123456" ); - out.clear(); - - to_string(out, double(-0.0001234567890123456)); - BOOST_TEST_EQ( out, "-0.0001234567890123456" ); - out.clear(); - - to_string(out, double(1000000000000000)); - BOOST_TEST_EQ( out, "1000000000000000" ); - out.clear(); - - to_string(out, double(-1000000000000000)); - BOOST_TEST_EQ( out, "-1000000000000000" ); - out.clear(); - - to_string(out, double(100000000000000.1)); - BOOST_TEST_EQ( out, "100000000000000.1" ); - out.clear(); - - to_string(out, double(1.00001)); - BOOST_TEST_EQ( out, "1.00001" ); - out.clear(); - - to_string(out, double(1234000000000000)); - BOOST_TEST_EQ( out, "1234000000000000" ); - out.clear(); - - to_string(out, double(1.234e+16)); - BOOST_TEST_EQ( out, "1.234e+16" ); - out.clear(); - - to_string(out, double(-1.234e+16)); - BOOST_TEST_EQ( out, "-1.234e+16" ); - out.clear(); - - // Test int - - to_string(out, int(2)); - BOOST_TEST_EQ( out, "2" ); - out.clear(); + try + { + std::string out; + + // Test double + to_string(out, double(0)); + BOOST_TEST_EQ( out, "0" ); + out.clear(); + + to_string(out, double(1)); + BOOST_TEST_EQ( out, "1" ); + out.clear(); + + to_string(out, double(-1)); + BOOST_TEST_EQ( out, "-1" ); + out.clear(); + + to_string(out, double(0.1)); + BOOST_TEST_EQ( out, "0.1" ); + out.clear(); + + to_string(out, double(-0.1)); + BOOST_TEST_EQ( out, "-0.1" ); + out.clear(); + + to_string(out, double(0.123)); + BOOST_TEST_EQ( out, "0.123" ); + out.clear(); + + to_string(out, double(-0.123)); + BOOST_TEST_EQ( out, "-0.123" ); + out.clear(); + + to_string(out, double(1e-06)); + BOOST_TEST_EQ( out, "1e-06" ); + out.clear(); + + to_string(out, double(-1e-06)); + BOOST_TEST_EQ( out, "-1e-06" ); + out.clear(); + + to_string(out, double(1e-05)); + BOOST_TEST_EQ( out, "0.00001" ); + out.clear(); + + to_string(out, double(-1e-05)); + BOOST_TEST_EQ( out, "-0.00001" ); + out.clear(); + + to_string(out, double(0.0001)); + BOOST_TEST_EQ( out, "0.0001" ); + out.clear(); + + to_string(out, double(-0.0001)); + BOOST_TEST_EQ( out, "-0.0001" ); + out.clear(); + + to_string(out, double(0.0001234567890123456)); + BOOST_TEST_EQ( out, "0.0001234567890123456" ); + out.clear(); + + to_string(out, double(-0.0001234567890123456)); + BOOST_TEST_EQ( out, "-0.0001234567890123456" ); + out.clear(); + + to_string(out, double(1000000000000000)); + BOOST_TEST_EQ( out, "1000000000000000" ); + out.clear(); + + to_string(out, double(-1000000000000000)); + BOOST_TEST_EQ( out, "-1000000000000000" ); + out.clear(); + + to_string(out, double(100000000000000.1)); + BOOST_TEST_EQ( out, "100000000000000.1" ); + out.clear(); + + to_string(out, double(1.00001)); + BOOST_TEST_EQ( out, "1.00001" ); + out.clear(); + + to_string(out, double(1234000000000000)); + BOOST_TEST_EQ( out, "1234000000000000" ); + out.clear(); + + to_string(out, double(1.234e+16)); + BOOST_TEST_EQ( out, "1.234e+16" ); + out.clear(); + + to_string(out, double(-1.234e+16)); + BOOST_TEST_EQ( out, "-1.234e+16" ); + out.clear(); + + // Test int + + to_string(out, int(2)); + BOOST_TEST_EQ( out, "2" ); + out.clear(); + } + catch (std::exception const & ex) + { + std::clog << "C++ type conversions problem: " << ex.what() << "\n"; + BOOST_TEST(false); + } if (!::boost::detail::test_errors()) { - std::clog << "C++ exceptions: \x1b[1;32m✓ \x1b[0m\n"; + std::clog << "C++ type conversions: \x1b[1;32m✓ \x1b[0m\n"; #if BOOST_VERSION >= 104600 ::boost::detail::report_errors_remind().called_report_errors_function = true; #endif From 159dec9aa59746c18fc055f8608401780896ae37 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 16 Dec 2012 12:23:01 -0800 Subject: [PATCH 18/20] configure python details if building python plugin as well as bindings --- SConstruct | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/SConstruct b/SConstruct index 45a3e5560..7c035a09f 100644 --- a/SConstruct +++ b/SConstruct @@ -1331,7 +1331,7 @@ if not preconfigured: else: color_print(4,'Not building with cairo support, pass CAIRO=True to enable') - if 'python' in env['BINDINGS']: + if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: if not os.access(env['PYTHON'], os.X_OK): color_print(1,"Cannot run python interpreter at '%s', make sure that you have the permissions to execute it." % env['PYTHON']) Exit(1) @@ -1386,22 +1386,22 @@ if not preconfigured: else: env['PYTHON_IS_64BIT'] = False - if py3 and env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python3%s' % env['BOOST_APPEND'] - elif env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python%s' % env['BOOST_APPEND'] + if 'python' in env['BINDINGS']: + if py3 and env['BOOST_PYTHON_LIB'] == 'boost_python': + env['BOOST_PYTHON_LIB'] = 'boost_python3%s' % env['BOOST_APPEND'] + elif env['BOOST_PYTHON_LIB'] == 'boost_python': + env['BOOST_PYTHON_LIB'] = 'boost_python%s' % env['BOOST_APPEND'] + if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'): + color_print(1,'Could not find required header files for boost python') + env['MISSING_DEPS'].append('boost python') - if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'): - color_print(1,'Could not find required header files for boost python') - env['MISSING_DEPS'].append('boost python') - - if env['CAIRO']: - if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): - env['HAS_PYCAIRO'] = True + if env['CAIRO']: + if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): + env['HAS_PYCAIRO'] = True + else: + env['SKIPPED_DEPS'].extend(['pycairo']) else: - env['SKIPPED_DEPS'].extend(['pycairo']) - else: - color_print(4,'Not building with pycairo support, pass CAIRO=True to enable') + color_print(4,'Not building with pycairo support, pass CAIRO=True to enable') #### End Config Stage for Required Dependencies #### @@ -1526,7 +1526,7 @@ if not preconfigured: if env['DEBUG_UNDEFINED']: env.Append(CXXFLAGS = '-fcatch-undefined-behavior -ftrapv -fwrapv') - if 'python' in env['BINDINGS']: + if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: majver, minver = env['PYTHON_VERSION'].split('.') # we don't want the includes it in the main environment... # as they are later set in the python build.py @@ -1542,9 +1542,10 @@ if not preconfigured: color_print(1,"Python version 2.2 or greater required") Exit(1) - color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION']) - color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX'])) - color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION'])) + if 'python' in env['BINDINGS']: + color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION']) + color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX'])) + color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION'])) env.Replace(**backup) # if requested, sort LIBPATH and CPPPATH one last time before saving... From 16aae90bfc68b18229b96281ebe3da05359f9962 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 16 Dec 2012 12:50:36 -0800 Subject: [PATCH 19/20] iwyu --- bindings/python/mapnik_datasource.cpp | 1 + bindings/python/mapnik_datasource_cache.cpp | 2 ++ bindings/python/mapnik_expression.cpp | 2 ++ bindings/python/mapnik_feature.cpp | 2 ++ bindings/python/mapnik_featureset.cpp | 1 + bindings/python/mapnik_font_engine.cpp | 2 ++ bindings/python/mapnik_geometry.cpp | 2 ++ bindings/python/mapnik_label_collision_detector.cpp | 2 ++ bindings/python/mapnik_logger.cpp | 2 ++ bindings/python/mapnik_palette.cpp | 1 + bindings/python/mapnik_proj_transform.cpp | 1 + bindings/python/mapnik_text_placement.cpp | 1 + bindings/python/python_optional.hpp | 1 + 13 files changed, 20 insertions(+) diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp index 5ffb7c69b..445c1b11f 100644 --- a/bindings/python/mapnik_datasource.cpp +++ b/bindings/python/mapnik_datasource.cpp @@ -23,6 +23,7 @@ // boost #include #include +#include // stl #include diff --git a/bindings/python/mapnik_datasource_cache.cpp b/bindings/python/mapnik_datasource_cache.cpp index 50074f3af..db30d72c2 100644 --- a/bindings/python/mapnik_datasource_cache.cpp +++ b/bindings/python/mapnik_datasource_cache.cpp @@ -21,6 +21,8 @@ *****************************************************************************/ #include +#include + #include namespace { diff --git a/bindings/python/mapnik_expression.cpp b/bindings/python/mapnik_expression.cpp index b39c4c069..109b21e15 100644 --- a/bindings/python/mapnik_expression.cpp +++ b/bindings/python/mapnik_expression.cpp @@ -23,6 +23,8 @@ // boost #include #include +#include + // mapnik #include diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp index d20af1793..d8e430cb2 100644 --- a/bindings/python/mapnik_feature.cpp +++ b/bindings/python/mapnik_feature.cpp @@ -28,6 +28,8 @@ #include #include #include +#include + // mapnik #include diff --git a/bindings/python/mapnik_featureset.cpp b/bindings/python/mapnik_featureset.cpp index 18fa63387..3148d116e 100644 --- a/bindings/python/mapnik_featureset.cpp +++ b/bindings/python/mapnik_featureset.cpp @@ -22,6 +22,7 @@ // boost #include +#include // mapnik #include diff --git a/bindings/python/mapnik_font_engine.cpp b/bindings/python/mapnik_font_engine.cpp index 5f4160756..1742de20b 100644 --- a/bindings/python/mapnik_font_engine.cpp +++ b/bindings/python/mapnik_font_engine.cpp @@ -21,6 +21,8 @@ *****************************************************************************/ #include +#include + #include void export_font_engine() diff --git a/bindings/python/mapnik_geometry.cpp b/bindings/python/mapnik_geometry.cpp index 17aa11389..bf90e167a 100644 --- a/bindings/python/mapnik_geometry.cpp +++ b/bindings/python/mapnik_geometry.cpp @@ -26,6 +26,8 @@ #include #include #include +#include + // mapnik #include diff --git a/bindings/python/mapnik_label_collision_detector.cpp b/bindings/python/mapnik_label_collision_detector.cpp index 4ee4c004c..55747e41f 100644 --- a/bindings/python/mapnik_label_collision_detector.cpp +++ b/bindings/python/mapnik_label_collision_detector.cpp @@ -24,6 +24,8 @@ #include #include #include +#include + #include #include diff --git a/bindings/python/mapnik_logger.cpp b/bindings/python/mapnik_logger.cpp index 0f3b30949..fee924ee6 100644 --- a/bindings/python/mapnik_logger.cpp +++ b/bindings/python/mapnik_logger.cpp @@ -21,6 +21,8 @@ *****************************************************************************/ #include +#include + #include #include #include "mapnik_enumeration.hpp" diff --git a/bindings/python/mapnik_palette.cpp b/bindings/python/mapnik_palette.cpp index 16a614757..2d82c0919 100644 --- a/bindings/python/mapnik_palette.cpp +++ b/bindings/python/mapnik_palette.cpp @@ -23,6 +23,7 @@ // boost #include #include +#include //mapnik #include diff --git a/bindings/python/mapnik_proj_transform.cpp b/bindings/python/mapnik_proj_transform.cpp index 7dec3b36b..5b1115555 100644 --- a/bindings/python/mapnik_proj_transform.cpp +++ b/bindings/python/mapnik_proj_transform.cpp @@ -22,6 +22,7 @@ // mapnik #include +#include // boost #include diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp index 67b9a241e..2cdb744fc 100644 --- a/bindings/python/mapnik_text_placement.cpp +++ b/bindings/python/mapnik_text_placement.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ #include #include +#include #include #include diff --git a/bindings/python/python_optional.hpp b/bindings/python/python_optional.hpp index 29c1990db..0d785b0f3 100644 --- a/bindings/python/python_optional.hpp +++ b/bindings/python/python_optional.hpp @@ -22,6 +22,7 @@ #include #include +#include // boost::optional to/from converter from John Wiegley From bb27156df0a111fdecfe87b48d27b2866b7a2816 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 16 Dec 2012 18:19:52 -0800 Subject: [PATCH 20/20] use internal noncopyable class to speed up compile times slightly --- demo/viewer/styles_model.cpp | 5 +++-- include/mapnik/agg_pattern_source.hpp | 6 ++---- include/mapnik/agg_rasterizer.hpp | 6 +++--- include/mapnik/agg_renderer.hpp | 4 ++-- include/mapnik/attribute_collector.hpp | 5 +++-- include/mapnik/cairo_renderer.hpp | 6 +++--- include/mapnik/datasource.hpp | 6 +++--- include/mapnik/datasource_cache.hpp | 4 ++-- include/mapnik/debug.hpp | 8 ++++---- include/mapnik/feature.hpp | 8 +++++--- include/mapnik/font_engine_freetype.hpp | 16 ++++++++-------- include/mapnik/formatting/registry.hpp | 6 ++---- include/mapnik/geometry.hpp | 4 ++-- include/mapnik/grid/grid_rasterizer.hpp | 4 ++-- include/mapnik/grid/grid_renderer.hpp | 4 ++-- include/mapnik/hextree.hpp | 4 ++-- .../mapnik/json/feature_collection_grammar.hpp | 3 ++- .../mapnik/json/feature_collection_parser.hpp | 5 +++-- include/mapnik/json/geojson_generator.hpp | 11 ++++++----- include/mapnik/json/geometry_parser.hpp | 5 +++-- include/mapnik/label_collision_detector.hpp | 7 ++++--- include/mapnik/mapped_memory_cache.hpp | 4 ++-- include/mapnik/marker.hpp | 4 ++-- include/mapnik/marker_cache.hpp | 4 ++-- include/mapnik/markers_placement.hpp | 6 ++---- include/mapnik/octree.hpp | 6 ++---- include/mapnik/palette.hpp | 4 ++-- include/mapnik/placement_finder.hpp | 3 ++- include/mapnik/plugin.hpp | 6 +++--- include/mapnik/pool.hpp | 4 ++-- include/mapnik/processed_text.hpp | 3 ++- include/mapnik/proj_transform.hpp | 6 ++---- include/mapnik/quad_tree.hpp | 4 ++-- include/mapnik/raster.hpp | 6 ++---- include/mapnik/simplify_converter.hpp | 3 ++- include/mapnik/svg/output/svg_generator.hpp | 5 ++--- include/mapnik/svg/output/svg_renderer.hpp | 3 ++- include/mapnik/svg/svg_converter.hpp | 6 ++---- include/mapnik/svg/svg_parser.hpp | 4 ++-- include/mapnik/svg/svg_path_adapter.hpp | 6 +++--- include/mapnik/svg/svg_renderer_agg.hpp | 4 ++-- include/mapnik/svg/svg_storage.hpp | 6 ++---- include/mapnik/text_path.hpp | 6 +++--- include/mapnik/text_placements/base.hpp | 2 +- include/mapnik/text_placements/registry.hpp | 6 ++---- include/mapnik/unicode.hpp | 4 ++-- include/mapnik/vertex_converters.hpp | 4 ++-- include/mapnik/vertex_vector.hpp | 4 ++-- include/mapnik/wkb.hpp | 6 ++---- include/mapnik/wkt/wkt_factory.hpp | 5 +++-- plugins/input/shape/dbfile.hpp | 6 ++++-- plugins/input/shape/shape_io.hpp | 4 ++-- plugins/input/shape/shapefile.hpp | 4 ++-- plugins/input/sqlite/sqlite_prepared.hpp | 4 ++-- src/agg/process_line_pattern_symbolizer.cpp | 4 ++-- src/cairo_renderer.cpp | 10 +++++----- src/jpeg_reader.cpp | 4 ++-- src/libxml2_loader.cpp | 4 ++-- src/load_map.cpp | 3 ++- src/png_reader.cpp | 4 ++-- src/rapidxml_loader.cpp | 6 ++---- src/wkb.cpp | 4 ++-- utils/pgsql2sqlite/sqlite.hpp | 7 ++++--- 63 files changed, 160 insertions(+), 165 deletions(-) diff --git a/demo/viewer/styles_model.cpp b/demo/viewer/styles_model.cpp index 3468de005..875d97dbe 100644 --- a/demo/viewer/styles_model.cpp +++ b/demo/viewer/styles_model.cpp @@ -20,17 +20,18 @@ #include "styles_model.hpp" #include +#include + // boost #include #include -#include // qt #include #include #include #include -class node : private boost::noncopyable +class node : private mapnik::noncopyable { struct node_base { diff --git a/include/mapnik/agg_pattern_source.hpp b/include/mapnik/agg_pattern_source.hpp index 0f24ddaf4..39688e07e 100644 --- a/include/mapnik/agg_pattern_source.hpp +++ b/include/mapnik/agg_pattern_source.hpp @@ -25,9 +25,7 @@ // mapnik #include - -// boost -#include +#include // agg #include "agg_color_rgba.h" @@ -35,7 +33,7 @@ namespace mapnik { -class pattern_source : private boost::noncopyable +class pattern_source : private mapnik::noncopyable { public: pattern_source(image_data_32 const& pattern) diff --git a/include/mapnik/agg_rasterizer.hpp b/include/mapnik/agg_rasterizer.hpp index 49ac23b81..1f93c556f 100644 --- a/include/mapnik/agg_rasterizer.hpp +++ b/include/mapnik/agg_rasterizer.hpp @@ -23,15 +23,15 @@ #ifndef MAPNIK_AGG_RASTERIZER_HPP #define MAPNIK_AGG_RASTERIZER_HPP -// boost -#include +// mapnik +#include // agg #include "agg_rasterizer_scanline_aa.h" namespace mapnik { -struct rasterizer : agg::rasterizer_scanline_aa<>, boost::noncopyable {}; +struct rasterizer : agg::rasterizer_scanline_aa<>, mapnik::noncopyable {}; } diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp index 68823917e..08b387a08 100644 --- a/include/mapnik/agg_renderer.hpp +++ b/include/mapnik/agg_renderer.hpp @@ -30,9 +30,9 @@ #include #include #include // for all symbolizers +#include // boost -#include #include #include #include @@ -53,7 +53,7 @@ struct rasterizer; template class MAPNIK_DECL agg_renderer : public feature_style_processor >, - private boost::noncopyable + private mapnik::noncopyable { public: diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 9ff8b56cc..a1abc86a8 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -26,8 +26,9 @@ // mapnik #include #include +#include + // boost -#include #include #include // stl @@ -206,7 +207,7 @@ private: }; -class attribute_collector : public boost::noncopyable +class attribute_collector : public mapnik::noncopyable { private: std::set& names_; diff --git a/include/mapnik/cairo_renderer.hpp b/include/mapnik/cairo_renderer.hpp index b188050f8..e747823e3 100644 --- a/include/mapnik/cairo_renderer.hpp +++ b/include/mapnik/cairo_renderer.hpp @@ -32,13 +32,13 @@ #include #include #include // for all symbolizers +#include // cairo #include #include // boost -#include #include // FIXME @@ -57,7 +57,7 @@ class cairo_face; typedef boost::shared_ptr cairo_face_ptr; -class cairo_face_manager : private boost::noncopyable +class cairo_face_manager : private mapnik::noncopyable { public: cairo_face_manager(boost::shared_ptr engine); @@ -69,7 +69,7 @@ private: cairo_face_cache cache_; }; -class MAPNIK_DECL cairo_renderer_base : private boost::noncopyable +class MAPNIK_DECL cairo_renderer_base : private mapnik::noncopyable { protected: cairo_renderer_base(Map const& m, Cairo::RefPtr const& context, double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0); diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index 014cc99e6..f05ce0c2b 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -29,9 +29,9 @@ #include #include #include +#include // boost -#include #include // stl @@ -42,7 +42,7 @@ namespace mapnik { typedef MAPNIK_DECL boost::shared_ptr feature_ptr; -struct MAPNIK_DECL Featureset : private boost::noncopyable +struct MAPNIK_DECL Featureset : private mapnik::noncopyable { virtual feature_ptr next() = 0; virtual ~Featureset() {} @@ -70,7 +70,7 @@ private: std::string message_; }; -class MAPNIK_DECL datasource : private boost::noncopyable +class MAPNIK_DECL datasource : private mapnik::noncopyable { public: enum datasource_t { diff --git a/include/mapnik/datasource_cache.hpp b/include/mapnik/datasource_cache.hpp index 51cdfd415..0b74f1663 100644 --- a/include/mapnik/datasource_cache.hpp +++ b/include/mapnik/datasource_cache.hpp @@ -28,9 +28,9 @@ #include #include #include +#include // boost -#include #include // stl @@ -40,7 +40,7 @@ namespace mapnik { class MAPNIK_DECL datasource_cache : public singleton, - private boost::noncopyable + private mapnik::noncopyable { friend class CreateStatic; public: diff --git a/include/mapnik/debug.hpp b/include/mapnik/debug.hpp index b53cc985c..caf5777fc 100644 --- a/include/mapnik/debug.hpp +++ b/include/mapnik/debug.hpp @@ -26,9 +26,9 @@ // mapnik (should not depend on anything that need to use this) #include #include +#include // boost -#include #include #ifdef MAPNIK_THREADSAFE #include @@ -50,7 +50,7 @@ namespace mapnik { */ class MAPNIK_DECL logger : public singleton, - private boost::noncopyable + private mapnik::noncopyable { public: enum severity_type @@ -186,7 +186,7 @@ namespace mapnik { class Ch = char, class Tr = std::char_traits, class A = std::allocator > - class base_log : public boost::noncopyable + class base_log : public mapnik::noncopyable { public: typedef OutputPolicy output_policy; @@ -245,7 +245,7 @@ namespace mapnik { class Ch = char, class Tr = std::char_traits, class A = std::allocator > - class base_log_always : public boost::noncopyable + class base_log_always : public mapnik::noncopyable { public: typedef OutputPolicy output_policy; diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 3b6bf4751..d6a88a2aa 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -29,6 +29,8 @@ #include #include #include +#include + // boost #include #if BOOST_VERSION >= 104000 @@ -36,7 +38,7 @@ #else #include #endif -#include + #include #include @@ -52,7 +54,7 @@ typedef boost::shared_ptr raster_ptr; class feature_impl; template -class context : private boost::noncopyable, +class context : private mapnik::noncopyable, public boost::associative_property_map { @@ -95,7 +97,7 @@ typedef MAPNIK_DECL boost::shared_ptr context_ptr; static const value default_value; -class MAPNIK_DECL feature_impl : private boost::noncopyable +class MAPNIK_DECL feature_impl : private mapnik::noncopyable { friend class feature_kv_iterator; public: diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index d77206cb4..858b2c0cd 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -32,6 +32,7 @@ #include #include #include +#include // freetype2 extern "C" @@ -45,7 +46,6 @@ extern "C" // boost #include #include -#include #include #include #ifdef MAPNIK_THREADSAFE @@ -69,7 +69,7 @@ class string_info; typedef boost::shared_ptr face_ptr; -class MAPNIK_DECL font_glyph : private boost::noncopyable +class MAPNIK_DECL font_glyph : private mapnik::noncopyable { public: font_glyph(face_ptr face, unsigned index) @@ -91,7 +91,7 @@ private: typedef boost::shared_ptr glyph_ptr; -class font_face : boost::noncopyable +class font_face : mapnik::noncopyable { public: font_face(FT_Face face) @@ -145,7 +145,7 @@ private: FT_Face face_; }; -class MAPNIK_DECL font_face_set : private boost::noncopyable +class MAPNIK_DECL font_face_set : private mapnik::noncopyable { public: font_face_set(void) @@ -200,7 +200,7 @@ private: }; // FT_Stroker wrapper -class stroker : boost::noncopyable +class stroker : mapnik::noncopyable { public: explicit stroker(FT_Stroker s) @@ -264,7 +264,7 @@ private: }; template -class MAPNIK_DECL face_manager : private boost::noncopyable +class MAPNIK_DECL face_manager : private mapnik::noncopyable { typedef T font_engine_type; typedef std::map face_ptr_cache_type; @@ -351,9 +351,9 @@ private: }; template -struct text_renderer : private boost::noncopyable +struct text_renderer : private mapnik::noncopyable { - struct glyph_t : boost::noncopyable + struct glyph_t : mapnik::noncopyable { FT_Glyph image; char_properties *properties; diff --git a/include/mapnik/formatting/registry.hpp b/include/mapnik/formatting/registry.hpp index ef0f2c978..5e77ca006 100644 --- a/include/mapnik/formatting/registry.hpp +++ b/include/mapnik/formatting/registry.hpp @@ -25,9 +25,7 @@ // mapnik #include #include - -// boost -#include +#include // stl #include @@ -41,7 +39,7 @@ namespace formatting typedef node_ptr (*from_xml_function_ptr)(xml_node const& xml); class registry : public singleton, - private boost::noncopyable + private mapnik::noncopyable { public: registry(); diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 2dcc0aeb9..aecc4536d 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -26,10 +26,10 @@ // mapnik #include #include +#include // boost #include -#include #include namespace mapnik { @@ -42,7 +42,7 @@ enum eGeomType { }; template class Container=vertex_vector> -class geometry : private::boost::noncopyable +class geometry : private::mapnik::noncopyable { public: typedef T coord_type; diff --git a/include/mapnik/grid/grid_rasterizer.hpp b/include/mapnik/grid/grid_rasterizer.hpp index 43fa30b72..9cdbf2724 100644 --- a/include/mapnik/grid/grid_rasterizer.hpp +++ b/include/mapnik/grid/grid_rasterizer.hpp @@ -23,12 +23,12 @@ #ifndef MAPNIK_GRID_RASTERIZER_HPP #define MAPNIK_GRID_RASTERIZER_HPP -#include +#include #include "agg_rasterizer_scanline_aa.h" namespace mapnik { -struct grid_rasterizer : agg::rasterizer_scanline_aa<>, boost::noncopyable {}; +struct grid_rasterizer : agg::rasterizer_scanline_aa<>, mapnik::noncopyable {}; } diff --git a/include/mapnik/grid/grid_renderer.hpp b/include/mapnik/grid/grid_renderer.hpp index 55e9cd901..6db0581a8 100644 --- a/include/mapnik/grid/grid_renderer.hpp +++ b/include/mapnik/grid/grid_renderer.hpp @@ -31,9 +31,9 @@ #include #include // for all symbolizers #include +#include // boost -#include #include // FIXME @@ -52,7 +52,7 @@ struct grid_rasterizer; template class MAPNIK_DECL grid_renderer : public feature_style_processor >, - private boost::noncopyable + private mapnik::noncopyable { public: diff --git a/include/mapnik/hextree.hpp b/include/mapnik/hextree.hpp index 9d399188c..20aa7e689 100644 --- a/include/mapnik/hextree.hpp +++ b/include/mapnik/hextree.hpp @@ -26,9 +26,9 @@ // mapnik #include #include +#include // boost -#include #include #include #if BOOST_VERSION >= 104600 @@ -60,7 +60,7 @@ struct RGBAPolicy }; template -class hextree : private boost::noncopyable +class hextree : private mapnik::noncopyable { struct node { diff --git a/include/mapnik/json/feature_collection_grammar.hpp b/include/mapnik/json/feature_collection_grammar.hpp index 6bd86590b..491a9ace1 100644 --- a/include/mapnik/json/feature_collection_grammar.hpp +++ b/include/mapnik/json/feature_collection_grammar.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include // spirit::qi #include @@ -88,7 +89,7 @@ struct feature_collection_grammar : > lit(']') ; - feature = eps[_a = construct(new_(ctx_,generate_id_()))] + feature = eps[_a = construct(new_(ctx_,generate_id_()))] >> feature_g(*_a)[push_back(_r1,_a)] ; diff --git a/include/mapnik/json/feature_collection_parser.hpp b/include/mapnik/json/feature_collection_parser.hpp index f3805a621..5238f37a0 100644 --- a/include/mapnik/json/feature_collection_parser.hpp +++ b/include/mapnik/json/feature_collection_parser.hpp @@ -27,10 +27,11 @@ #include #include #include +#include // boost #include -#include + // stl #include @@ -39,7 +40,7 @@ namespace mapnik { namespace json { template struct feature_collection_grammar; template -class feature_collection_parser : private boost::noncopyable +class feature_collection_parser : private mapnik::noncopyable { typedef Iterator iterator_type; typedef mapnik::Feature feature_type; diff --git a/include/mapnik/json/geojson_generator.hpp b/include/mapnik/json/geojson_generator.hpp index 360272f11..36c587c3b 100644 --- a/include/mapnik/json/geojson_generator.hpp +++ b/include/mapnik/json/geojson_generator.hpp @@ -25,8 +25,9 @@ #include #include +#include + #include -#include #include namespace mapnik { namespace json { @@ -36,7 +37,7 @@ namespace mapnik { namespace json { template struct feature_generator_grammar; template struct multi_geometry_generator_grammar; -class MAPNIK_DECL feature_generator : private boost::noncopyable +class MAPNIK_DECL feature_generator : private mapnik::noncopyable { typedef std::back_insert_iterator sink_type; public: @@ -47,7 +48,7 @@ private: boost::scoped_ptr > grammar_; }; -class MAPNIK_DECL geometry_generator : private boost::noncopyable +class MAPNIK_DECL geometry_generator : private mapnik::noncopyable { typedef std::back_insert_iterator sink_type; public: @@ -60,7 +61,7 @@ private: #else -class MAPNIK_DECL feature_generator : private boost::noncopyable +class MAPNIK_DECL feature_generator : private mapnik::noncopyable { public: feature_generator() {} @@ -68,7 +69,7 @@ public: bool generate(std::string & geojson, mapnik::Feature const& f); }; -class MAPNIK_DECL geometry_generator : private boost::noncopyable +class MAPNIK_DECL geometry_generator : private mapnik::noncopyable { public: geometry_generator() {} diff --git a/include/mapnik/json/geometry_parser.hpp b/include/mapnik/json/geometry_parser.hpp index 851887714..76985f9a5 100644 --- a/include/mapnik/json/geometry_parser.hpp +++ b/include/mapnik/json/geometry_parser.hpp @@ -26,10 +26,11 @@ // mapnik #include #include +#include // boost #include -#include + // stl //#include @@ -40,7 +41,7 @@ template struct geometry_grammar; MAPNIK_DECL bool from_geojson(std::string const& json, boost::ptr_vector & paths); template -class MAPNIK_DECL geometry_parser : private boost::noncopyable +class MAPNIK_DECL geometry_parser : private mapnik::noncopyable { typedef Iterator iterator_type; public: diff --git a/include/mapnik/label_collision_detector.hpp b/include/mapnik/label_collision_detector.hpp index b4256bb6b..2db67d48f 100644 --- a/include/mapnik/label_collision_detector.hpp +++ b/include/mapnik/label_collision_detector.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include // stl #include @@ -63,7 +64,7 @@ private: }; // quad_tree based label collision detector -class label_collision_detector2 : boost::noncopyable +class label_collision_detector2 : mapnik::noncopyable { typedef quad_tree > tree_t; tree_t tree_; @@ -97,7 +98,7 @@ public: }; // quad_tree based label collision detector with seperate check/insert -class label_collision_detector3 : boost::noncopyable +class label_collision_detector3 : mapnik::noncopyable { typedef quad_tree< box2d > tree_t; tree_t tree_; @@ -135,7 +136,7 @@ public: //quad tree based label collision detector so labels dont appear within a given distance -class label_collision_detector4 : boost::noncopyable +class label_collision_detector4 : mapnik::noncopyable { public: struct label diff --git a/include/mapnik/mapped_memory_cache.hpp b/include/mapnik/mapped_memory_cache.hpp index a8144a7c0..6b53481c1 100644 --- a/include/mapnik/mapped_memory_cache.hpp +++ b/include/mapnik/mapped_memory_cache.hpp @@ -26,9 +26,9 @@ // mapnik #include #include +#include // boost -#include #include #include #include @@ -43,7 +43,7 @@ typedef boost::shared_ptr mapped_region_ptr; struct MAPNIK_DECL mapped_memory_cache : public singleton, - private boost::noncopyable + private mapnik::noncopyable { friend class CreateStatic; boost::unordered_map cache_; diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index c882727a3..aac1a3660 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -29,12 +29,12 @@ #include #include #include +#include // agg #include "agg_path_storage.h" // boost -#include #include #include #include @@ -55,7 +55,7 @@ typedef boost::shared_ptr image_ptr; * A class to hold either vector or bitmap marker data. This allows these to be treated equally * in the image caches and most of the render paths. */ -class marker: private boost::noncopyable +class marker: private mapnik::noncopyable { public: marker() diff --git a/include/mapnik/marker_cache.hpp b/include/mapnik/marker_cache.hpp index e97d09ca8..eca2decd3 100644 --- a/include/mapnik/marker_cache.hpp +++ b/include/mapnik/marker_cache.hpp @@ -26,9 +26,9 @@ // mapnik #include #include +#include // boost -#include #include #include #include @@ -43,7 +43,7 @@ typedef boost::shared_ptr marker_ptr; class MAPNIK_DECL marker_cache : public singleton , - private boost::noncopyable + private mapnik::noncopyable { friend class CreateUsingNew; private: diff --git a/include/mapnik/markers_placement.hpp b/include/mapnik/markers_placement.hpp index 74b35011a..eddedafe3 100644 --- a/include/mapnik/markers_placement.hpp +++ b/include/mapnik/markers_placement.hpp @@ -30,9 +30,7 @@ #include #include //round #include - -// boost -#include +#include // agg #include "agg_basics.h" @@ -48,7 +46,7 @@ namespace mapnik { template -class markers_placement : boost::noncopyable +class markers_placement : mapnik::noncopyable { public: /** Constructor for markers_placement object. diff --git a/include/mapnik/octree.hpp b/include/mapnik/octree.hpp index 5535f2747..c2ec49f2c 100644 --- a/include/mapnik/octree.hpp +++ b/include/mapnik/octree.hpp @@ -26,9 +26,7 @@ // mapnik #include #include - -// boost -#include +#include // stl #include @@ -51,7 +49,7 @@ struct RGBPolicy }; template -class octree : private boost::noncopyable +class octree : private mapnik::noncopyable { struct node { diff --git a/include/mapnik/palette.hpp b/include/mapnik/palette.hpp index 703e38c02..8617c5735 100644 --- a/include/mapnik/palette.hpp +++ b/include/mapnik/palette.hpp @@ -26,9 +26,9 @@ // mapnik #include #include +#include // boost -#include #include // stl @@ -126,7 +126,7 @@ struct rgba typedef boost::unordered_map rgba_hash_table; -class MAPNIK_DECL rgba_palette : private boost::noncopyable { +class MAPNIK_DECL rgba_palette : private mapnik::noncopyable { public: enum palette_type { PALETTE_RGBA = 0, PALETTE_RGB = 1, PALETTE_ACT = 2 }; diff --git a/include/mapnik/placement_finder.hpp b/include/mapnik/placement_finder.hpp index fca15958b..9be885c72 100644 --- a/include/mapnik/placement_finder.hpp +++ b/include/mapnik/placement_finder.hpp @@ -30,6 +30,7 @@ #include #include #include +#include // agg @@ -54,7 +55,7 @@ typedef label_collision_detector4 DetectorType; template -class placement_finder : boost::noncopyable +class placement_finder : mapnik::noncopyable { public: placement_finder(Feature const& feature, diff --git a/include/mapnik/plugin.hpp b/include/mapnik/plugin.hpp index ef7a84d4d..8058f1483 100644 --- a/include/mapnik/plugin.hpp +++ b/include/mapnik/plugin.hpp @@ -23,8 +23,8 @@ #ifndef MAPNIK_PLUGIN_HPP #define MAPNIK_PLUGIN_HPP -// boost -#include +// mapnik +#include // stl #include @@ -34,7 +34,7 @@ namespace mapnik { -class PluginInfo : boost::noncopyable +class PluginInfo : mapnik::noncopyable { private: std::string name_; diff --git a/include/mapnik/pool.hpp b/include/mapnik/pool.hpp index efe338ce9..fe0572687 100644 --- a/include/mapnik/pool.hpp +++ b/include/mapnik/pool.hpp @@ -26,10 +26,10 @@ // mapnik #include #include +#include // boost #include -#include #ifdef MAPNIK_THREADSAFE #include #endif @@ -65,7 +65,7 @@ private: }; template class Creator> -class Pool : private boost::noncopyable +class Pool : private mapnik::noncopyable { typedef boost::shared_ptr HolderType; typedef std::deque ContType; diff --git a/include/mapnik/processed_text.hpp b/include/mapnik/processed_text.hpp index 54c2958e5..734300d89 100644 --- a/include/mapnik/processed_text.hpp +++ b/include/mapnik/processed_text.hpp @@ -26,11 +26,12 @@ #include #include #include +#include namespace mapnik { -class processed_text : boost::noncopyable +class processed_text : mapnik::noncopyable { public: class processed_expression diff --git a/include/mapnik/proj_transform.hpp b/include/mapnik/proj_transform.hpp index 607e99fb9..f238fc6e8 100644 --- a/include/mapnik/proj_transform.hpp +++ b/include/mapnik/proj_transform.hpp @@ -26,13 +26,11 @@ // mapnik #include #include - -// boost -#include +#include namespace mapnik { -class MAPNIK_DECL proj_transform : private boost::noncopyable +class MAPNIK_DECL proj_transform : private mapnik::noncopyable { public: proj_transform(projection const& source, diff --git a/include/mapnik/quad_tree.hpp b/include/mapnik/quad_tree.hpp index 9496122a3..3bbcbc465 100644 --- a/include/mapnik/quad_tree.hpp +++ b/include/mapnik/quad_tree.hpp @@ -25,10 +25,10 @@ // mapnik #include +#include // boost #include -#include // stl #include @@ -37,7 +37,7 @@ namespace mapnik { template -class quad_tree : boost::noncopyable +class quad_tree : mapnik::noncopyable { struct node { diff --git a/include/mapnik/raster.hpp b/include/mapnik/raster.hpp index e4b4ec288..4b1ce1cfb 100644 --- a/include/mapnik/raster.hpp +++ b/include/mapnik/raster.hpp @@ -26,12 +26,10 @@ // mapnik #include #include - -// boost -#include +#include namespace mapnik { -class raster : private boost::noncopyable +class raster : private mapnik::noncopyable { public: box2d ext_; diff --git a/include/mapnik/simplify_converter.hpp b/include/mapnik/simplify_converter.hpp index 2476311d2..a25cd7479 100644 --- a/include/mapnik/simplify_converter.hpp +++ b/include/mapnik/simplify_converter.hpp @@ -5,6 +5,7 @@ #include #include #include +#include // STL #include @@ -17,7 +18,7 @@ namespace mapnik { -struct weighted_vertex : private boost::noncopyable +struct weighted_vertex : private mapnik::noncopyable { vertex2d coord; double weight; diff --git a/include/mapnik/svg/output/svg_generator.hpp b/include/mapnik/svg/output/svg_generator.hpp index 973f32c75..bd5b3fffd 100644 --- a/include/mapnik/svg/output/svg_generator.hpp +++ b/include/mapnik/svg/output/svg_generator.hpp @@ -30,9 +30,8 @@ #include #include #include +#include -// boost -#include namespace mapnik { namespace svg { @@ -43,7 +42,7 @@ namespace mapnik { namespace svg { * structure. */ template - class svg_generator : private boost::noncopyable + class svg_generator : private mapnik::noncopyable { typedef svg::svg_root_attributes_grammar root_attributes_grammar; typedef svg::svg_rect_attributes_grammar rect_attributes_grammar; diff --git a/include/mapnik/svg/output/svg_renderer.hpp b/include/mapnik/svg/output/svg_renderer.hpp index bcde8d37c..05ebe356d 100644 --- a/include/mapnik/svg/output/svg_renderer.hpp +++ b/include/mapnik/svg/output/svg_renderer.hpp @@ -28,6 +28,7 @@ #include #include #include +#include // stl #include @@ -39,7 +40,7 @@ namespace mapnik // can target many other output destinations besides streams. template class MAPNIK_DECL svg_renderer : public feature_style_processor >, - private boost::noncopyable + private mapnik::noncopyable { public: typedef svg_renderer processor_impl_type; diff --git a/include/mapnik/svg/svg_converter.hpp b/include/mapnik/svg/svg_converter.hpp index 4ba4c4bff..d67c6c2ca 100644 --- a/include/mapnik/svg/svg_converter.hpp +++ b/include/mapnik/svg/svg_converter.hpp @@ -26,9 +26,7 @@ // mapnik #include #include - -// boost -#include +#include // agg #include "agg_path_storage.h" @@ -46,7 +44,7 @@ namespace mapnik { namespace svg { template -class svg_converter : boost::noncopyable +class svg_converter : mapnik::noncopyable { public: diff --git a/include/mapnik/svg/svg_parser.hpp b/include/mapnik/svg/svg_parser.hpp index 96559b6dc..68f151bf2 100644 --- a/include/mapnik/svg/svg_parser.hpp +++ b/include/mapnik/svg/svg_parser.hpp @@ -28,9 +28,9 @@ #include #include #include +#include // boost -#include #include // stl @@ -38,7 +38,7 @@ namespace mapnik { namespace svg { - class svg_parser : private boost::noncopyable + class svg_parser : private mapnik::noncopyable { public: explicit svg_parser(svg_converter_type & path); diff --git a/include/mapnik/svg/svg_path_adapter.hpp b/include/mapnik/svg/svg_path_adapter.hpp index edf24f27b..57f38aafd 100644 --- a/include/mapnik/svg/svg_path_adapter.hpp +++ b/include/mapnik/svg/svg_path_adapter.hpp @@ -24,7 +24,7 @@ #define MAPNIK_SVG_PATH_ADAPTER_HPP // mapnik -#include +#include // agg #include "agg_math.h" @@ -40,7 +40,7 @@ namespace svg { using namespace agg; -template class path_adapter : boost::noncopyable +template class path_adapter : mapnik::noncopyable { public: typedef VertexContainer container_type; @@ -838,7 +838,7 @@ void path_adapter::translate_all_paths(double dx, double dy) } -template class vertex_stl_adapter : boost::noncopyable +template class vertex_stl_adapter : mapnik::noncopyable { public: diff --git a/include/mapnik/svg/svg_renderer_agg.hpp b/include/mapnik/svg/svg_renderer_agg.hpp index 28a9b6128..c8aa62345 100644 --- a/include/mapnik/svg/svg_renderer_agg.hpp +++ b/include/mapnik/svg/svg_renderer_agg.hpp @@ -29,9 +29,9 @@ #include #include #include +#include // boost -#include #include // agg @@ -100,7 +100,7 @@ private: }; template -class svg_renderer_agg : boost::noncopyable +class svg_renderer_agg : mapnik::noncopyable { public: typedef agg::conv_curve curved_type; diff --git a/include/mapnik/svg/svg_storage.hpp b/include/mapnik/svg/svg_storage.hpp index 4d229cd81..a0827972a 100644 --- a/include/mapnik/svg/svg_storage.hpp +++ b/include/mapnik/svg/svg_storage.hpp @@ -25,15 +25,13 @@ // mapnik #include - -// boost -#include +#include namespace mapnik { namespace svg { template -class svg_storage : boost::noncopyable +class svg_storage : mapnik::noncopyable { public: svg_storage() {} diff --git a/include/mapnik/text_path.hpp b/include/mapnik/text_path.hpp index 557519ed2..b45ae9a6c 100644 --- a/include/mapnik/text_path.hpp +++ b/include/mapnik/text_path.hpp @@ -26,12 +26,12 @@ // mapnik #include #include +#include //stl #include // boost -#include #include // uci @@ -40,7 +40,7 @@ namespace mapnik { -class string_info : private boost::noncopyable +class string_info : private mapnik::noncopyable { protected: typedef std::vector characters_t; @@ -122,7 +122,7 @@ typedef char_info const * char_info_ptr; /** List of all characters and their positions and formats for a placement. */ -class text_path : boost::noncopyable +class text_path : mapnik::noncopyable { struct character_node { diff --git a/include/mapnik/text_placements/base.hpp b/include/mapnik/text_placements/base.hpp index 477bea26d..5fbc5c8fe 100644 --- a/include/mapnik/text_placements/base.hpp +++ b/include/mapnik/text_placements/base.hpp @@ -37,7 +37,7 @@ class MAPNIK_DECL text_placements; * This placement has first to be tested by placement_finder to verify it * can actually be used. */ -class text_placement_info : boost::noncopyable +class text_placement_info : mapnik::noncopyable { public: /** Constructor. Takes the parent text_placements object as a parameter diff --git a/include/mapnik/text_placements/registry.hpp b/include/mapnik/text_placements/registry.hpp index f3bd123bf..4fc71070e 100644 --- a/include/mapnik/text_placements/registry.hpp +++ b/include/mapnik/text_placements/registry.hpp @@ -25,9 +25,7 @@ // mapnik #include #include - -// boost -#include +#include // stl #include @@ -42,7 +40,7 @@ typedef text_placements_ptr (*from_xml_function_ptr)( xml_node const& xml, fontset_map const & fontsets); class registry : public singleton, - private boost::noncopyable + private mapnik::noncopyable { public: registry(); diff --git a/include/mapnik/unicode.hpp b/include/mapnik/unicode.hpp index 2e8a64656..ae2139a5e 100644 --- a/include/mapnik/unicode.hpp +++ b/include/mapnik/unicode.hpp @@ -25,13 +25,13 @@ //mapnik #include +#include // icu #include #include // boost -#include #include // stl @@ -39,7 +39,7 @@ namespace mapnik { -class MAPNIK_DECL transcoder : private boost::noncopyable +class MAPNIK_DECL transcoder : private mapnik::noncopyable { public: explicit transcoder (std::string const& encoding); diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index 5070c0ad9..cc41f7e91 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -44,13 +44,13 @@ #include #include -#include #include // mapnik #include #include #include +#include // agg #include "agg_conv_clip_polygon.h" @@ -317,7 +317,7 @@ struct dispatcher template -struct vertex_converter : private boost::noncopyable +struct vertex_converter : private mapnik::noncopyable { typedef C conv_types; typedef B bbox_type; diff --git a/include/mapnik/vertex_vector.hpp b/include/mapnik/vertex_vector.hpp index e17a69320..44fbd7884 100644 --- a/include/mapnik/vertex_vector.hpp +++ b/include/mapnik/vertex_vector.hpp @@ -29,9 +29,9 @@ // mapnik #include +#include // boost -#include #include #include // required for memcpy with linux/g++ @@ -40,7 +40,7 @@ namespace mapnik { template -class vertex_vector : private boost::noncopyable +class vertex_vector : private mapnik::noncopyable { typedef T coord_type; typedef vertex vertex_type; diff --git a/include/mapnik/wkb.hpp b/include/mapnik/wkb.hpp index 5f546fe69..0f440aa57 100644 --- a/include/mapnik/wkb.hpp +++ b/include/mapnik/wkb.hpp @@ -25,9 +25,7 @@ // mapnik #include - -// boost -#include +#include namespace mapnik { @@ -50,7 +48,7 @@ enum wkbFormat wkbSpatiaLite=3 }; -class MAPNIK_DECL geometry_utils : private boost::noncopyable +class MAPNIK_DECL geometry_utils : private mapnik::noncopyable { public: diff --git a/include/mapnik/wkt/wkt_factory.hpp b/include/mapnik/wkt/wkt_factory.hpp index 8fc246db9..a35299b9b 100644 --- a/include/mapnik/wkt/wkt_factory.hpp +++ b/include/mapnik/wkt/wkt_factory.hpp @@ -27,8 +27,9 @@ #include #include #include +#include + // boost -#include #include #include #include @@ -42,7 +43,7 @@ MAPNIK_DECL bool from_wkt(std::string const& wkt, boost::ptr_vector= 104700 -class MAPNIK_DECL wkt_parser : boost::noncopyable +class MAPNIK_DECL wkt_parser : mapnik::noncopyable { typedef std::string::const_iterator iterator_type; public: diff --git a/plugins/input/shape/dbfile.hpp b/plugins/input/shape/dbfile.hpp index 1d6bb4473..423409e3e 100644 --- a/plugins/input/shape/dbfile.hpp +++ b/plugins/input/shape/dbfile.hpp @@ -23,9 +23,11 @@ #ifndef DBFFILE_HPP #define DBFFILE_HPP +// mapnik #include +#include + // boost -#include #include // stl @@ -48,7 +50,7 @@ struct field_descriptor }; -class dbf_file : private boost::noncopyable +class dbf_file : private mapnik::noncopyable { private: int num_records_; diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index bbfe2cd85..4f5c8cd2b 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -26,16 +26,16 @@ // mapnik #include #include +#include // boost -#include #include #include "dbfile.hpp" #include "shapefile.hpp" #include "shp_index.hpp" -struct shape_io : boost::noncopyable +struct shape_io : mapnik::noncopyable { public: enum shapeType diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index 095f2c69b..cf97a9da0 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -31,9 +31,9 @@ #include #include #include +#include // boost -#include #include #include @@ -130,7 +130,7 @@ struct shape_record using namespace boost::interprocess; -class shape_file : boost::noncopyable +class shape_file : mapnik::noncopyable { public: diff --git a/plugins/input/sqlite/sqlite_prepared.hpp b/plugins/input/sqlite/sqlite_prepared.hpp index f6bf45339..477759f5d 100644 --- a/plugins/input/sqlite/sqlite_prepared.hpp +++ b/plugins/input/sqlite/sqlite_prepared.hpp @@ -27,10 +27,10 @@ #include #include #include +#include // boost #include -#include // stl #include @@ -42,7 +42,7 @@ extern "C" { #include } -class prepared_index_statement : boost::noncopyable +class prepared_index_statement : mapnik::noncopyable { public: diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index 29ce388b7..e68e7d0ff 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include // agg #include "agg_basics.h" @@ -47,12 +48,11 @@ #include "agg_conv_clip_polyline.h" // boost -#include #include namespace { -class pattern_source : private boost::noncopyable +class pattern_source : private mapnik::noncopyable { public: pattern_source(mapnik::image_data_32 const& pattern) diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index 1b9e90540..3701ec044 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -44,6 +44,7 @@ #include #include #include +#include // cairo #include @@ -52,7 +53,6 @@ #include // boost -#include #include #include @@ -72,7 +72,7 @@ namespace mapnik { -class cairo_pattern : private boost::noncopyable +class cairo_pattern : private mapnik::noncopyable { public: cairo_pattern(image_data_32 const& data) @@ -146,7 +146,7 @@ private: Cairo::RefPtr pattern_; }; -class cairo_gradient : private boost::noncopyable +class cairo_gradient : private mapnik::noncopyable { public: cairo_gradient(const mapnik::gradient &grad, double opacity=1.0) @@ -202,7 +202,7 @@ private: }; -class cairo_face : private boost::noncopyable +class cairo_face : private mapnik::noncopyable { public: cairo_face(boost::shared_ptr const& engine, face_ptr const& face) @@ -269,7 +269,7 @@ cairo_face_ptr cairo_face_manager::get_face(face_ptr face) return entry; } -class cairo_context : private boost::noncopyable +class cairo_context : private mapnik::noncopyable { public: cairo_context(Cairo::RefPtr const& context) diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 47703651b..1b3eab6c1 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -23,6 +23,7 @@ // mapnik #include #include +#include // jpeg extern "C" @@ -32,14 +33,13 @@ extern "C" // boost #include -#include // std #include namespace mapnik { -class JpegReader : public image_reader, boost::noncopyable +class JpegReader : public image_reader, mapnik::noncopyable { private: std::string fileName_; diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 90f6e5cc3..e4af0c66c 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -27,9 +27,9 @@ #include #include #include +#include // boost -#include #include // libxml @@ -42,7 +42,7 @@ namespace mapnik { -class libxml2_loader : boost::noncopyable +class libxml2_loader : mapnik::noncopyable { public: libxml2_loader(const char *encoding = NULL, int options = DEFAULT_OPTIONS, const char *url = NULL) : diff --git a/src/load_map.cpp b/src/load_map.cpp index 1f7efe210..5ab4a1f15 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -50,6 +50,7 @@ #include #include #include +#include // boost #include @@ -71,7 +72,7 @@ namespace mapnik { using boost::optional; -class map_parser : boost::noncopyable { +class map_parser : mapnik::noncopyable { public: map_parser(bool strict, std::string const& filename = "") : strict_(strict), diff --git a/src/png_reader.cpp b/src/png_reader.cpp index dde14ed70..1e542ce0b 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -22,6 +22,7 @@ #include #include +#include extern "C" { @@ -29,11 +30,10 @@ extern "C" } #include -#include namespace mapnik { -class png_reader : public image_reader, boost::noncopyable +class png_reader : public image_reader, mapnik::noncopyable { private: std::string fileName_; diff --git a/src/rapidxml_loader.cpp b/src/rapidxml_loader.cpp index 4c0898bee..a983b7c22 100644 --- a/src/rapidxml_loader.cpp +++ b/src/rapidxml_loader.cpp @@ -32,9 +32,7 @@ #include #include #include - -// boost -#include +#include // stl #include @@ -43,7 +41,7 @@ namespace rapidxml = boost::property_tree::detail::rapidxml; namespace mapnik { -class rapidxml_loader : boost::noncopyable +class rapidxml_loader : mapnik::noncopyable { public: rapidxml_loader(const char *encoding = NULL) : diff --git a/src/wkb.cpp b/src/wkb.cpp index 2e57b8600..dfef08a69 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -27,9 +27,9 @@ #include #include #include +#include // boost -#include #include namespace mapnik @@ -37,7 +37,7 @@ namespace mapnik typedef coord_array CoordinateArray; -struct wkb_reader : boost::noncopyable +struct wkb_reader : mapnik::noncopyable { private: enum wkbByteOrder { diff --git a/utils/pgsql2sqlite/sqlite.hpp b/utils/pgsql2sqlite/sqlite.hpp index e7ce0eb1b..1266a7604 100644 --- a/utils/pgsql2sqlite/sqlite.hpp +++ b/utils/pgsql2sqlite/sqlite.hpp @@ -20,10 +20,11 @@ * *****************************************************************************/ +#include // boost #include -#include #include + //sqlite3 #include @@ -36,7 +37,7 @@ namespace mapnik { namespace sqlite { - class database : private boost::noncopyable + class database : private mapnik::noncopyable { friend class prepared_statement; @@ -73,7 +74,7 @@ namespace mapnik { namespace sqlite { typedef boost::variant value_type; typedef std::vector record_type; - class prepared_statement : boost::noncopyable + class prepared_statement : mapnik::noncopyable { struct binder : public boost::static_visitor {