osrm-backend/include/extractor/traffic_signals.hpp
2022-12-20 18:00:11 +01:00

26 lines
656 B
C++

#ifndef OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
#define OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
#include "util/typedefs.hpp"
#include <boost/functional/hash.hpp>
#include <unordered_set>
namespace osrm::extractor
{
struct TrafficSignals
{
std::unordered_set<NodeID> bidirectional_nodes;
std::unordered_set<std::pair<NodeID, NodeID>, boost::hash<std::pair<NodeID, NodeID>>>
unidirectional_segments;
inline bool HasSignal(NodeID from, NodeID to) const
{
return bidirectional_nodes.count(to) > 0 || unidirectional_segments.count({from, to}) > 0;
}
};
} // namespace osrm::extractor
#endif // OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP