moved basic type definitions to osrm namespace
This commit is contained in:
committed by
Patrick Niklaus
parent
faaf82c837
commit
ec3cda32fa
@@ -177,7 +177,7 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
}
|
||||
};
|
||||
|
||||
std::size_t LevelIDToIndex(partition::LevelID level) const { return level - 1; }
|
||||
std::size_t LevelIDToIndex(LevelID level) const { return level - 1; }
|
||||
|
||||
public:
|
||||
using Cell = CellImpl<EdgeWeight>;
|
||||
@@ -190,7 +190,7 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
{
|
||||
// pre-allocate storge for CellData so we can have random access to it by cell id
|
||||
unsigned number_of_cells = 0;
|
||||
for (partition::LevelID level = 1u; level < partition.GetNumberOfLevels(); ++level)
|
||||
for (LevelID level = 1u; level < partition.GetNumberOfLevels(); ++level)
|
||||
{
|
||||
level_to_cell_offset.push_back(number_of_cells);
|
||||
number_of_cells += partition.GetNumberOfCells(level);
|
||||
@@ -198,12 +198,12 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
level_to_cell_offset.push_back(number_of_cells);
|
||||
cells.resize(number_of_cells);
|
||||
|
||||
std::vector<std::pair<partition::CellID, NodeID>> level_source_boundary;
|
||||
std::vector<std::pair<partition::CellID, NodeID>> level_destination_boundary;
|
||||
std::vector<std::pair<CellID, NodeID>> level_source_boundary;
|
||||
std::vector<std::pair<CellID, NodeID>> level_destination_boundary;
|
||||
|
||||
std::size_t number_of_unconneced = 0;
|
||||
|
||||
for (partition::LevelID level = 1u; level < partition.GetNumberOfLevels(); ++level)
|
||||
for (LevelID level = 1u; level < partition.GetNumberOfLevels(); ++level)
|
||||
{
|
||||
auto level_offset = level_to_cell_offset[LevelIDToIndex(level)];
|
||||
|
||||
@@ -212,7 +212,7 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
|
||||
for (auto node = 0u; node < base_graph.GetNumberOfNodes(); ++node)
|
||||
{
|
||||
const partition::CellID cell_id = partition.GetCell(level, node);
|
||||
const CellID cell_id = partition.GetCell(level, node);
|
||||
bool is_source_node = false;
|
||||
bool is_destination_node = false;
|
||||
bool is_boundary_node = false;
|
||||
@@ -324,7 +324,7 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
{
|
||||
}
|
||||
|
||||
ConstCell GetCell(partition::LevelID level, partition::CellID id) const
|
||||
ConstCell GetCell(LevelID level, CellID id) const
|
||||
{
|
||||
const auto level_index = LevelIDToIndex(level);
|
||||
BOOST_ASSERT(level_index < level_to_cell_offset.size());
|
||||
@@ -335,8 +335,7 @@ template <bool UseShareMemory> class CellStorageImpl
|
||||
cells[cell_index], weights.data(), source_boundary.data(), destination_boundary.data()};
|
||||
}
|
||||
|
||||
template <typename = std::enable_if<!UseShareMemory>>
|
||||
Cell GetCell(partition::LevelID level, partition::CellID id)
|
||||
template <typename = std::enable_if<!UseShareMemory>> Cell GetCell(LevelID level, CellID id)
|
||||
{
|
||||
const auto level_index = LevelIDToIndex(level);
|
||||
BOOST_ASSERT(level_index < level_to_cell_offset.size());
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef OSRM_PARTITION_IO_HPP
|
||||
#define OSRM_PARTITION_IO_HPP
|
||||
|
||||
#include "partition/multi_level_partition.hpp"
|
||||
#include "partition/cell_storage.hpp"
|
||||
#include "partition/multi_level_partition.hpp"
|
||||
|
||||
#include "storage/io.hpp"
|
||||
|
||||
@@ -44,7 +44,6 @@ template <> inline void write(const boost::filesystem::path &path, const CellSto
|
||||
writer.SerializeVector(storage.cells);
|
||||
writer.SerializeVector(storage.level_to_cell_offset);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,12 +40,6 @@ void write(const boost::filesystem::path &file,
|
||||
const detail::MultiLevelPartitionImpl<UseShareMemory> &mlp);
|
||||
}
|
||||
|
||||
using LevelID = std::uint8_t;
|
||||
using CellID = std::uint32_t;
|
||||
using PartitionID = std::uint64_t;
|
||||
|
||||
static constexpr CellID INVALID_CELL_ID = std::numeric_limits<CellID>::max();
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user