clang-format
This commit is contained in:
committed by
Patrick Niklaus
parent
266e65e6d2
commit
157ca9161f
@@ -186,7 +186,9 @@ template <osrm::storage::MemorySetting MemorySetting> class CellStorageImpl
|
||||
|
||||
CellStorageImpl() {}
|
||||
|
||||
template <typename GraphT, typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::InternalMemory>>
|
||||
template <
|
||||
typename GraphT,
|
||||
typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::InternalMemory>>
|
||||
CellStorageImpl(const partition::MultiLevelPartition &partition, const GraphT &base_graph)
|
||||
{
|
||||
// pre-allocate storge for CellData so we can have random access to it by cell id
|
||||
@@ -315,7 +317,8 @@ template <osrm::storage::MemorySetting MemorySetting> class CellStorageImpl
|
||||
weights.resize(weight_offset + 1, INVALID_EDGE_WEIGHT);
|
||||
}
|
||||
|
||||
template <typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::SharedMemory>>
|
||||
template <
|
||||
typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::SharedMemory>>
|
||||
CellStorageImpl(Vector<EdgeWeight> weights_,
|
||||
Vector<NodeID> source_boundary_,
|
||||
Vector<NodeID> destination_boundary_,
|
||||
@@ -340,7 +343,9 @@ template <osrm::storage::MemorySetting MemorySetting> class CellStorageImpl
|
||||
destination_boundary.empty() ? nullptr : destination_boundary.data()};
|
||||
}
|
||||
|
||||
template <typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::InternalMemory>> Cell GetCell(LevelID level, CellID id)
|
||||
template <
|
||||
typename = std::enable_if<MemorySetting == osrm::storage::MemorySetting::InternalMemory>>
|
||||
Cell GetCell(LevelID level, CellID id)
|
||||
{
|
||||
const auto level_index = LevelIDToIndex(level);
|
||||
BOOST_ASSERT(level_index < level_to_cell_offset.size());
|
||||
@@ -352,9 +357,9 @@ template <osrm::storage::MemorySetting MemorySetting> class CellStorageImpl
|
||||
}
|
||||
|
||||
friend void io::read<MemorySetting>(const boost::filesystem::path &path,
|
||||
detail::CellStorageImpl<MemorySetting> &storage);
|
||||
detail::CellStorageImpl<MemorySetting> &storage);
|
||||
friend void io::write<MemorySetting>(const boost::filesystem::path &path,
|
||||
const detail::CellStorageImpl<MemorySetting> &storage);
|
||||
const detail::CellStorageImpl<MemorySetting> &storage);
|
||||
|
||||
private:
|
||||
Vector<EdgeWeight> weights;
|
||||
|
||||
@@ -193,10 +193,10 @@ class MultiLevelGraph : public util::StaticGraph<EdgeDataT, MemorySetting>
|
||||
|
||||
friend void
|
||||
io::read<EdgeDataT, MemorySetting>(const boost::filesystem::path &path,
|
||||
MultiLevelGraph<EdgeDataT, MemorySetting> &graph);
|
||||
MultiLevelGraph<EdgeDataT, MemorySetting> &graph);
|
||||
friend void
|
||||
io::write<EdgeDataT, MemorySetting>(const boost::filesystem::path &path,
|
||||
const MultiLevelGraph<EdgeDataT, MemorySetting> &graph);
|
||||
const MultiLevelGraph<EdgeDataT, MemorySetting> &graph);
|
||||
|
||||
Vector<EdgeOffset> node_to_edge_offset;
|
||||
};
|
||||
|
||||
@@ -28,14 +28,15 @@ namespace detail
|
||||
{
|
||||
template <osrm::storage::MemorySetting MemorySetting> class MultiLevelPartitionImpl;
|
||||
}
|
||||
using MultiLevelPartition = detail::MultiLevelPartitionImpl<osrm::storage::MemorySetting::InternalMemory>;
|
||||
using MultiLevelPartitionView = detail::MultiLevelPartitionImpl<osrm::storage::MemorySetting::SharedMemory>;
|
||||
using MultiLevelPartition =
|
||||
detail::MultiLevelPartitionImpl<osrm::storage::MemorySetting::InternalMemory>;
|
||||
using MultiLevelPartitionView =
|
||||
detail::MultiLevelPartitionImpl<osrm::storage::MemorySetting::SharedMemory>;
|
||||
|
||||
namespace io
|
||||
{
|
||||
template <osrm::storage::MemorySetting MemorySetting>
|
||||
void read(const boost::filesystem::path &file,
|
||||
detail::MultiLevelPartitionImpl<MemorySetting> &mlp);
|
||||
void read(const boost::filesystem::path &file, detail::MultiLevelPartitionImpl<MemorySetting> &mlp);
|
||||
template <osrm::storage::MemorySetting MemorySetting>
|
||||
void write(const boost::filesystem::path &file,
|
||||
const detail::MultiLevelPartitionImpl<MemorySetting> &mlp);
|
||||
@@ -69,7 +70,8 @@ template <osrm::storage::MemorySetting MemorySetting> class MultiLevelPartitionI
|
||||
// cell_sizes is index by level (starting at 0, the base graph).
|
||||
// However level 0 always needs to have cell size 1, since it is the
|
||||
// basegraph.
|
||||
template <typename = typename std::enable_if<MemorySetting == osrm::storage::MemorySetting::InternalMemory>>
|
||||
template <typename = typename std::enable_if<MemorySetting ==
|
||||
osrm::storage::MemorySetting::InternalMemory>>
|
||||
MultiLevelPartitionImpl(const std::vector<std::vector<CellID>> &partitions,
|
||||
const std::vector<std::uint32_t> &lidx_to_num_cells)
|
||||
: level_data(MakeLevelData(lidx_to_num_cells))
|
||||
@@ -77,7 +79,8 @@ template <osrm::storage::MemorySetting MemorySetting> class MultiLevelPartitionI
|
||||
InitializePartitionIDs(partitions);
|
||||
}
|
||||
|
||||
template <typename = typename std::enable_if<MemorySetting == osrm::storage::MemorySetting::SharedMemory>>
|
||||
template <typename = typename std::enable_if<MemorySetting ==
|
||||
osrm::storage::MemorySetting::SharedMemory>>
|
||||
MultiLevelPartitionImpl(LevelData level_data,
|
||||
Vector<PartitionID> partition_,
|
||||
Vector<CellID> cell_to_children_)
|
||||
@@ -136,9 +139,9 @@ template <osrm::storage::MemorySetting MemorySetting> class MultiLevelPartitionI
|
||||
}
|
||||
|
||||
friend void io::read<MemorySetting>(const boost::filesystem::path &file,
|
||||
MultiLevelPartitionImpl &mlp);
|
||||
MultiLevelPartitionImpl &mlp);
|
||||
friend void io::write<MemorySetting>(const boost::filesystem::path &file,
|
||||
const MultiLevelPartitionImpl &mlp);
|
||||
const MultiLevelPartitionImpl &mlp);
|
||||
|
||||
private:
|
||||
auto MakeLevelData(const std::vector<std::uint32_t> &lidx_to_num_cells)
|
||||
|
||||
Reference in New Issue
Block a user