2014-11-28 06:13:18 -05:00
|
|
|
#ifndef SEARCH_ENGINE_DATA_HPP
|
|
|
|
#define SEARCH_ENGINE_DATA_HPP
|
2013-09-19 12:52:42 -04:00
|
|
|
|
2014-06-11 06:25:57 -04:00
|
|
|
#include <boost/thread/tss.hpp>
|
2013-06-24 14:11:53 -04:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "util/typedefs.hpp"
|
|
|
|
#include "util/binary_heap.hpp"
|
2013-06-24 14:11:53 -04:00
|
|
|
|
2016-01-05 10:51:13 -05:00
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace engine
|
|
|
|
{
|
|
|
|
|
2014-05-05 11:19:47 -04:00
|
|
|
struct HeapData
|
|
|
|
{
|
2013-06-24 14:11:53 -04:00
|
|
|
NodeID parent;
|
2014-05-05 11:19:47 -04:00
|
|
|
/* explicit */ HeapData(NodeID p) : parent(p) {}
|
2013-06-24 14:11:53 -04:00
|
|
|
};
|
2013-09-19 12:52:42 -04:00
|
|
|
|
2014-05-05 11:19:47 -04:00
|
|
|
struct SearchEngineData
|
|
|
|
{
|
2016-01-07 19:31:57 -05:00
|
|
|
using QueryHeap =
|
|
|
|
util::BinaryHeap<NodeID, NodeID, int, HeapData, util::UnorderedMapStorage<NodeID, int>>;
|
2014-08-19 07:01:38 -04:00
|
|
|
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
|
2013-08-20 11:05:36 -04:00
|
|
|
|
2015-03-02 05:55:55 -05:00
|
|
|
static SearchEngineHeapPtr forward_heap_1;
|
|
|
|
static SearchEngineHeapPtr reverse_heap_1;
|
|
|
|
static SearchEngineHeapPtr forward_heap_2;
|
|
|
|
static SearchEngineHeapPtr reverse_heap_2;
|
|
|
|
static SearchEngineHeapPtr forward_heap_3;
|
|
|
|
static SearchEngineHeapPtr reverse_heap_3;
|
2013-06-24 14:11:53 -04:00
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void InitializeOrClearFirstThreadLocalStorage(const unsigned number_of_nodes);
|
2013-06-24 14:11:53 -04:00
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void InitializeOrClearSecondThreadLocalStorage(const unsigned number_of_nodes);
|
2013-06-24 14:11:53 -04:00
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes);
|
2013-06-24 14:11:53 -04:00
|
|
|
};
|
2016-01-05 10:51:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif // SEARCH_ENGINE_DATA_HPP
|