Work on forward/backward ref's support

This commit is contained in:
Denis Koronchik
2017-10-13 19:05:04 +03:00
committed by Patrick Niklaus
parent 37774a331a
commit 895f072425
7 changed files with 162 additions and 110 deletions
+8 -4
View File
@@ -47,7 +47,8 @@ struct ExtractionWay
duration = -1;
weight = -1;
name.clear();
ref.clear();
forward_ref.clear();
backward_ref.clear();
pronunciation.clear();
destinations.clear();
exits.clear();
@@ -67,8 +68,10 @@ struct ExtractionWay
// wrappers to allow assigning nil (nullptr) to string values
void SetName(const char *value) { detail::maybeSetString(name, value); }
const char *GetName() const { return name.c_str(); }
void SetRef(const char *value) { detail::maybeSetString(ref, value); }
const char *GetRef() const { return ref.c_str(); }
void SetForwardRef(const char *value) { detail::maybeSetString(forward_ref, value); }
const char *GetForwardRef() const { return forward_ref.c_str(); }
void SetBackwardRef(const char *value) { detail::maybeSetString(backward_ref, value); }
const char *GetBackwardRef() const { return backward_ref.c_str(); }
void SetDestinations(const char *value) { detail::maybeSetString(destinations, value); }
const char *GetDestinations() const { return destinations.c_str(); }
void SetExits(const char *value) { detail::maybeSetString(exits, value); }
@@ -101,7 +104,8 @@ struct ExtractionWay
// weight of the whole way in both directions
double weight;
std::string name;
std::string ref;
std::string forward_ref;
std::string backward_ref;
std::string pronunciation;
std::string destinations;
std::string exits;
+2 -1
View File
@@ -63,7 +63,8 @@ class ExtractorCallbacks
// actually maps to name ids
using MapKey = std::tuple<std::string, std::string, std::string, std::string, std::string>;
using MapVal = unsigned;
std::unordered_map<MapKey, MapVal> string_map;
using StringMap = std::unordered_map<MapKey, MapVal>;
StringMap string_map;
ExtractionContainers &external_memory;
std::unordered_map<std::string, ClassData> &classes_map;
guidance::LaneDescriptionMap &lane_description_map;