From 14fecfd7787db033752660b37efe68487bd1513b Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 4 Feb 2013 17:59:09 +0000 Subject: [PATCH] + cleanup style.. --- bindings/python/mapnik_symbolizer.cpp | 126 ++++++++++++++------------ 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/bindings/python/mapnik_symbolizer.cpp b/bindings/python/mapnik_symbolizer.cpp index a849ddc1c..509c94d88 100644 --- a/bindings/python/mapnik_symbolizer.cpp +++ b/bindings/python/mapnik_symbolizer.cpp @@ -45,74 +45,81 @@ using mapnik::markers_symbolizer; struct get_symbolizer_type : public boost::static_visitor { public: - get_symbolizer_type() {} - - std::string operator () ( const point_symbolizer & /*sym*/ ) - { - return "point"; - } - - std::string operator () ( const line_symbolizer & /*sym*/ ) - { - return "line"; - } - - std::string operator () ( const line_pattern_symbolizer & /*sym*/ ) - { - return "line_pattern"; - } - - std::string operator () ( const polygon_symbolizer & /*sym*/ ) - { - return "polygon"; - } - - std::string operator () ( const polygon_pattern_symbolizer & /*sym*/ ) - { - return "polygon_pattern"; - } - - std::string operator () ( const raster_symbolizer & /*sym*/ ) - { - return "raster"; - } - - std::string operator () ( const shield_symbolizer & /*sym*/ ) - { - return "shield"; - } - - std::string operator () ( const text_symbolizer & /*sym*/ ) - { - return "text"; - } - - std::string operator () ( const building_symbolizer & /*sym*/ ) - { - return "building"; - } - - std::string operator () ( const markers_symbolizer & /*sym*/ ) - { - return "markers"; - } - - template - std::string operator() ( Symbolizer const& sym) + std::string operator () (point_symbolizer const& sym) const { boost::ignore_unused_variable_warning(sym); - return "unknown"; + return std::string("point"); + } + + std::string operator () ( line_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("line"); + } + + std::string operator () (line_pattern_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("line_pattern"); + } + + std::string operator () (polygon_symbolizer const& sym ) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("polygon"); + } + + std::string operator () (polygon_pattern_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("polygon_pattern"); + } + + std::string operator () (raster_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("raster"); + } + + std::string operator () (shield_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("shield"); + } + + std::string operator () (text_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("text"); + } + + std::string operator () (building_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("building"); + } + + std::string operator () (markers_symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("markers"); + } + + template + std::string operator() ( Symbolizer const& sym) const + { + boost::ignore_unused_variable_warning(sym); + return std::string("unknown"); } }; -std::string get_symbol_type(const symbolizer& symbol) +std::string get_symbol_type(symbolizer const& symbol) { - get_symbolizer_type serializer; - std::string type = boost::apply_visitor( serializer, symbol ); + std::string type = boost::apply_visitor( get_symbolizer_type(), symbol); return type; } -const point_symbolizer& point_( const symbolizer& symbol ) +const point_symbolizer& point_(symbolizer const& symbol ) { return boost::get(symbol); } @@ -201,4 +208,3 @@ void export_symbolizer() return_value_policy()) ; } -