This commit is contained in:
artemp 2012-12-20 16:36:16 +00:00
parent 6590225ce0
commit 6512d2873a
2 changed files with 18 additions and 17 deletions

View file

@ -47,7 +47,7 @@ public:
std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
layer(layer const& l);
layer& operator=(layer const& l);
layer& operator=(layer const& rhs);
bool operator==(layer const& other) const;
/*!
@ -197,7 +197,7 @@ public:
int buffer_size() const;
~layer();
private:
void swap(const layer& other);
void swap(layer& other);
std::string name_;
std::string srs_;

View file

@ -58,7 +58,7 @@ layer::layer(const layer& rhs)
buffer_size_(rhs.buffer_size_),
maximum_extent_(rhs.maximum_extent_) {}
layer& layer::operator=(const layer& rhs)
layer& layer::operator=(layer const& rhs)
{
layer tmp(rhs);
swap(tmp);
@ -70,21 +70,22 @@ bool layer::operator==(layer const& other) const
return (this == &other);
}
void layer::swap(const layer& rhs)
void layer::swap(layer& rhs)
{
name_=rhs.name_;
srs_ = rhs.srs_;
min_zoom_=rhs.min_zoom_;
max_zoom_=rhs.max_zoom_;
active_=rhs.active_;
queryable_=rhs.queryable_;
clear_label_cache_ = rhs.clear_label_cache_;
cache_features_ = rhs.cache_features_;
group_by_ = rhs.group_by_;
styles_=rhs.styles_;
ds_=rhs.ds_;
buffer_size_ = rhs.buffer_size_;
maximum_extent_ = rhs.maximum_extent_;
using std::swap;
swap(name_, rhs.name_);
swap(srs_, rhs.srs_);
swap(min_zoom_, rhs.min_zoom_);
swap(max_zoom_, rhs.max_zoom_);
swap(active_, rhs.active_);
swap(queryable_, rhs.queryable_);
swap(clear_label_cache_, rhs.clear_label_cache_);
swap(cache_features_, rhs.cache_features_);
swap(group_by_, rhs.group_by_);
swap(styles_, rhs.styles_);
swap(ds_, rhs.ds_);
swap(buffer_size_, rhs.buffer_size_);
swap(maximum_extent_, rhs.maximum_extent_);
}
layer::~layer() {}