osrm-backend/include/engine/api/match_parameters.hpp

44 lines
940 B
C++
Raw Normal View History

2016-01-28 10:28:44 -05:00
#ifndef ENGINE_API_MATCH_PARAMETERS_HPP
#define ENGINE_API_MATCH_PARAMETERS_HPP
#include "engine/api/route_parameters.hpp"
#include <vector>
namespace osrm
{
namespace engine
{
namespace api
{
struct MatchParameters : public RouteParameters
{
2016-02-22 11:33:31 -05:00
MatchParameters()
2016-03-03 08:26:13 -05:00
: RouteParameters(false,
false,
RouteParameters::GeometriesType::Polyline,
RouteParameters::OverviewType::Simplified,
{})
2016-02-22 11:33:31 -05:00
{
}
2016-03-03 08:26:13 -05:00
template <typename... Args>
MatchParameters(std::vector<unsigned> timestamps_, Args... args_)
2016-02-22 11:33:31 -05:00
: RouteParameters{std::forward<Args>(args_)...}, timestamps{std::move(timestamps_)}
{
}
std::vector<unsigned> timestamps;
2016-02-17 20:21:47 -05:00
bool IsValid() const
{
2016-03-03 08:26:13 -05:00
return RouteParameters::IsValid() &&
(timestamps.empty() || timestamps.size() == coordinates.size());
2016-02-17 20:21:47 -05:00
}
2016-01-28 10:28:44 -05:00
};
}
}
}
#endif