Revert "+ use boost::move to emulate 'move' semantics"

This reverts commit fe9ff21ba9.
This commit is contained in:
Dane Springmeyer 2013-02-21 12:50:53 -08:00
parent 1ad61367bf
commit a645eb9a21
2 changed files with 7 additions and 24 deletions

View file

@ -51,7 +51,6 @@
#include <boost/variant/static_visitor.hpp> #include <boost/variant/static_visitor.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/concept_check.hpp> #include <boost/concept_check.hpp>
#include <boost/container/vector.hpp>
// stl // stl
#include <vector> #include <vector>
@ -372,7 +371,8 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
attribute_collector collector(names); attribute_collector collector(names);
double filt_factor = 1.0; double filt_factor = 1.0;
directive_collector d_collector(filt_factor); directive_collector d_collector(filt_factor);
boost::container::vector<rule_cache> rule_caches; boost::ptr_vector<rule_cache> rule_caches;
// iterate through all named styles collecting active styles and attribute names // iterate through all named styles collecting active styles and attribute names
BOOST_FOREACH(std::string const& style_name, style_names) BOOST_FOREACH(std::string const& style_name, style_names)
{ {
@ -388,12 +388,12 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
std::vector<rule> const& rules = style->get_rules(); std::vector<rule> const& rules = style->get_rules();
bool active_rules = false; bool active_rules = false;
rule_cache rc; std::auto_ptr<rule_cache> rc(new rule_cache);
BOOST_FOREACH(rule const& r, rules) BOOST_FOREACH(rule const& r, rules)
{ {
if (r.active(scale_denom)) if (r.active(scale_denom))
{ {
rc.add_rule(r); rc->add_rule(r);
active_rules = true; active_rules = true;
if (ds->type() == datasource::Vector) if (ds->type() == datasource::Vector)
{ {
@ -404,7 +404,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
} }
if (active_rules) if (active_rules)
{ {
rule_caches.push_back(boost::move(rc)); rule_caches.push_back(rc);
active_styles.push_back(&(*style)); active_styles.push_back(&(*style));
} }
} }

View file

@ -29,7 +29,6 @@
// boost // boost
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/move/utility.hpp>
// stl // stl
#include <vector> #include <vector>
@ -39,8 +38,6 @@ namespace mapnik
class rule_cache class rule_cache
{ {
private:
BOOST_MOVABLE_BUT_NOT_COPYABLE(rule_cache)
public: public:
typedef std::vector<rule const*> rule_ptrs; typedef std::vector<rule const*> rule_ptrs;
rule_cache() rule_cache()
@ -48,20 +45,6 @@ public:
else_rules_(), else_rules_(),
also_rules_() {} also_rules_() {}
rule_cache(BOOST_RV_REF(rule_cache) rhs) // move ctor
: if_rules_(boost::move(rhs.if_rules_)),
else_rules_(boost::move(rhs.else_rules_)),
also_rules_(boost::move(rhs.also_rules_))
{}
rule_cache& operator=(BOOST_RV_REF(rule_cache) rhs) // move assign
{
std::swap(if_rules_, rhs.if_rules_);
std::swap(else_rules_,rhs.else_rules_);
std::swap(also_rules_, rhs.also_rules_);
return *this;
}
void add_rule(rule const& r) void add_rule(rule const& r)
{ {
if (r.has_else_filter()) if (r.has_else_filter())
@ -82,12 +65,12 @@ public:
{ {
return if_rules_; return if_rules_;
} }
rule_ptrs const& get_else_rules() const rule_ptrs const& get_else_rules() const
{ {
return else_rules_; return else_rules_;
} }
rule_ptrs const& get_also_rules() const rule_ptrs const& get_also_rules() const
{ {
return also_rules_; return also_rules_;