From 5a95eb8f5501cbc4cd1bfb7fd6b6187d95b11fbe Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Fri, 19 May 2017 11:51:14 +0300 Subject: [PATCH] [openlr] Small improvements. --- openlr/router.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openlr/router.hpp b/openlr/router.hpp index 9685269e35..e9cc11cf07 100644 --- a/openlr/router.hpp +++ b/openlr/router.hpp @@ -7,6 +7,7 @@ #include "geometry/point2d.hpp" #include "std/map.hpp" +#include "std/sstream.hpp" #include "std/utility.hpp" #include "std/vector.hpp" @@ -45,6 +46,19 @@ private: bool m_bearingChecked = false; }; + friend string DebugPrint(Vertex const & u) + { + ostringstream os; + os << "Vertex [ "; + os << "junction: " << DebugPrint(u.m_junction) << ", "; + os << "stageStart: " << DebugPrint(u.m_stageStart) << ", "; + os << "stageStartDistance: " << u.m_stageStartDistance << ", "; + os << "stage: " << u.m_stage << ", "; + os << "bearingChecked: " << u.m_bearingChecked; + os << " ]"; + return os.str(); + } + struct Edge final { Edge() = default; @@ -65,6 +79,18 @@ private: bool m_isSpecial = false; }; + friend string DebugPrint(Edge const & edge) + { + ostringstream os; + os << "Edge [ "; + os << "u: " << DebugPrint(edge.m_u) << ", "; + os << "v: " << DebugPrint(edge.m_v) << ", "; + os << "raw: " << DebugPrint(edge.m_raw) << ", "; + os << "isSpecial: " << edge.m_isSpecial; + os << " ]"; + return os.str(); + } + using Links = map>; using RoadGraphEdgesGetter = void (routing::IRoadGraph::*)(