https://github.com/Project-OSRM/osrm-backend/pull/2685/files fixes an issue where we did elongate(fstStep, sndStep); instead of newStep = elongate(fstStep, sndStep); we didn't get any warnings. The only way to trigger a warning here is to use ```cpp __attribute__((warn_unused_result)) ``` This changeset does exactly that: for the new guidance code prone to these kind of issue we add such an attribute to the declaration.
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
#ifndef OSRM_ENGINE_GUIDANCE_LANE_PROCESSING_HPP_
|
|
#define OSRM_ENGINE_GUIDANCE_LANE_PROCESSING_HPP_
|
|
|
|
#include <vector>
|
|
|
|
#include "engine/guidance/route_step.hpp"
|
|
#include "util/attributes.hpp"
|
|
|
|
namespace osrm
|
|
{
|
|
namespace engine
|
|
{
|
|
namespace guidance
|
|
{
|
|
|
|
// Constrains lanes for multi-hop situations where lane changes depend on earlier ones.
|
|
// Instead of forcing users to change lanes rapidly in a short amount of time,
|
|
// we anticipate lane changes emitting only matching lanes early on.
|
|
// the second parameter describes the duration that we feel two segments need to be apart to count
|
|
// as separate maneuvers.
|
|
OSRM_ATTR_WARN_UNUSED
|
|
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
|
const double min_duration_needed_for_lane_change = 15);
|
|
|
|
// Remove all lane information from roundabouts. See #2626.
|
|
OSRM_ATTR_WARN_UNUSED
|
|
std::vector<RouteStep> removeLanesFromRoundabouts(std::vector<RouteStep> steps);
|
|
|
|
} // namespace guidance
|
|
} // namespace engine
|
|
} // namespace osrm
|
|
|
|
#endif /* OSRM_ENGINE_GUIDANCE_LANE_PROCESSING_HPP_ */
|