Inject offline compressed data facade with OSRM_EXTERNAL_MEMORY option.

This commit is contained in:
vng
2017-07-26 17:47:07 +03:00
committed by Patrick Niklaus
parent a64145b712
commit 40857aae61
3 changed files with 41 additions and 4 deletions
+11 -2
View File
@@ -3,8 +3,17 @@
#ifdef OSRM_EXTERNAL_MEMORY
// Register your own data backend here
#error "No external memory implementation found"
#include "routing/compressed_datafacade.hpp"
namespace osrm
{
namespace engine
{
using DataFacadeBase = datafacade::BaseDataFacade;
template <typename AlgorithmT> using DataFacade = datafacade::CompressedDataFacadeT<AlgorithmT>;
}
}
#else
+13 -2
View File
@@ -1,7 +1,9 @@
#ifndef SEARCH_ENGINE_DATA_HPP
#define SEARCH_ENGINE_DATA_HPP
#ifndef OSRM_EXTERNAL_MEMORY
#include <boost/thread/tss.hpp>
#endif
#include "engine/algorithm.hpp"
#include "util/query_heap.hpp"
@@ -37,7 +39,6 @@ template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
{
using QueryHeap = util::
QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::UnorderedMapStorage<NodeID, int>>;
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
using ManyToManyQueryHeap = util::QueryHeap<NodeID,
NodeID,
@@ -45,7 +46,13 @@ template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
ManyToManyHeapData,
util::UnorderedMapStorage<NodeID, int>>;
#ifdef OSRM_EXTERNAL_MEMORY
using SearchEngineHeapPtr = std::unique_ptr<QueryHeap>;
using ManyToManyHeapPtr = std::unique_ptr<ManyToManyQueryHeap>;
#else
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
using ManyToManyHeapPtr = boost::thread_specific_ptr<ManyToManyQueryHeap>;
#endif
static SearchEngineHeapPtr forward_heap_1;
static SearchEngineHeapPtr reverse_heap_1;
@@ -105,9 +112,13 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
ManyToManyMultiLayerDijkstraHeapData,
util::UnorderedMapStorage<NodeID, int>>;
#ifdef OSRM_EXTERNAL_MEMORY
using SearchEngineHeapPtr = std::unique_ptr<QueryHeap>;
using ManyToManyHeapPtr = std::unique_ptr<ManyToManyQueryHeap>;
#else
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
using ManyToManyHeapPtr = boost::thread_specific_ptr<ManyToManyQueryHeap>;
#endif
static SearchEngineHeapPtr forward_heap_1;
static SearchEngineHeapPtr reverse_heap_1;