#pragma once #include "geometry/point2d.hpp" #include "base/assert.hpp" #include #include #include #include #include #include namespace routing { class Route; /// Routing possible statuses enumeration. /// \warning this enum has JNI mirror! /// \see android/src/com/mapswithme/maps/routing/ResultCodesHelper.java // TODO(bykoianko): Items become obsolete now should be removed from the enum. enum class RouterResultCode { NoError = 0, Cancelled = 1, NoCurrentPosition = 2, InconsistentMWMandRoute = 3, RouteFileNotExist = 4, StartPointNotFound = 5, EndPointNotFound = 6, PointsInDifferentMWM = 7, RouteNotFound = 8, NeedMoreMaps = 9, InternalError = 10, FileTooOld = 11, IntermediatePointNotFound = 12, TransitRouteNotFoundNoNetwork = 13, TransitRouteNotFoundTooLongPedestrian = 14, RouteNotFoundRedressRouteError = 15, HasWarnings = 16, }; using CheckpointCallback = std::function; using NeedMoreMapsCallback = std::function const &)>; using PointCheckCallback = std::function; using ProgressCallback = std::function; using ReadyCallback = std::function; using ReadyCallbackOwnership = std::function, RouterResultCode)>; using RemoveRouteCallback = std::function; using RouteCallback = std::function; using RoutingStatisticsCallback = std::function const &)>; using SpeedCameraShowCallback = std::function; using SpeedCameraClearCallback = std::function; inline std::string DebugPrint(RouterResultCode code) { switch (code) { case RouterResultCode::NoError: return "NoError"; case RouterResultCode::Cancelled: return "Cancelled"; case RouterResultCode::NoCurrentPosition: return "NoCurrentPosition"; case RouterResultCode::InconsistentMWMandRoute: return "InconsistentMWMandRoute"; case RouterResultCode::RouteFileNotExist: return "RouteFileNotExist"; case RouterResultCode::StartPointNotFound: return "StartPointNotFound"; case RouterResultCode::EndPointNotFound: return "EndPointNotFound"; case RouterResultCode::PointsInDifferentMWM: return "PointsInDifferentMWM"; case RouterResultCode::RouteNotFound: return "RouteNotFound"; case RouterResultCode::InternalError: return "InternalError"; case RouterResultCode::NeedMoreMaps: return "NeedMoreMaps"; case RouterResultCode::FileTooOld: return "FileTooOld"; case RouterResultCode::IntermediatePointNotFound: return "IntermediatePointNotFound"; case RouterResultCode::TransitRouteNotFoundNoNetwork: return "TransitRouteNotFoundNoNetwork"; case RouterResultCode::TransitRouteNotFoundTooLongPedestrian: return "TransitRouteNotFoundTooLongPedestrian"; case RouterResultCode::RouteNotFoundRedressRouteError: return "RouteNotFoundRedressRouteError"; case RouterResultCode::HasWarnings: return "HasWarnings"; } std::string const result = "Unknown RouterResultCode: " + std::to_string(static_cast(code)); ASSERT(false, (result)); return result; } // This define should be set to see the spread of A* waves on the map. // #define SHOW_ROUTE_DEBUG_MARKS } // namespace routing