refactor Hashtable

This commit is contained in:
Dennis Luxen
2013-08-06 16:39:04 +02:00
parent e7cec83a4c
commit e06fe6935a
9 changed files with 30 additions and 47 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ struct ExtractionWay {
id = UINT_MAX;
nameID = UINT_MAX;
path.clear();
keyVals.EraseAll();
keyVals.clear();
direction = ExtractionWay::notSure;
speed = -1;
backward_speed = -1;
+2 -2
View File
@@ -177,7 +177,7 @@ inline void PBFParser::parseDenseNode(_ThreadData * threadData) {
const int keyValue = dense.keys_vals ( denseTagIndex+1 );
const std::string & key = threadData->PBFprimitiveBlock.stringtable().s(tagValue).data();
const std::string & value = threadData->PBFprimitiveBlock.stringtable().s(keyValue).data();
extracted_nodes_vector[i].keyVals.Add(key, value);
extracted_nodes_vector[i].keyVals.insert(std::make_pair(key, value));
denseTagIndex += 2;
}
}
@@ -306,7 +306,7 @@ inline void PBFParser::parseWay(_ThreadData * threadData) {
for(int j = 0; j < number_of_keys; ++j) {
const std::string & key = threadData->PBFprimitiveBlock.stringtable().s(inputWay.keys(j));
const std::string & val = threadData->PBFprimitiveBlock.stringtable().s(inputWay.vals(j));
parsed_way_vector[i].keyVals.Add(key, val);
parsed_way_vector[i].keyVals.insert(std::make_pair(key, val));
}
}
+3 -1
View File
@@ -25,8 +25,9 @@ ScriptingEnvironment::ScriptingEnvironment(const char * fileName) {
INFO("Using script " << fileName);
// Create a new lua state
for(int i = 0; i < omp_get_max_threads(); ++i)
for(int i = 0; i < omp_get_max_threads(); ++i) {
luaStateVector.push_back(luaL_newstate());
}
// Connect LuaBind to this lua state for all threads
#pragma omp parallel
@@ -85,6 +86,7 @@ ScriptingEnvironment::ScriptingEnvironment(const char * fileName) {
luabind::value("opposite", 3)
]
];
luabind::module(myLuaState) [
luabind::class_<std::vector<std::string> >("vector")
.def("Add", &std::vector<std::string>::push_back)