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
+4 -4
View File
@@ -29,13 +29,13 @@ constexpr int32_t WORLD_MAX_LON = 180 * COORDINATE_PRECISION;
using RTreeLeaf = extractor::EdgeBasedNode;
using BenchStaticRTree =
util::StaticRTree<RTreeLeaf,
util::ShM<util::Coordinate, osrm::storage::Ownership::Container>::vector,
osrm::storage::Ownership::Container>;
util::ShM<util::Coordinate, storage::Ownership::Container>::vector,
storage::Ownership::Container>;
std::vector<util::Coordinate> loadCoordinates(const boost::filesystem::path &nodes_file)
{
osrm::storage::io::FileReader nodes_path_file_reader(
nodes_file, osrm::storage::io::FileReader::HasNoFingerprint);
storage::io::FileReader nodes_path_file_reader(nodes_file,
storage::io::FileReader::HasNoFingerprint);
extractor::QueryNode current_node;
unsigned coordinate_count = nodes_path_file_reader.ReadElementCount32();
+2 -2
View File
@@ -8,7 +8,7 @@
#include "partition/io.hpp"
#include "partition/multi_level_partition.hpp"
#include "storage/shared_memory.hpp"
#include "storage/shared_memory_ownership.hpp"
#include "updater/updater.hpp"
@@ -85,7 +85,7 @@ auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
auto tidied =
partition::prepareEdgesForUsageInGraph<StaticEdgeBasedGraphEdge>(std::move(directed));
auto edge_based_graph = std::make_unique<
partition::MultiLevelGraph<EdgeBasedGraphEdgeData, osrm::storage::Ownership::Container>>(
partition::MultiLevelGraph<EdgeBasedGraphEdgeData, storage::Ownership::Container>>(
mlp, num_nodes, std::move(tidied));
util::Log() << "Loaded edge based graph for mapping partition ids: "
+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()) *
+1 -1
View File
@@ -14,7 +14,7 @@
using namespace osrm;
void removeLocks() { osrm::storage::SharedMonitor<osrm::storage::SharedDataTimestamp>::remove(); }
void removeLocks() { storage::SharedMonitor<storage::SharedDataTimestamp>::remove(); }
void deleteRegion(const storage::SharedDataType region)
{
+1 -1
View File
@@ -81,7 +81,7 @@ void checkWeightsConsistency(
const UpdaterConfig &config,
const std::vector<osrm::extractor::EdgeBasedEdge> &edge_based_edge_list)
{
using Reader = osrm::storage::io::FileReader;
using Reader = storage::io::FileReader;
using OriginalEdgeData = osrm::extractor::OriginalEdgeData;
extractor::SegmentDataContainer segment_data;