Moving TurnInstruction to unsigned char

This commit is contained in:
DennisOSRM
2012-12-17 13:14:43 +01:00
parent b247c20dbf
commit 00ed039621
10 changed files with 53 additions and 49 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ public:
NodeID via;
unsigned nameID;
int distance;
short turnInstruction;
TurnInstruction turnInstruction;
bool shortcut:1;
bool forward:1;
bool backward:1;
+2 -2
View File
@@ -280,7 +280,7 @@ void EdgeBasedGraphFactory::Run(const char * originalEdgeDataFilename) {
if(_trafficLights.find(v) != _trafficLights.end()) {
distance += speedProfile.trafficSignalPenalty;
}
short turnInstruction = AnalyzeTurn(u, v, w);
TurnInstruction turnInstruction = AnalyzeTurn(u, v, w);
if(turnInstruction == TurnInstructions.UTurn)
distance += speedProfile.uTurnPenalty;
// if(!edgeData1.isAccessRestricted && edgeData2.isAccessRestricted) {
@@ -334,7 +334,7 @@ void EdgeBasedGraphFactory::Run(const char * originalEdgeDataFilename) {
INFO("Generated " << edgeBasedNodes.size() << " edge based nodes");
}
short EdgeBasedGraphFactory::AnalyzeTurn(const NodeID u, const NodeID v, const NodeID w) const {
TurnInstruction EdgeBasedGraphFactory::AnalyzeTurn(const NodeID u, const NodeID v, const NodeID w) const {
if(u == w) {
return TurnInstructions.UTurn;
}
+2 -2
View File
@@ -69,7 +69,7 @@ private:
unsigned nameID;
bool forward;
bool backward;
short turnInstruction;
TurnInstruction turnInstruction;
};
typedef DynamicGraph< _NodeBasedEdgeData > _NodeBasedDynamicGraph;
@@ -138,7 +138,7 @@ public:
void GetEdgeBasedEdges( DeallocatingVector< EdgeBasedEdge >& edges );
void GetEdgeBasedNodes( DeallocatingVector< EdgeBasedNode> & nodes);
void GetOriginalEdgeData( std::vector< OriginalEdgeData> & originalEdgeData);
short AnalyzeTurn(const NodeID u, const NodeID v, const NodeID w) const;
TurnInstruction AnalyzeTurn(const NodeID u, const NodeID v, const NodeID w) const;
unsigned GetNumberOfNodes() const;
};