Fix compilation after rebase

This commit is contained in:
Patrick Niklaus
2017-08-14 20:32:11 +00:00
committed by Patrick Niklaus
parent f93b331817
commit bd6492bb38
5 changed files with 33 additions and 12 deletions
+18 -8
View File
@@ -22,18 +22,21 @@ namespace osrm
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 Facade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
public:
DataWatchdog() : active(true), timestamp(0)
DataWatchdogImpl() : active(true), timestamp(0)
{
// create the initial facade before launching the watchdog thread
{
@@ -44,10 +47,10 @@ template <typename AlgorithmT> class DataWatchdog<datafacade::ContiguousInternal
timestamp = barrier.data().timestamp;
}
watcher = std::thread(&DataWatchdog::Run, this);
watcher = std::thread(&DataWatchdogImpl::Run, this);
}
~DataWatchdog()
~DataWatchdogImpl()
{
active = false;
barrier.notify_all();
@@ -89,6 +92,13 @@ template <typename AlgorithmT> class DataWatchdog<datafacade::ContiguousInternal
unsigned timestamp;
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>>;
}
}
+1
View File
@@ -11,6 +11,7 @@ namespace engine
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
template <typename AlgorithmT>
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
#ifndef OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
#define OSRM_ENGINE_DATAFACADE_PROVIDER_HPP
#include "engine/datafacade_factory.hpp"
#include "engine/data_watchdog.hpp"
#include "engine/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>
class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
{
DataWatchdog<FacadeT, AlgorithmT> watchdog;
DataWatchdog<AlgorithmT, FacadeT> watchdog;
public:
using Facade = typename DataFacadeProvider<AlgorithmT, FacadeT>::Facade;