1 #ifndef OSMSCOUT_ROUTENODEDATAFILE_H 2 #define OSMSCOUT_ROUTENODEDATAFILE_H 50 std::unordered_map<Id,RouteNodeRef> nodeMap;
57 using ValueCache = Cache<Id, IndexPage>;
61 std::string datafilename;
65 std::map<Pixel,IndexEntry> index;
67 mutable FileScanner scanner;
68 mutable ValueCache cache;
69 mutable std::mutex accessMutex;
70 mutable Magnification magnification;
73 bool LoadIndexPage(
const osmscout::Pixel& tile,
74 ValueCache::CacheRef& cacheRef)
const;
75 bool GetIndexPage(
const osmscout::Pixel& tile,
76 ValueCache::CacheRef& cacheRef)
const;
79 explicit RouteNodeDataFile(
const std::string& datafile,
83 const std::string& path,
84 bool memoryMapedData);
88 Pixel GetTile(
const GeoCoord& coord)
const;
89 bool IsCovered(
const Pixel& tile)
const;
91 bool IsCovered(
const GeoCoord& coord)
const;
96 template<
typename IteratorIn>
97 bool Get(IteratorIn begin, IteratorIn end,
size_t size,
98 std::vector<RouteNodeRef>& data)
const 102 for (IteratorIn idIter=begin; idIter!=end; ++idIter) {
106 GeoCoord coord=Point::GetCoordFromId(
id);
111 if (!GetIndexPage(tile,
116 auto node=cacheRef->value.find(scanner,
123 data.push_back(node);
129 template<
typename IteratorIn>
130 bool Get(IteratorIn begin, IteratorIn end,
size_t ,
131 std::unordered_map<Id,RouteNodeRef>& dataMap)
const 133 for (IteratorIn idIter=begin; idIter!=end; ++idIter) {
137 GeoCoord coord=Point::GetCoordFromId(
id);
142 if (!GetIndexPage(tile,
147 auto node=cacheRef->value.find(scanner,
bool Get(IteratorIn begin, IteratorIn end, size_t, std::unordered_map< Id, RouteNodeRef > &dataMap) const
Definition: RouteNodeDataFile.h:130
uint64_t Id
Definition: OSMScoutTypes.h:41
Pixel AsPixel() const
Definition: TileId.h:71
#define CLASS_FINAL
Definition: Compiler.h:26
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
bool Get(IteratorIn begin, IteratorIn end, size_t size, std::vector< RouteNodeRef > &data) const
Definition: RouteNodeDataFile.h:97
std::shared_ptr< RouteNode > RouteNodeRef
Definition: RouteNode.h:160
uint64_t FileOffset
Definition: OSMScoutTypes.h:47
typename OrderList::iterator CacheRef
Definition: Cache.h:98
static TileId GetTile(const Magnification &magnification, const GeoCoord &coord)
std::shared_ptr< TypeConfig > TypeConfigRef
Definition: TypeConfig.h:1227