get_name_for_id -> GetNameForID

This commit is contained in:
Patrick Niklaus 2016-03-18 19:21:13 +01:00
parent ea93f6f560
commit 5c01878542
9 changed files with 14 additions and 14 deletions

View File

@ -48,7 +48,7 @@ class BaseAPI
protected: protected:
util::json::Object MakeWaypoint(const PhantomNode &phantom) const util::json::Object MakeWaypoint(const PhantomNode &phantom) const
{ {
return json::makeWaypoint(phantom.location, facade.get_name_for_id(phantom.name_id), return json::makeWaypoint(phantom.location, facade.GetNameForID(phantom.name_id),
Hint{phantom, facade.GetCheckSum()}); Hint{phantom, facade.GetCheckSum()});
} }

View File

@ -138,7 +138,7 @@ class BaseDataFacade
virtual unsigned GetNameIndexFromEdgeID(const unsigned id) const = 0; virtual unsigned GetNameIndexFromEdgeID(const unsigned id) const = 0;
virtual std::string get_name_for_id(const unsigned name_id) const = 0; virtual std::string GetNameForID(const unsigned name_id) const = 0;
virtual std::size_t GetCoreSize() const = 0; virtual std::size_t GetCoreSize() const = 0;

View File

@ -551,7 +551,7 @@ class InternalDataFacade final : public BaseDataFacade
return m_name_ID_list.at(id); return m_name_ID_list.at(id);
} }
std::string get_name_for_id(const unsigned name_id) const override final std::string GetNameForID(const unsigned name_id) const override final
{ {
if (std::numeric_limits<unsigned>::max() == name_id) if (std::numeric_limits<unsigned>::max() == name_id)
{ {

View File

@ -621,7 +621,7 @@ class SharedDataFacade final : public BaseDataFacade
return m_name_ID_list.at(id); return m_name_ID_list.at(id);
} }
std::string get_name_for_id(const unsigned name_id) const override final std::string GetNameForID(const unsigned name_id) const override final
{ {
if (std::numeric_limits<unsigned>::max() == name_id) if (std::numeric_limits<unsigned>::max() == name_id)
{ {

View File

@ -139,12 +139,12 @@ RouteLeg assembleLeg(const DataFacadeT &facade,
BOOST_ASSERT(summary_array.begin() != summary_array.end()); BOOST_ASSERT(summary_array.begin() != summary_array.end());
std::string summary = std::string summary =
std::accumulate(std::next(summary_array.begin()), summary_array.end(), std::accumulate(std::next(summary_array.begin()), summary_array.end(),
facade.get_name_for_id(summary_array.front()), facade.GetNameForID(summary_array.front()),
[&facade](std::string previous, const std::uint32_t name_id) [&facade](std::string previous, const std::uint32_t name_id)
{ {
if (name_id != 0) if (name_id != 0)
{ {
previous += ", " + facade.get_name_for_id(name_id); previous += ", " + facade.GetNameForID(name_id);
} }
return previous; return previous;
}); });

View File

@ -92,7 +92,7 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
if (path_point.turn_instruction != extractor::guidance::TurnInstruction::NO_TURN()) if (path_point.turn_instruction != extractor::guidance::TurnInstruction::NO_TURN())
{ {
BOOST_ASSERT(segment_duration >= 0); BOOST_ASSERT(segment_duration >= 0);
const auto name = facade.get_name_for_id(path_point.name_id); const auto name = facade.GetNameForID(path_point.name_id);
const auto distance = leg_geometry.segment_distances[segment_index]; const auto distance = leg_geometry.segment_distances[segment_index];
steps.push_back(RouteStep{path_point.name_id, steps.push_back(RouteStep{path_point.name_id,
name, name,
@ -113,7 +113,7 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
const int duration = segment_duration + target_duration; const int duration = segment_duration + target_duration;
BOOST_ASSERT(duration >= 0); BOOST_ASSERT(duration >= 0);
steps.push_back(RouteStep{target_node.name_id, steps.push_back(RouteStep{target_node.name_id,
facade.get_name_for_id(target_node.name_id), facade.GetNameForID(target_node.name_id),
duration / 10., duration / 10.,
distance, distance,
target_mode, target_mode,
@ -141,7 +141,7 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
BOOST_ASSERT(duration >= 0); BOOST_ASSERT(duration >= 0);
steps.push_back(RouteStep{source_node.name_id, steps.push_back(RouteStep{source_node.name_id,
facade.get_name_for_id(source_node.name_id), facade.GetNameForID(source_node.name_id),
duration / 10., duration / 10.,
leg_geometry.segment_distances[segment_index], leg_geometry.segment_distances[segment_index],
source_mode, source_mode,
@ -164,7 +164,7 @@ std::vector<RouteStep> assembleSteps(const DataFacadeT &facade,
// This step has length zero, the only reason we need it is the target location // This step has length zero, the only reason we need it is the target location
steps.push_back( steps.push_back(
RouteStep{target_node.name_id, RouteStep{target_node.name_id,
facade.get_name_for_id(target_node.name_id), facade.GetNameForID(target_node.name_id),
ZERO_DURACTION, ZERO_DURACTION,
ZERO_DISTANCE, ZERO_DISTANCE,
target_mode, target_mode,

View File

@ -23,7 +23,7 @@ class NameTable
public: public:
NameTable(const std::string &filename); NameTable(const std::string &filename);
std::string get_name_for_id(const unsigned name_id) const; std::string GetNameForID(const unsigned name_id) const;
}; };
} // namespace util } // namespace util
} // namespace osrm } // namespace osrm

View File

@ -752,8 +752,8 @@ TurnInstruction TurnAnalysis::getInstructionForObvious(const std::size_t num_roa
const auto &in_data = node_based_graph.GetEdgeData(via_edge); const auto &in_data = node_based_graph.GetEdgeData(via_edge);
const auto &out_data = node_based_graph.GetEdgeData(road.turn.eid); const auto &out_data = node_based_graph.GetEdgeData(road.turn.eid);
if (in_data.name_id != out_data.name_id && if (in_data.name_id != out_data.name_id &&
requiresNameAnnounced(name_table.get_name_for_id(in_data.name_id), requiresNameAnnounced(name_table.GetNameForID(in_data.name_id),
name_table.get_name_for_id(out_data.name_id))) name_table.GetNameForID(out_data.name_id)))
return {TurnType::NewName, getTurnDirection(road.turn.angle)}; return {TurnType::NewName, getTurnDirection(road.turn.angle)};
else else
return {TurnType::Suppressed, getTurnDirection(road.turn.angle)}; return {TurnType::Suppressed, getTurnDirection(road.turn.angle)};

View File

@ -40,7 +40,7 @@ NameTable::NameTable(const std::string &filename)
} }
} }
std::string NameTable::get_name_for_id(const unsigned name_id) const std::string NameTable::GetNameForID(const unsigned name_id) const
{ {
if (std::numeric_limits<unsigned>::max() == name_id) if (std::numeric_limits<unsigned>::max() == name_id)
{ {