Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef WAYLISTER_H_
00009 #define WAYLISTER_H_
00010
00011 #include "OsmDatabase.h"
00012 #include <string>
00013 #include "../elements/osmelements.h"
00014 #include "../psql/psql.h"
00015 #include <vector>
00016 #include <map>
00017
00018 namespace osmdb
00019 {
00020
00025 class WayLister
00026 {
00027 public:
00034 WayLister(OsmDatabase& db, std::multimap<std::string, std::string> const& attributes, unsigned int fetch_size = 100000);
00039 std::map<osm::Way, std::multimap<osm::Node, osm::Way, osm::LtByID>, osm::LtByID> const& get_current_connected_ways() const;
00043 void next();
00047 void reset();
00053 bool end();
00054 virtual ~WayLister();
00055 private:
00056 OsmDatabase& db;
00057 psql::Cursor<psql::BindTypes<>, psql::RetTypes<int64_t, int64_t, double, double, int64_t, std::string, std::string, int> > get_way_descr;
00058 std::vector<std::tuple<int64_t, int64_t, double, double, int64_t, std::string, std::string, int> > rest;
00059 std::map<osm::Way, std::multimap<osm::Node, osm::Way, osm::LtByID>, osm::LtByID> current_connected_ways;
00060 boost::property_tree::ptree get_entries(std::multimap<std::string, std::string> const& attributes);
00061 bool done;
00062 unsigned int fetch_size;
00063 };
00064
00065 }
00066 #endif