1#ifndef OSMSCOUT_ROUTENODEDATAFILE_H
2#define OSMSCOUT_ROUTENODEDATAFILE_H
51 std::unordered_map<Id,RouteNodeRef> nodeMap;
58 using ValueCache = Cache<Id, IndexPage>;
62 std::string datafilename;
66 std::map<Pixel,IndexEntry> index;
68 mutable FileScanner scanner;
69 mutable ValueCache cache;
70 mutable std::mutex accessMutex;
71 mutable Magnification magnification;
74 bool LoadIndexPage(
const osmscout::Pixel& tile,
75 ValueCache::CacheRef& cacheRef)
const;
76 bool GetIndexPage(
const osmscout::Pixel& tile,
77 ValueCache::CacheRef& cacheRef)
const;
84 const std::string& path,
85 bool memoryMapedData);
97 template<
typename IteratorIn>
98 bool Get(IteratorIn
begin, IteratorIn end,
size_t size,
99 std::vector<RouteNodeRef>&
data)
const
103 for (IteratorIn idIter=
begin; idIter!=end; ++idIter) {
112 if (!GetIndexPage(tile,
117 auto node=cacheRef->value.find(scanner,
124 data.push_back(node);
130 template<
typename IteratorIn>
131 bool Get(IteratorIn
begin, IteratorIn end,
size_t ,
132 std::unordered_map<Id,RouteNodeRef>& dataMap)
const
134 for (IteratorIn idIter=
begin; idIter!=end; ++idIter) {
143 if (!GetIndexPage(tile,
148 auto node=cacheRef->value.find(scanner,
#define OSMSCOUT_API
Definition CoreImportExport.h:45
const GeoCoord coord
Definition RouteStateAgent.h:49
bool Open(const TypeConfigRef &typeConfig, const std::string &path, bool memoryMapedData)
bool Get(Id id, RouteNodeRef &node) const
bool IsCovered(const Pixel &tile) const
bool Get(IteratorIn begin, IteratorIn end, size_t size, std::vector< RouteNodeRef > &data) const
Definition RouteNodeDataFile.h:98
TypeInfoSetConstIterator begin() const
Definition TypeInfoSet.h:180
OSMId id
We are an area.
Definition ObjectRef.h:49
bool IsCovered(const GeoCoord &coord) const
Pixel GetTile(const GeoCoord &coord) const
RoutableObjectsRef data
Definition DataAgent.h:63
RouteNodeDataFile(const std::string &datafile, size_t cacheSize)
bool Get(IteratorIn begin, IteratorIn end, size_t, std::unordered_map< Id, RouteNodeRef > &dataMap) const
Definition RouteNodeDataFile.h:131
typename OrderList::iterator CacheRef
Definition Cache.h:98
static TileId GetTile(const Magnification &magnification, const GeoCoord &coord)
uint64_t Id
Definition OSMScoutTypes.h:40
uint64_t FileOffset
Definition OSMScoutTypes.h:46
std::shared_ptr< TypeConfig > TypeConfigRef
Definition TypeConfig.h:1396
std::shared_ptr< RouteNode > RouteNodeRef
Definition RouteNode.h:177