speedprofile is now represented as hash table and operator[] const() has
been defined.
This commit is contained in:
parent
1db1b4e5ae
commit
b1f2f2786c
@ -23,7 +23,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "HashTable.h"
|
#include <boost/unordered_map.hpp>
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|
||||||
struct _PathData {
|
struct _PathData {
|
||||||
@ -31,7 +31,7 @@ struct _PathData {
|
|||||||
NodeID node;
|
NodeID node;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef google::dense_hash_map<std::string, NodeID> StringMap;
|
typedef boost::unordered_map<std::string, NodeID> StringMap;
|
||||||
|
|
||||||
struct _Node : NodeInfo{
|
struct _Node : NodeInfo{
|
||||||
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {}
|
_Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {}
|
||||||
@ -237,16 +237,12 @@ struct CmpWayStartAndEnd : public std::binary_function<_WayIDStartAndEndEdge, _W
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Settings {
|
struct Settings {
|
||||||
struct SpeedProfile {
|
StringMap speedProfile;
|
||||||
vector< double > speed;
|
int operator[](const string & param) const {
|
||||||
vector< string > names;
|
if(speedProfile.find(param) == speedProfile.end())
|
||||||
} speedProfile;
|
return 0;
|
||||||
int indexInAccessListOf( const string & key) {
|
else
|
||||||
for(unsigned i = 0; i< speedProfile.names.size(); i++) {
|
return speedProfile.at(param);
|
||||||
if(speedProfile.names[i] == key)
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user