mapnik/include/mapnik/feature_layer_desc.hpp

107 lines
2.6 KiB
C++
Raw Normal View History

/*****************************************************************************
2012-02-02 01:53:35 +00:00
*
* This file is part of Mapnik (c++ mapping toolkit)
*
2014-11-20 14:25:50 +00:00
* Copyright (C) 2014 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_FEATURE_LAYER_DESC_HPP
#define MAPNIK_FEATURE_LAYER_DESC_HPP
// mapnik
#include <mapnik/attribute_descriptor.hpp>
#include <mapnik/params.hpp>
// stl
2014-08-06 19:28:35 +00:00
#include <iosfwd>
#include <vector>
namespace mapnik
{
class layer_descriptor
2010-06-02 11:03:30 +00:00
{
public:
layer_descriptor(std::string const& name, std::string const& encoding)
2010-06-02 11:03:30 +00:00
: name_(name),
encoding_(encoding),
desc_ar_(),
extra_params_() {}
2010-06-02 11:03:30 +00:00
layer_descriptor(layer_descriptor const& other)
: name_(other.name_),
encoding_(other.encoding_),
desc_ar_(other.desc_ar_),
extra_params_(other.extra_params_) {}
void set_name(std::string const& name)
2010-06-02 11:03:30 +00:00
{
name_ = name;
2010-06-02 11:03:30 +00:00
}
std::string const& get_name() const
2010-06-02 11:03:30 +00:00
{
return name_;
}
void set_encoding(std::string const& encoding)
2010-06-02 11:03:30 +00:00
{
encoding_ = encoding;
2010-06-02 11:03:30 +00:00
}
2010-06-02 11:03:30 +00:00
std::string const& get_encoding() const
{
return encoding_;
}
2010-06-02 11:03:30 +00:00
void add_descriptor(attribute_descriptor const& desc)
{
desc_ar_.push_back(desc);
}
std::vector<attribute_descriptor> const& get_descriptors() const
2010-06-02 11:03:30 +00:00
{
return desc_ar_;
}
std::vector<attribute_descriptor>& get_descriptors()
2010-06-02 11:03:30 +00:00
{
return desc_ar_;
}
parameters const& get_extra_parameters() const
{
return extra_params_;
}
parameters& get_extra_parameters()
{
return extra_params_;
}
2010-06-02 11:03:30 +00:00
private:
std::string name_;
std::string encoding_;
std::vector<attribute_descriptor> desc_ar_;
parameters extra_params_;
2010-06-02 11:03:30 +00:00
};
}
#endif // MAPNIK_FEATURE_LAYER_DESC_HPP