osrm-backend/include/engine/search_engine.hpp

48 lines
1.5 KiB
C++
Raw Normal View History

#ifndef SEARCH_ENGINE_HPP
#define SEARCH_ENGINE_HPP
2016-01-02 11:13:44 -05:00
#include "engine/search_engine_data.hpp"
#include "engine/routing_algorithms/alternative_path.hpp"
#include "engine/routing_algorithms/many_to_many.hpp"
#include "engine/routing_algorithms/map_matching.hpp"
#include "engine/routing_algorithms/shortest_path.hpp"
#include "engine/routing_algorithms/direct_shortest_path.hpp"
2014-05-22 08:41:27 -04:00
#include <type_traits>
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace engine
{
2014-05-07 12:39:16 -04:00
template <class DataFacadeT> class SearchEngine
{
private:
DataFacadeT *facade;
SearchEngineData engine_working_data;
2014-05-07 12:39:16 -04:00
public:
2016-01-05 10:51:13 -05:00
routing_algorithms::ShortestPathRouting<DataFacadeT> shortest_path;
routing_algorithms::DirectShortestPathRouting<DataFacadeT> direct_shortest_path;
routing_algorithms::AlternativeRouting<DataFacadeT> alternative_path;
routing_algorithms::ManyToManyRouting<DataFacadeT> distance_table;
routing_algorithms::MapMatching<DataFacadeT> map_matching;
2011-12-31 10:18:52 -05:00
2014-05-07 12:39:16 -04:00
explicit SearchEngine(DataFacadeT *facade)
2016-01-05 06:04:04 -05:00
: facade(facade), shortest_path(facade, engine_working_data),
direct_shortest_path(facade, engine_working_data),
2014-09-23 12:46:14 -04:00
alternative_path(facade, engine_working_data),
2016-01-05 06:04:04 -05:00
distance_table(facade, engine_working_data), map_matching(facade, engine_working_data)
2014-05-07 12:39:16 -04:00
{
static_assert(!std::is_pointer<DataFacadeT>::value, "don't instantiate with ptr type");
static_assert(std::is_object<DataFacadeT>::value,
"don't instantiate with void, function, or reference");
2014-05-07 12:39:16 -04:00
}
2011-12-31 10:18:52 -05:00
~SearchEngine() {}
};
2016-01-05 10:51:13 -05:00
}
}
#endif // SEARCH_ENGINE_HPP