2018-01-05 08:33:53 -05:00
|
|
|
#ifndef OSRM_GUIDANCE_TURN_LANE_DATA_HPP_
|
|
|
|
#define OSRM_GUIDANCE_TURN_LANE_DATA_HPP_
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
#include "extractor/turn_lane_types.hpp"
|
2016-07-26 09:00:58 -04:00
|
|
|
#include "util/typedefs.hpp"
|
2016-05-13 13:18:00 -04:00
|
|
|
#include <vector>
|
|
|
|
|
2022-12-11 04:10:26 -05:00
|
|
|
namespace osrm::guidance::lanes
|
2016-05-13 13:18:00 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
struct TurnLaneData
|
|
|
|
{
|
2018-01-05 08:33:53 -05:00
|
|
|
extractor::TurnLaneType::Mask tag;
|
2016-05-13 13:18:00 -04:00
|
|
|
LaneID from;
|
|
|
|
LaneID to;
|
|
|
|
|
2016-07-08 05:45:36 -04:00
|
|
|
// a temporary data entry that does not need to be assigned to an entry.
|
|
|
|
// This is the case in situations that use partition and require the entry to perform the
|
|
|
|
// one-to-one mapping.
|
2016-05-13 13:18:00 -04:00
|
|
|
bool operator<(const TurnLaneData &other) const;
|
|
|
|
};
|
2022-11-06 07:21:45 -05:00
|
|
|
using LaneDataVector = std::vector<TurnLaneData>;
|
2016-05-13 13:18:00 -04:00
|
|
|
|
|
|
|
// convertes a string given in the OSM format into a TurnLaneData vector
|
2024-05-24 14:34:04 -04:00
|
|
|
[[nodiscard]] LaneDataVector
|
|
|
|
laneDataFromDescription(const extractor::TurnLaneDescription &turn_lane_description);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2016-06-21 04:41:08 -04:00
|
|
|
// Locate A Tag in a lane data vector (if multiple tags are set, the first one found is returned)
|
2018-01-05 08:33:53 -05:00
|
|
|
LaneDataVector::const_iterator findTag(const extractor::TurnLaneType::Mask tag,
|
|
|
|
const LaneDataVector &data);
|
|
|
|
LaneDataVector::iterator findTag(const extractor::TurnLaneType::Mask tag, LaneDataVector &data);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2016-06-21 04:41:08 -04:00
|
|
|
// Returns true if any of the queried tags is contained
|
2018-01-05 08:33:53 -05:00
|
|
|
bool hasTag(const extractor::TurnLaneType::Mask tag, const LaneDataVector &data);
|
2022-12-20 12:00:11 -05:00
|
|
|
} // namespace osrm::guidance::lanes
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
#endif /* OSRM_GUIDANCE_TURN_LANE_DATA_HPP_ */
|