Remove osrm namespace indication where possible, wrap out shared_memory_ownership

This commit is contained in:
Pepijn Schoen
2017-04-04 09:52:00 +02:00
committed by Patrick Niklaus
parent 091a495632
commit 789311abd6
19 changed files with 114 additions and 108 deletions
+10 -10
View File
@@ -16,6 +16,7 @@
#include "storage/serialization.hpp"
#include "storage/shared_datatype.hpp"
#include "storage/shared_memory.hpp"
#include "storage/shared_memory_ownership.hpp"
#include "storage/shared_monitor.hpp"
#include "engine/datafacade/datafacade_base.hpp"
#include "util/coordinate.hpp"
@@ -57,7 +58,7 @@ namespace storage
using RTreeLeaf = engine::datafacade::BaseDataFacade::RTreeLeaf;
using RTreeNode = util::StaticRTree<RTreeLeaf,
util::vector_view<util::Coordinate>,
osrm::storage::Ownership::View>::TreeNode;
storage::Ownership::View>::TreeNode;
using QueryGraph = util::StaticGraph<contractor::QueryEdge::EdgeData>;
using EdgeBasedGraph = util::StaticGraph<extractor::EdgeBasedEdge::EdgeData>;
@@ -365,14 +366,13 @@ void Storage::PopulateLayout(DataLayout &layout)
intersection_file.Skip<std::uint32_t>(1); // sum_lengths
layout.SetBlockSize<unsigned>(DataLayout::BEARING_OFFSETS, bearing_blocks);
layout.SetBlockSize<typename util::RangeTable<16, osrm::storage::Ownership::View>::BlockT>(
layout.SetBlockSize<typename util::RangeTable<16, storage::Ownership::View>::BlockT>(
DataLayout::BEARING_BLOCKS, bearing_blocks);
// No need to read the data
intersection_file.Skip<unsigned>(bearing_blocks);
intersection_file
.Skip<typename util::RangeTable<16, osrm::storage::Ownership::View>::BlockT>(
bearing_blocks);
intersection_file.Skip<typename util::RangeTable<16, storage::Ownership::View>::BlockT>(
bearing_blocks);
const auto num_bearings = intersection_file.ReadElementCount64();
@@ -697,7 +697,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
layout.GetBlockPtr<util::Coordinate, true>(memory_ptr, DataLayout::COORDINATE_LIST);
const auto osmnodeid_ptr =
layout.GetBlockPtr<std::uint64_t, true>(memory_ptr, DataLayout::OSM_NODE_ID_LIST);
util::PackedVector<OSMNodeID, osrm::storage::Ownership::View> osmnodeid_list;
util::PackedVector<OSMNodeID, storage::Ownership::View> osmnodeid_list;
osmnodeid_list.reset(osmnodeid_ptr, layout.num_entries[DataLayout::OSM_NODE_ID_LIST]);
@@ -806,7 +806,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
intersection_file.Skip<std::uint32_t>(1); // sum_lengths
std::vector<unsigned> bearing_offsets_data(bearing_blocks);
std::vector<typename util::RangeTable<16, osrm::storage::Ownership::View>::BlockT>
std::vector<typename util::RangeTable<16, storage::Ownership::View>::BlockT>
bearing_blocks_data(bearing_blocks);
intersection_file.ReadInto(bearing_offsets_data.data(), bearing_blocks);
@@ -846,9 +846,9 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
if (layout.GetBlockSize(DataLayout::BEARING_BLOCKS) > 0)
{
const auto bearing_blocks_ptr = layout.GetBlockPtr<
typename util::RangeTable<16, osrm::storage::Ownership::View>::BlockT,
true>(memory_ptr, DataLayout::BEARING_BLOCKS);
const auto bearing_blocks_ptr =
layout.GetBlockPtr<typename util::RangeTable<16, storage::Ownership::View>::BlockT,
true>(memory_ptr, DataLayout::BEARING_BLOCKS);
BOOST_ASSERT(
static_cast<std::size_t>(layout.GetBlockSize(DataLayout::BEARING_BLOCKS)) >=
std::distance(bearing_blocks_data.begin(), bearing_blocks_data.end()) *