2022-08-30 05:36:49 -04:00
|
|
|
#ifndef OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
|
|
|
|
#define OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
|
|
|
|
|
|
|
|
#include "util/typedefs.hpp"
|
2022-10-30 06:43:28 -04:00
|
|
|
|
|
|
|
#include <boost/functional/hash.hpp>
|
2022-08-30 05:36:49 -04:00
|
|
|
#include <unordered_set>
|
|
|
|
|
2022-12-11 04:10:26 -05:00
|
|
|
namespace osrm::extractor
|
2022-08-30 05:36:49 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
2022-12-20 12:00:11 -05:00
|
|
|
} // namespace osrm::extractor
|
2022-08-30 05:36:49 -04:00
|
|
|
|
|
|
|
#endif // OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
|