Fix compilation after rebase
This commit is contained in:
parent
f93b331817
commit
bd6492bb38
@ -22,18 +22,21 @@ namespace osrm
|
|||||||
namespace engine
|
namespace engine
|
||||||
{
|
{
|
||||||
|
|
||||||
// This class monitors the shared memory region that contains the pointers to
|
|
||||||
// the data and layout regions that should be used. This region is updated
|
|
||||||
// once a new dataset arrives.
|
|
||||||
template <template<typename A> class FacadeT, typename AlgorithmT> class DataWatchdog;
|
|
||||||
|
|
||||||
template <typename AlgorithmT> class DataWatchdog<datafacade::ContiguousInternalMemoryDataFacade,AlgorithmT> final
|
namespace detail
|
||||||
|
{
|
||||||
|
// We need this wrapper type since template-template specilization of FacadeT is broken on clang
|
||||||
|
// when it is combined with an templated alias (DataFacade in this case).
|
||||||
|
// See https://godbolt.org/g/ZS6Xmt for an example.
|
||||||
|
template <typename AlgorithmT, typename FacadeT> class DataWatchdogImpl;
|
||||||
|
|
||||||
|
template <typename AlgorithmT> class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>> final
|
||||||
{
|
{
|
||||||
using mutex_type = typename storage::SharedMonitor<storage::SharedDataTimestamp>::mutex_type;
|
using mutex_type = typename storage::SharedMonitor<storage::SharedDataTimestamp>::mutex_type;
|
||||||
using Facade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
using Facade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DataWatchdog() : active(true), timestamp(0)
|
DataWatchdogImpl() : active(true), timestamp(0)
|
||||||
{
|
{
|
||||||
// create the initial facade before launching the watchdog thread
|
// create the initial facade before launching the watchdog thread
|
||||||
{
|
{
|
||||||
@ -44,10 +47,10 @@ template <typename AlgorithmT> class DataWatchdog<datafacade::ContiguousInternal
|
|||||||
timestamp = barrier.data().timestamp;
|
timestamp = barrier.data().timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
watcher = std::thread(&DataWatchdog::Run, this);
|
watcher = std::thread(&DataWatchdogImpl::Run, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~DataWatchdog()
|
~DataWatchdogImpl()
|
||||||
{
|
{
|
||||||
active = false;
|
active = false;
|
||||||
barrier.notify_all();
|
barrier.notify_all();
|
||||||
@ -89,6 +92,13 @@ template <typename AlgorithmT> class DataWatchdog<datafacade::ContiguousInternal
|
|||||||
unsigned timestamp;
|
unsigned timestamp;
|
||||||
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
|
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// This class monitors the shared memory region that contains the pointers to
|
||||||
|
// the data and layout regions that should be used. This region is updated
|
||||||
|
// once a new dataset arrives.
|
||||||
|
template <typename AlgorithmT, template<typename A> class FacadeT> using DataWatchdog = detail::DataWatchdogImpl<AlgorithmT, FacadeT<AlgorithmT>>;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ namespace engine
|
|||||||
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
|
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
|
||||||
template <typename AlgorithmT>
|
template <typename AlgorithmT>
|
||||||
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
|
#ifndef OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
|
||||||
#define OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
|
#define OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
|
||||||
|
|
||||||
|
#include "engine/datafacade_factory.hpp"
|
||||||
#include "engine/data_watchdog.hpp"
|
#include "engine/data_watchdog.hpp"
|
||||||
#include "engine/datafacade.hpp"
|
#include "engine/datafacade.hpp"
|
||||||
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
#include "engine/datafacade/contiguous_internalmem_datafacade.hpp"
|
||||||
@ -45,7 +46,7 @@ class ImmutableProvider final : public DataFacadeProvider<AlgorithmT, FacadeT>
|
|||||||
template <typename AlgorithmT, template <typename A> class FacadeT>
|
template <typename AlgorithmT, template <typename A> class FacadeT>
|
||||||
class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
|
class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
|
||||||
{
|
{
|
||||||
DataWatchdog<FacadeT, AlgorithmT> watchdog;
|
DataWatchdog<AlgorithmT, FacadeT> watchdog;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;
|
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;
|
||||||
|
@ -68,6 +68,10 @@ struct ExternalMultiLevelPartition
|
|||||||
CellID EndChildren(LevelID /*level*/, CellID /*cell*/) const { return 0; }
|
CellID EndChildren(LevelID /*level*/, CellID /*cell*/) const { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ExternalCellMetric
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
// Define external cell storage
|
// Define external cell storage
|
||||||
struct ExternalCellStorage
|
struct ExternalCellStorage
|
||||||
{
|
{
|
||||||
@ -97,10 +101,10 @@ struct ExternalCellStorage
|
|||||||
using Cell = CellImpl;
|
using Cell = CellImpl;
|
||||||
using ConstCell = const CellImpl;
|
using ConstCell = const CellImpl;
|
||||||
|
|
||||||
ConstCell GetCell(LevelID /*level*/, CellID /*id*/) const { return Cell{}; }
|
ConstCell GetCell(ExternalCellMetric, LevelID /*level*/, CellID /*id*/) const { return Cell{}; }
|
||||||
Cell GetCell(LevelID /*level*/, CellID /*id*/) { return Cell{}; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Define external data facade
|
// Define external data facade
|
||||||
template <>
|
template <>
|
||||||
class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm> final
|
class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm> final
|
||||||
@ -108,6 +112,7 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
|
|||||||
{
|
{
|
||||||
ExternalMultiLevelPartition external_partition;
|
ExternalMultiLevelPartition external_partition;
|
||||||
ExternalCellStorage external_cell_storage;
|
ExternalCellStorage external_cell_storage;
|
||||||
|
ExternalCellMetric external_cell_metric;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using EdgeData = extractor::EdgeBasedEdge::EdgeData;
|
using EdgeData = extractor::EdgeBasedEdge::EdgeData;
|
||||||
@ -131,6 +136,8 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
|
|||||||
|
|
||||||
const auto &GetCellStorage() const { return external_cell_storage; }
|
const auto &GetCellStorage() const { return external_cell_storage; }
|
||||||
|
|
||||||
|
const auto &GetCellMetric() const { return external_cell_metric; }
|
||||||
|
|
||||||
auto GetBorderEdgeRange(const LevelID /*level*/, const NodeID /*node*/) const
|
auto GetBorderEdgeRange(const LevelID /*level*/, const NodeID /*node*/) const
|
||||||
{
|
{
|
||||||
return util::irange<EdgeID>(0, 0);
|
return util::irange<EdgeID>(0, 0);
|
||||||
@ -321,7 +328,7 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HasLaneData(const EdgeID /*id*/) const override { return false; }
|
bool HasLaneData(const EdgeID /*id*/) const override { return false; }
|
||||||
NameID GetNameIndex(const NodeID /*nodeID*/) const { return EMPTY_NAMEID; }
|
NameID GetNameIndex(const NodeID /*nodeID*/) const override { return EMPTY_NAMEID; }
|
||||||
StringView GetNameForID(const NameID /*id*/) const override { return StringView{}; }
|
StringView GetNameForID(const NameID /*id*/) const override { return StringView{}; }
|
||||||
StringView GetRefForID(const NameID /*id*/) const override { return StringView{}; }
|
StringView GetRefForID(const NameID /*id*/) const override { return StringView{}; }
|
||||||
StringView GetPronunciationForID(const NameID /*id*/) const override { return StringView{}; }
|
StringView GetPronunciationForID(const NameID /*id*/) const override { return StringView{}; }
|
||||||
@ -334,6 +341,7 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
|
|||||||
unsigned GetWeightPrecision() const override { return 0; }
|
unsigned GetWeightPrecision() const override { return 0; }
|
||||||
double GetWeightMultiplier() const override { return 1; }
|
double GetWeightMultiplier() const override { return 1; }
|
||||||
ComponentID GetComponentID(NodeID) const override { return ComponentID{}; }
|
ComponentID GetComponentID(NodeID) const override { return ComponentID{}; }
|
||||||
|
bool AvoidNode(const NodeID) const override { return false; }
|
||||||
|
|
||||||
util::guidance::TurnBearing PreTurnBearing(const EdgeID /*eid*/) const override
|
util::guidance::TurnBearing PreTurnBearing(const EdgeID /*eid*/) const override
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@ class MockScriptingEnvironment : public extractor::ScriptingEnvironment
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> GetNameSuffixList() override final { return {}; }
|
std::vector<std::string> GetNameSuffixList() override final { return {}; }
|
||||||
|
std::vector<std::vector<std::string>> GetAvoidableClasses() override final { return {}; };
|
||||||
|
|
||||||
std::vector<std::string> GetRestrictions() override final { return {}; }
|
std::vector<std::string> GetRestrictions() override final { return {}; }
|
||||||
void ProcessTurn(extractor::ExtractionTurn &) override final {}
|
void ProcessTurn(extractor::ExtractionTurn &) override final {}
|
||||||
|
Loading…
Reference in New Issue
Block a user