Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Dec 20, 2012
1 parent 6590225 commit 6512d28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions include/mapnik/layer.hpp
Expand Up @@ -47,7 +47,7 @@ class MAPNIK_DECL layer
std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"); std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");


layer(layer const& l); layer(layer const& l);
layer& operator=(layer const& l); layer& operator=(layer const& rhs);
bool operator==(layer const& other) const; bool operator==(layer const& other) const;


/*! /*!
Expand Down Expand Up @@ -197,7 +197,7 @@ class MAPNIK_DECL layer
int buffer_size() const; int buffer_size() const;
~layer(); ~layer();
private: private:
void swap(const layer& other); void swap(layer& other);


std::string name_; std::string name_;
std::string srs_; std::string srs_;
Expand Down
33 changes: 17 additions & 16 deletions src/layer.cpp
Expand Up @@ -58,7 +58,7 @@ layer::layer(const layer& rhs)
buffer_size_(rhs.buffer_size_), buffer_size_(rhs.buffer_size_),
maximum_extent_(rhs.maximum_extent_) {} maximum_extent_(rhs.maximum_extent_) {}


layer& layer::operator=(const layer& rhs) layer& layer::operator=(layer const& rhs)
{ {
layer tmp(rhs); layer tmp(rhs);
swap(tmp); swap(tmp);
Expand All @@ -70,21 +70,22 @@ bool layer::operator==(layer const& other) const
return (this == &other); return (this == &other);
} }


void layer::swap(const layer& rhs) void layer::swap(layer& rhs)
{ {
name_=rhs.name_; using std::swap;
srs_ = rhs.srs_; swap(name_, rhs.name_);
min_zoom_=rhs.min_zoom_; swap(srs_, rhs.srs_);
max_zoom_=rhs.max_zoom_; swap(min_zoom_, rhs.min_zoom_);
active_=rhs.active_; swap(max_zoom_, rhs.max_zoom_);
queryable_=rhs.queryable_; swap(active_, rhs.active_);
clear_label_cache_ = rhs.clear_label_cache_; swap(queryable_, rhs.queryable_);
cache_features_ = rhs.cache_features_; swap(clear_label_cache_, rhs.clear_label_cache_);
group_by_ = rhs.group_by_; swap(cache_features_, rhs.cache_features_);
styles_=rhs.styles_; swap(group_by_, rhs.group_by_);
ds_=rhs.ds_; swap(styles_, rhs.styles_);
buffer_size_ = rhs.buffer_size_; swap(ds_, rhs.ds_);
maximum_extent_ = rhs.maximum_extent_; swap(buffer_size_, rhs.buffer_size_);
swap(maximum_extent_, rhs.maximum_extent_);
} }


layer::~layer() {} layer::~layer() {}
Expand Down

0 comments on commit 6512d28

Please sign in to comment.