First bit stats push.

This commit is contained in:
Tom MacWright 2012-01-20 18:46:13 -05:00
parent e7fdf1fa51
commit 38aadc16af
3 changed files with 21 additions and 12 deletions

View file

@ -114,6 +114,7 @@ public:
virtual box2d<double> envelope() const=0; virtual box2d<double> envelope() const=0;
virtual boost::optional<geometry_t> get_geometry_type() const=0; virtual boost::optional<geometry_t> get_geometry_type() const=0;
virtual layer_descriptor get_descriptor() const=0; virtual layer_descriptor get_descriptor() const=0;
virtual std::map<std::string, mapnik::parameters> get_statistics() const=0;
virtual ~datasource() {}; virtual ~datasource() {};
protected: protected:
parameters params_; parameters params_;

View file

@ -45,6 +45,7 @@ public:
box2d<double> envelope() const; box2d<double> envelope() const;
boost::optional<geometry_t> get_geometry_type() const; boost::optional<geometry_t> get_geometry_type() const;
layer_descriptor get_descriptor() const; layer_descriptor get_descriptor() const;
std::map<std::string, mapnik::parameters> get_statistics() const;
size_t size() const; size_t size() const;
void clear(); void clear();
private: private:

View file

@ -24,6 +24,7 @@
// mapnik // mapnik
#include <mapnik/memory_datasource.hpp> #include <mapnik/memory_datasource.hpp>
#include <mapnik/memory_featureset.hpp> #include <mapnik/memory_featureset.hpp>
#include <mapnik/params.hpp>
#include <mapnik/feature_factory.hpp> #include <mapnik/feature_factory.hpp>
// stl // stl
#include <algorithm> #include <algorithm>
@ -108,6 +109,12 @@ layer_descriptor memory_datasource::get_descriptor() const
return desc_; return desc_;
} }
std::map<std::string, mapnik::parameters> memory_datasource::get_statistics() const
{
std::map<std::string, mapnik::parameters> _stats;
return _stats;
}
size_t memory_datasource::size() const size_t memory_datasource::size() const
{ {
return features_.size(); return features_.size();