MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / PopulateLayoutWithRTree

Method PopulateLayoutWithRTree

src/storage/storage.cpp:349–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349std::string Storage::PopulateLayoutWithRTree(storage::BaseDataLayout &layout)
350{
351 // Figure out the path to the rtree file (it's not a tar file)
352 auto absolute_file_index_path = std::filesystem::absolute(config.GetPath(".osrm.fileIndex"));
353
354 // Convert the std::filesystem::path object into a plain string
355 // that can then be stored as a member of an allocator object
356 auto rtree_filename = absolute_file_index_path.string();
357
358 // Here, we hardcode the special file_index_path block name.
359 // The important bit here is that the "offset" is set to zero
360 layout.SetBlock("/common/rtree/file_index_path", make_block<char>(rtree_filename.length() + 1));
361
362 return rtree_filename;
363}
364
365/**
366 * This function examines all our data files and figures out how much

Callers 2

MMapMemoryAllocatorMethod · 0.80

Calls 2

GetPathMethod · 0.80
SetBlockMethod · 0.80

Tested by

no test coverage detected