From 1daa91e07f86fd4e42d4f319ced7d1bbd139d09b Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Fri, 19 May 2006 08:59:50 +0000 Subject: [PATCH] added set_name method --- include/layer.hpp | 105 ++++++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/include/layer.hpp b/include/layer.hpp index f161ba3f3..b8fa17f8b 100644 --- a/include/layer.hpp +++ b/include/layer.hpp @@ -34,60 +34,63 @@ namespace mapnik { class MAPNIK_DECL Layer { - friend class boost::serialization::access; - template - void serialize(Archive & ar, const unsigned int /*version*/) - { - ar & boost::serialization::make_nvp("name",name_) - & boost::serialization::make_nvp("params",params_) - & boost::serialization::make_nvp("min_zoom",minZoom_) - & boost::serialization::make_nvp("max_zoom",maxZoom_) - & boost::serialization::make_nvp("active",active_) - & boost::serialization::make_nvp("selectable",selectable_) - & boost::serialization::make_nvp("styles",styles_) - ; - } - parameters params_; - std::string name_; - double minZoom_; - double maxZoom_; - bool active_; - bool selectable_; - mutable datasource_p ds_; - std::vector styles_; - std::string selection_style_; - mutable std::vector > selection_; + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /*version*/) + { + ar & boost::serialization::make_nvp("name",name_) + & boost::serialization::make_nvp("params",params_) + & boost::serialization::make_nvp("min_zoom",minZoom_) + & boost::serialization::make_nvp("max_zoom",maxZoom_) + & boost::serialization::make_nvp("active",active_) + & boost::serialization::make_nvp("selectable",selectable_) + & boost::serialization::make_nvp("styles",styles_) + ; + } + parameters params_; + std::string name_; + double minZoom_; + double maxZoom_; + bool active_; + bool selectable_; + + std::vector styles_; + std::string selection_style_; + + mutable datasource_p ds_; + mutable std::vector > selection_; public: - Layer(); - explicit Layer(const parameters& params); - Layer(Layer const& l); - Layer& operator=(Layer const& l); - bool operator==(Layer const& other) const; - parameters const& params() const; - const std::string& name() const; - void add_style(std::string const& stylename); - std::vector const& styles() const; - void selection_style(const std::string& name); - const std::string& selection_style() const; - void setMinZoom(double minZoom); - void setMaxZoom(double maxZoom); - double getMinZoom() const; - double getMaxZoom() const; - void setActive(bool active); - bool isActive() const; - void setSelectable(bool selectable); - bool isSelectable() const; - bool isVisible(double scale) const; - void add_to_selection(boost::shared_ptr& feature) const; - std::vector >& selection() const; - void clear_selection() const; - void set_datasource(datasource_p const& ds); - datasource_p const& datasource() const; - Envelope envelope() const; - virtual ~Layer(); + Layer(); + explicit Layer(const parameters& params); + Layer(Layer const& l); + Layer& operator=(Layer const& l); + bool operator==(Layer const& other) const; + parameters const& params() const; + void set_name(std::string const& name); + const std::string& name() const; + void add_style(std::string const& stylename); + std::vector const& styles() const; + void selection_style(const std::string& name); + const std::string& selection_style() const; + void setMinZoom(double minZoom); + void setMaxZoom(double maxZoom); + double getMinZoom() const; + double getMaxZoom() const; + void setActive(bool active); + bool isActive() const; + void setSelectable(bool selectable); + bool isSelectable() const; + bool isVisible(double scale) const; + void add_to_selection(boost::shared_ptr& feature) const; + std::vector >& selection() const; + void clear_selection() const; + void set_datasource(datasource_p const& ds); + datasource_p const& datasource() const; + Envelope envelope() const; + virtual ~Layer(); private: - void swap(const Layer& other); + void swap(const Layer& other); }; }