osrm-backend/include/guidance/turn_lane_data.hpp

38 lines
1.3 KiB
C++
Raw Permalink Normal View History

#ifndef OSRM_GUIDANCE_TURN_LANE_DATA_HPP_
#define OSRM_GUIDANCE_TURN_LANE_DATA_HPP_
2016-05-13 13:18:00 -04: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>
namespace osrm::guidance::lanes
2016-05-13 13:18:00 -04:00
{
struct TurnLaneData
{
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;
};
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
[[nodiscard]] LaneDataVector
laneDataFromDescription(const extractor::TurnLaneDescription &turn_lane_description);
2016-05-13 13:18:00 -04:00
// Locate A Tag in a lane data vector (if multiple tags are set, the first one found is returned)
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
// Returns true if any of the queried tags is contained
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
#endif /* OSRM_GUIDANCE_TURN_LANE_DATA_HPP_ */