struct _Egde now has constructor to also set nameid

This commit is contained in:
DennisOSRM 2011-10-04 18:33:40 +02:00
parent b1f2f2786c
commit cd03ad9207

View File

@ -71,7 +71,7 @@ struct _Way {
_Way() : id(UINT_MAX), nameID(UINT_MAX) { _Way() : id(UINT_MAX), nameID(UINT_MAX) {
direction = _Way::notSure; direction = _Way::notSure;
maximumSpeed = -1; speed = -1;
type = -1; type = -1;
useful = false; useful = false;
access = true; access = true;
@ -83,7 +83,7 @@ struct _Way {
unsigned id; unsigned id;
unsigned nameID; unsigned nameID;
std::string name; std::string name;
double maximumSpeed; double speed;
short type; short type;
bool useful:1; bool useful:1;
bool access:1; bool access:1;
@ -123,6 +123,7 @@ struct _Edge {
_Edge() : start(0), target(0), type(0), direction(0), speed(0), nameID(0) {}; _Edge() : start(0), target(0), type(0), direction(0), speed(0), nameID(0) {};
_Edge(NodeID s, NodeID t) : start(s), target(t), type(0), direction(0), speed(0), nameID(0) { } _Edge(NodeID s, NodeID t) : start(s), target(t), type(0), direction(0), speed(0), nameID(0) { }
_Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), nameID(0) { } _Edge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), nameID(0) { }
_Edge(NodeID s, NodeID t, short tp, short d, double sp, unsigned nid): start(s), target(t), type(tp), direction(d), speed(sp), nameID(nid) { }
NodeID start; NodeID start;
NodeID target; NodeID target;
short type; short type;
@ -237,6 +238,7 @@ struct CmpWayStartAndEnd : public std::binary_function<_WayIDStartAndEndEdge, _W
}; };
struct Settings { struct Settings {
Settings() : obeyPollards(false), obeyOneways(false), useRestrictions(false), accessTag("motorcar") {}
StringMap speedProfile; StringMap speedProfile;
int operator[](const string & param) const { int operator[](const string & param) const {
if(speedProfile.find(param) == speedProfile.end()) if(speedProfile.find(param) == speedProfile.end())
@ -244,6 +246,11 @@ struct Settings {
else else
return speedProfile.at(param); return speedProfile.at(param);
} }
bool obeyPollards;
bool obeyOneways;
bool useRestrictions;
string accessTag;
}; };
struct Cmp : public std::binary_function<NodeID, NodeID, bool> { struct Cmp : public std::binary_function<NodeID, NodeID, bool> {