Empty featureset instead of invalid + bool is_empty(featureset_ptr)
This commit is contained in:
parent
20b154ae49
commit
c1117a4d33
1 changed files with 5 additions and 5 deletions
|
@ -41,21 +41,21 @@ struct MAPNIK_DECL Featureset : private util::noncopyable
|
||||||
virtual ~Featureset() {}
|
virtual ~Featureset() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MAPNIK_DECL invalid_featureset : Featureset
|
struct MAPNIK_DECL empty_featureset : Featureset
|
||||||
{
|
{
|
||||||
feature_ptr next() { return feature_ptr(); }
|
feature_ptr next() { return feature_ptr(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
using featureset_ptr = std::shared_ptr<Featureset>;
|
using featureset_ptr = std::shared_ptr<Featureset>;
|
||||||
|
|
||||||
inline featureset_ptr make_invalid_featureset()
|
inline featureset_ptr make_empty_featureset()
|
||||||
{
|
{
|
||||||
return std::make_shared<invalid_featureset>();
|
return std::make_shared<empty_featureset>();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool is_valid(featureset_ptr const& ptr)
|
inline bool is_empty(featureset_ptr const& ptr)
|
||||||
{
|
{
|
||||||
return (dynamic_cast<invalid_featureset*>(ptr.get()) == nullptr) ? true : false;
|
return (dynamic_cast<empty_featureset*>(ptr.get()) != nullptr) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mapnik
|
} // namespace mapnik
|
||||||
|
|
Loading…
Reference in a new issue