Skip to content

Commit

Permalink
move symbolizers typedef out of rule and be explicit about including …
Browse files Browse the repository at this point in the history
…config.hpp for MAPNIK_DECL - refs #1527
  • Loading branch information
Dane Springmeyer committed Oct 10, 2012
1 parent 989b9f0 commit bf5ffd0
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 24 deletions.
1 change: 1 addition & 0 deletions include/mapnik/building_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mapnik/color.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/expression.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/debug_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef MAPNIK_DEBUG_SYMBOLIZER_HPP
#define MAPNIK_DEBUG_SYMBOLIZER_HPP

#include <mapnik/config.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL
#include <mapnik/symbolizer.hpp>

namespace mapnik
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/line_pattern_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// mapnik
#include <mapnik/symbolizer.hpp>
//#include <boost/shared_ptr.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/line_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mapnik/stroke.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/markers_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <mapnik/stroke.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/expression.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/optional.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/point_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
// mapnik
#include <mapnik/symbolizer.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/polygon_pattern_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mapnik/symbolizer.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/gamma_method.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/polygon_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <mapnik/symbolizer.hpp>
#include <mapnik/enumeration.hpp>
#include <mapnik/gamma_method.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

namespace mapnik
{
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/raster_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mapnik/symbolizer.hpp>
#include <mapnik/raster_colorizer.hpp>
#include <mapnik/image_scaling.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/shared_ptr.hpp>
Expand Down
22 changes: 6 additions & 16 deletions include/mapnik/rule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <mapnik/feature.hpp>
#include <mapnik/expression.hpp>
#include <mapnik/expression_string.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/concept_check.hpp>
Expand Down Expand Up @@ -127,12 +128,11 @@ typedef boost::variant<point_symbolizer,
markers_symbolizer,
debug_symbolizer> symbolizer;

class rule
typedef MAPNIK_DECL std::vector<symbolizer> symbolizers;

class MAPNIK_DECL rule
{
public:
typedef std::vector<symbolizer> symbolizers;
private:

std::string name_;
double min_scale_;
double max_scale_;
Expand All @@ -158,7 +158,7 @@ class rule
std::string const& get_name() const;
void append(symbolizer const& sym);
void remove_at(size_t index);
const symbolizers& get_symbolizers() const;
symbolizers const& get_symbolizers() const;
symbolizers::const_iterator begin() const;
symbolizers::const_iterator end() const;
symbolizers::iterator begin();
Expand All @@ -172,17 +172,7 @@ class rule
bool active(double scale) const;

private:

void swap(rule& rhs) throw()
{
name_=rhs.name_;
min_scale_=rhs.min_scale_;
max_scale_=rhs.max_scale_;
syms_=rhs.syms_;
filter_=rhs.filter_;
else_filter_=rhs.else_filter_;
also_filter_=rhs.also_filter_;
}
void swap(rule& rhs) throw();
};

}
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/shield_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
// mapnik
#include <mapnik/symbolizer.hpp>
#include <mapnik/text_symbolizer.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/shared_ptr.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <mapnik/image_compositing.hpp>
#include <mapnik/transform_expression.hpp>
#include <mapnik/simplify.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/array.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/mapnik/text_symbolizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <mapnik/symbolizer.hpp>
#include <mapnik/text_placements/base.hpp>
#include <mapnik/text_placements/dummy.hpp>
#include <mapnik/config.hpp> // for MAPNIK_DECL

// boost
#include <boost/shared_ptr.hpp>
Expand Down
24 changes: 18 additions & 6 deletions src/rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ rule::rule(std::string const& name,
else_filter_(false),
also_filter_(false) {}

rule::rule(const rule& rhs, bool deep_copy)
rule::rule(rule const& rhs, bool deep_copy)
: name_(rhs.name_),
min_scale_(rhs.min_scale_),
max_scale_(rhs.max_scale_),
Expand Down Expand Up @@ -176,27 +176,27 @@ void rule::remove_at(size_t index)
}
}

rule::symbolizers const& rule::get_symbolizers() const
symbolizers const& rule::get_symbolizers() const
{
return syms_;
}

rule::symbolizers::const_iterator rule::begin() const
symbolizers::const_iterator rule::begin() const
{
return syms_.begin();
}

rule::symbolizers::const_iterator rule::end() const
symbolizers::const_iterator rule::end() const
{
return syms_.end();
}

rule::symbolizers::iterator rule::begin()
symbolizers::iterator rule::begin()
{
return syms_.begin();
}

rule::symbolizers::iterator rule::end()
symbolizers::iterator rule::end()
{
return syms_.end();
}
Expand Down Expand Up @@ -236,4 +236,16 @@ bool rule::active(double scale) const
return ( scale >= min_scale_ - 1e-6 && scale < max_scale_ + 1e-6);
}

void rule::swap(rule& rhs) throw()
{
name_=rhs.name_;
min_scale_=rhs.min_scale_;
max_scale_=rhs.max_scale_;
syms_=rhs.syms_;
filter_=rhs.filter_;
else_filter_=rhs.else_filter_;
also_filter_=rhs.also_filter_;
}


}

0 comments on commit bf5ffd0

Please sign in to comment.