Link parameters to grammars
This commit is contained in:
parent
3c58eaf49f
commit
f452a3025d
@ -15,6 +15,9 @@ namespace server
|
||||
namespace api
|
||||
{
|
||||
|
||||
// Note: this file provides only the interface for the generic parseParameters function.
|
||||
// The actual implementations for each concrete parameter type live in the cpp file.
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename T> using is_parameter_t = std::is_base_of<engine::api::BaseParameters, T>;
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
#include "server/api/route_parameters_grammar.hpp"
|
||||
#include "server/api/table_parameter_grammar.hpp"
|
||||
#include "server/api/nearest_parameter_grammar.hpp"
|
||||
//#include "server/api/trip_parameter_grammar.hpp"
|
||||
//#include "server/api/match_parameter_grammar.hpp"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
@ -43,6 +46,28 @@ boost::optional<engine::api::TableParameters> parseParameters(std::string::itera
|
||||
return detail::parseParameters<engine::api::TableParameters, TableParametersGrammar>(iter, end);
|
||||
}
|
||||
|
||||
template <>
|
||||
boost::optional<engine::api::NearestParameters> parseParameters(std::string::iterator &iter,
|
||||
std::string::iterator end)
|
||||
{
|
||||
return detail::parseParameters<engine::api::NearestParameters, NearestParametersGrammar>(iter,
|
||||
end);
|
||||
}
|
||||
|
||||
//template <>
|
||||
//boost::optional<engine::api::TripParameters> parseParameters(std::string::iterator &iter,
|
||||
// std::string::iterator end)
|
||||
//{
|
||||
// return detail::parseParameters<engine::api::TripParameters, TripParametersGrammar>(iter, end);
|
||||
//}
|
||||
//
|
||||
//template <>
|
||||
//boost::optional<engine::api::MatchParameters> parseParameters(std::string::iterator &iter,
|
||||
// std::string::iterator end)
|
||||
//{
|
||||
// return detail::parseParameters<engine::api::MatchParameters, MatchParametersGrammar>(iter, end);
|
||||
//}
|
||||
|
||||
} // ns api
|
||||
} // ns server
|
||||
} // ns osrm
|
||||
|
Loading…
Reference in New Issue
Block a user