+ return bvalue by const ref
+ feature impl update
This commit is contained in:
parent
657cfa20d3
commit
cb070f7b1d
1 changed files with 3 additions and 10 deletions
|
@ -30,8 +30,6 @@
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
static mapnik::value _null_value;
|
|
||||||
|
|
||||||
struct attribute
|
struct attribute
|
||||||
{
|
{
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
@ -39,16 +37,11 @@ struct attribute
|
||||||
: name_(name) {}
|
: name_(name) {}
|
||||||
|
|
||||||
template <typename V ,typename F>
|
template <typename V ,typename F>
|
||||||
V value(F const& f) const
|
V const& value(F const& f) const
|
||||||
{
|
{
|
||||||
typedef typename F::const_iterator const_iterator;
|
return f.get(name_);
|
||||||
const_iterator itr = f.find(name_);
|
|
||||||
if (itr != f.end())
|
|
||||||
{
|
|
||||||
return itr->second;
|
|
||||||
}
|
|
||||||
return _null_value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const& name() const { return name_;}
|
std::string const& name() const { return name_;}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue