osrm-backend/include/engine/search_engine_data.hpp

60 lines
1.8 KiB
C++
Raw Normal View History

#ifndef SEARCH_ENGINE_DATA_HPP
#define SEARCH_ENGINE_DATA_HPP
#include <boost/thread/tss.hpp>
2016-01-02 11:13:44 -05:00
#include "util/binary_heap.hpp"
2016-05-27 15:05:04 -04:00
#include "util/typedefs.hpp"
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace engine
{
2014-05-05 11:19:47 -04:00
struct HeapData
{
NodeID parent;
2014-05-05 11:19:47 -04:00
/* explicit */ HeapData(NodeID p) : parent(p) {}
};
struct ManyToManyHeapData : HeapData
{
EdgeWeight duration;
ManyToManyHeapData(NodeID p, EdgeWeight duration) : HeapData(p), duration(duration) {}
};
2014-05-05 11:19:47 -04:00
struct SearchEngineData
{
using QueryHeap = util::
BinaryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::UnorderedMapStorage<NodeID, int>>;
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
using ManyToManyQueryHeap = util::BinaryHeap<NodeID,
NodeID,
EdgeWeight,
ManyToManyHeapData,
util::UnorderedMapStorage<NodeID, int>>;
using ManyToManyHeapPtr = boost::thread_specific_ptr<ManyToManyQueryHeap>;
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;
static ManyToManyHeapPtr many_to_many_heap;
void InitializeOrClearFirstThreadLocalStorage(const unsigned number_of_nodes);
void InitializeOrClearSecondThreadLocalStorage(const unsigned number_of_nodes);
void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes);
void InitializeOrClearManyToManyThreadLocalStorage(const unsigned number_of_nodes);
};
2016-01-05 10:51:13 -05:00
}
}
#endif // SEARCH_ENGINE_DATA_HPP