osrm-backend/include/engine/algorithm.hpp

113 lines
2.9 KiB
C++
Raw Normal View History

#ifndef OSRM_ENGINE_ALGORITHM_HPP
#define OSRM_ENGINE_ALGORITHM_HPP
#include <type_traits>
namespace osrm::engine::routing_algorithms
{
// Contraction Hiearchy
namespace ch
{
struct Algorithm final
2017-02-25 00:13:38 -05:00
{
};
} // namespace ch
2017-03-01 15:29:04 -05:00
// Multi-Level Dijkstra
namespace mld
{
struct Algorithm final
2017-03-01 15:29:04 -05:00
{
};
} // namespace mld
// Algorithm names
template <typename AlgorithmT> const char *name();
template <> inline const char *name<ch::Algorithm>() { return "CH"; }
template <> inline const char *name<mld::Algorithm>() { return "MLD"; }
2018-03-27 05:44:13 -04:00
// Algorithm identifier
template <typename AlgorithmT> const char *identifier();
template <> inline const char *identifier<ch::Algorithm>() { return "ch"; }
template <> inline const char *identifier<mld::Algorithm>() { return "mld"; }
2017-02-25 00:13:38 -05:00
template <typename AlgorithmT> struct HasAlternativePathSearch final : std::false_type
{
};
template <typename AlgorithmT> struct HasShortestPathSearch final : std::false_type
{
};
template <typename AlgorithmT> struct HasDirectShortestPathSearch final : std::false_type
{
};
template <typename AlgorithmT> struct HasMapMatching final : std::false_type
{
};
template <typename AlgorithmT> struct HasManyToManySearch final : std::false_type
{
};
template <typename AlgorithmT> struct SupportsDistanceAnnotationType final : std::false_type
{
};
2017-02-25 00:13:38 -05:00
template <typename AlgorithmT> struct HasGetTileTurns final : std::false_type
{
};
2017-08-16 16:21:19 -04:00
template <typename AlgorithmT> struct HasExcludeFlags final : std::false_type
{
};
// Algorithms supported by Contraction Hierarchies
template <> struct HasAlternativePathSearch<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct HasShortestPathSearch<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct HasDirectShortestPathSearch<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct HasMapMatching<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct HasManyToManySearch<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct SupportsDistanceAnnotationType<ch::Algorithm> final : std::true_type
{
};
template <> struct HasGetTileTurns<ch::Algorithm> final : std::true_type
2017-02-25 00:13:38 -05:00
{
};
template <> struct HasExcludeFlags<ch::Algorithm> final : std::true_type
{
};
// Algorithms supported by Multi-Level Dijkstra
2017-04-06 08:28:43 -04:00
template <> struct HasAlternativePathSearch<mld::Algorithm> final : std::true_type
{
};
template <> struct HasDirectShortestPathSearch<mld::Algorithm> final : std::true_type
2017-03-01 15:29:04 -05:00
{
};
2017-04-03 06:50:37 -04:00
template <> struct HasShortestPathSearch<mld::Algorithm> final : std::true_type
{
};
2017-03-31 05:29:48 -04:00
template <> struct HasMapMatching<mld::Algorithm> final : std::true_type
{
};
2017-06-27 10:56:43 -04:00
template <> struct HasManyToManySearch<mld::Algorithm> final : std::true_type
{
};
template <> struct SupportsDistanceAnnotationType<mld::Algorithm> final : std::false_type
{
};
template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
{
};
2017-08-16 16:21:19 -04:00
template <> struct HasExcludeFlags<mld::Algorithm> final : std::true_type
{
};
2022-12-20 12:00:11 -05:00
} // namespace osrm::engine::routing_algorithms
#endif