osrm-backend/include/extractor/import_edge.hpp

101 lines
2.7 KiB
C++
Raw Normal View History

#ifndef IMPORT_EDGE_HPP
#define IMPORT_EDGE_HPP
2013-08-05 11:28:57 -04:00
2016-01-02 11:13:44 -05:00
#include "extractor/travel_mode.hpp"
#include "util/typedefs.hpp"
2013-08-16 07:34:28 -04:00
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace extractor
{
struct NodeBasedEdge
2014-05-07 12:39:16 -04:00
{
bool operator<(const NodeBasedEdge &e) const;
2010-07-09 05:05:40 -04:00
NodeBasedEdge();
explicit NodeBasedEdge(NodeID source,
NodeID target,
NodeID name_id,
EdgeWeight weight,
bool forward,
bool backward,
bool roundabout,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
bool is_split);
2014-05-29 12:46:20 -04:00
NodeID source;
NodeID target;
NodeID name_id;
2014-05-29 12:46:20 -04:00
EdgeWeight weight;
2014-05-07 12:39:16 -04:00
bool forward : 1;
bool backward : 1;
2014-05-29 12:46:20 -04:00
bool roundabout : 1;
bool access_restricted : 1;
bool startpoint : 1;
2014-05-07 12:39:16 -04:00
bool is_split : 1;
2014-08-11 08:07:00 -04:00
TravelMode travel_mode : 4;
2010-07-09 05:05:40 -04:00
};
struct NodeBasedEdgeWithOSM : NodeBasedEdge
{
explicit NodeBasedEdgeWithOSM(OSMNodeID source,
2016-01-05 06:04:04 -05:00
OSMNodeID target,
NodeID name_id,
EdgeWeight weight,
bool forward,
bool backward,
bool roundabout,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
bool is_split)
: NodeBasedEdge(SPECIAL_NODEID,
SPECIAL_NODEID,
name_id,
weight,
forward,
backward,
roundabout,
access_restricted,
startpoint,
travel_mode,
is_split),
osm_source_id(source), osm_target_id(target)
{
}
OSMNodeID osm_source_id;
OSMNodeID osm_target_id;
};
struct EdgeBasedEdge
2014-05-07 12:39:16 -04:00
{
2014-05-07 12:39:16 -04:00
public:
bool operator<(const EdgeBasedEdge &e) const;
template <class EdgeT> explicit EdgeBasedEdge(const EdgeT &myEdge);
EdgeBasedEdge();
2014-05-07 12:39:16 -04:00
explicit EdgeBasedEdge(const NodeID source,
const NodeID target,
const NodeID edge_id,
const EdgeWeight weight,
const bool forward,
const bool backward);
NodeID source;
NodeID target;
NodeID edge_id;
EdgeWeight weight : 30;
bool forward : 1;
bool backward : 1;
};
2016-01-05 10:51:13 -05:00
}
}
#endif /* IMPORT_EDGE_HPP */