diff --git a/generator/transit_generator.cpp b/generator/transit_generator.cpp index e502b9ddad..3589e262b8 100644 --- a/generator/transit_generator.cpp +++ b/generator/transit_generator.cpp @@ -262,7 +262,7 @@ void DeserializerFromJson::operator()(EdgeFlags & edgeFlags, char const * name) bool transfer = false; (*this)(transfer, name); // Note. Only |transfer| field of |edgeFlags| may be set at this point because the - // other fields of |edgeFlags| is unknown. + // other fields of |edgeFlags| are unknown. edgeFlags.SetFlags(0); edgeFlags.SetTransfer(transfer); } diff --git a/generator/transit_generator.hpp b/generator/transit_generator.hpp index 3273446d98..06dbe55384 100644 --- a/generator/transit_generator.hpp +++ b/generator/transit_generator.hpp @@ -47,8 +47,8 @@ public: void operator()(StopIdRanges & rs, char const * name = nullptr); template - typename std::enable_if::value || - std::is_same::value>::type + typename std::enable_if::value || + std::is_same::value>::type operator()(T & t, char const * name = nullptr) { typename T::RepType id; @@ -76,8 +76,8 @@ public: template typename std::enable_if::value && - !std::is_same::value && - !std::is_same::value>::type + !std::is_same::value && + !std::is_same::value>::type operator()(T & t, char const * name = nullptr) { if (name != nullptr && json_is_object(m_node)) diff --git a/routing_common/transit_serdes.hpp b/routing_common/transit_serdes.hpp index 129a28c258..c1c59730d3 100644 --- a/routing_common/transit_serdes.hpp +++ b/routing_common/transit_serdes.hpp @@ -98,18 +98,18 @@ public: } } - void operator()(Edge::MonotoneEdgeId const & t, char const * /* name */ = nullptr) + void operator()(Edge::WrappedEdgeId const & id, char const * /* name */ = nullptr) { - CHECK_GREATER_OR_EQUAL(t.Get(), m_lastEncodedMonotoneEdgeId.Get(), ()); - WriteVarUint(m_sink, static_cast(t.Get() - m_lastEncodedMonotoneEdgeId.Get())); - m_lastEncodedMonotoneEdgeId = t; + CHECK_GREATER_OR_EQUAL(id.Get(), m_lastWrappedEdgeId.Get(), ()); + WriteVarUint(m_sink, static_cast(id.Get() - m_lastWrappedEdgeId.Get())); + m_lastWrappedEdgeId = id; } - void operator()(Stop::MonotoneStopId const & t, char const * /* name */ = nullptr) + void operator()(Stop::WrappedStopId const & id, char const * /* name */ = nullptr) { - CHECK_GREATER_OR_EQUAL(t.Get(), m_lastEncodedMonotoneStopId.Get(), ()); - WriteVarUint(m_sink, static_cast(t.Get() - m_lastEncodedMonotoneStopId.Get())); - m_lastEncodedMonotoneStopId = t; + CHECK_GREATER_OR_EQUAL(id.Get(), m_lastWrappedStopId.Get(), ()); + WriteVarUint(m_sink, static_cast(id.Get() - m_lastWrappedStopId.Get())); + m_lastWrappedStopId = id; } void operator()(FeatureIdentifiers const & id, char const * name = nullptr) @@ -157,8 +157,8 @@ public: private: Sink & m_sink; - Edge::MonotoneEdgeId m_lastEncodedMonotoneEdgeId = Edge::MonotoneEdgeId(0); - Stop::MonotoneStopId m_lastEncodedMonotoneStopId = Stop::MonotoneStopId(0); + Edge::WrappedEdgeId m_lastWrappedEdgeId = {}; + Stop::WrappedStopId m_lastWrappedStopId = {}; }; template @@ -211,16 +211,16 @@ public: p = Int64ToPoint(ReadVarInt(m_source), POINT_COORD_BITS); } - void operator()(Edge::MonotoneEdgeId & t, char const * /* name */ = nullptr) + void operator()(Edge::WrappedEdgeId & t, char const * /* name */ = nullptr) { - t = m_lastDecodedMonotoneEdgeId + Edge::MonotoneEdgeId(ReadVarUint(m_source)); - m_lastDecodedMonotoneEdgeId = t; + t = m_lastWrappedEdgeId + Edge::WrappedEdgeId(ReadVarUint(m_source)); + m_lastWrappedEdgeId = t; } - void operator()(Stop::MonotoneStopId & t, char const * /* name */ = nullptr) + void operator()(Stop::WrappedStopId & t, char const * /* name */ = nullptr) { - t = m_lastDecodedMonotoneStopId + Stop::MonotoneStopId(ReadVarUint(m_source)); - m_lastDecodedMonotoneStopId = t; + t = m_lastWrappedStopId + Stop::WrappedStopId(ReadVarUint(m_source)); + m_lastWrappedStopId = t; } void operator()(FeatureIdentifiers & id, char const * name = nullptr) @@ -294,8 +294,8 @@ public: private: Source & m_source; - Edge::MonotoneEdgeId m_lastDecodedMonotoneEdgeId = Edge::MonotoneEdgeId(0); - Stop::MonotoneStopId m_lastDecodedMonotoneStopId = Stop::MonotoneStopId(0); + Edge::WrappedEdgeId m_lastWrappedEdgeId = {}; + Stop::WrappedStopId m_lastWrappedStopId = {}; }; template diff --git a/routing_common/transit_types.hpp b/routing_common/transit_types.hpp index ed554be984..ed004803aa 100644 --- a/routing_common/transit_types.hpp +++ b/routing_common/transit_types.hpp @@ -130,7 +130,7 @@ private: class Stop { public: - NEWTYPE(StopId, MonotoneStopId); + NEWTYPE(StopId, WrappedStopId); Stop() : m_featureIdentifiers(true /* serializeFeatureIdOnly */) {}; Stop(StopId id, OsmId osmId, FeatureId featureId, TransferId transferId, @@ -157,14 +157,14 @@ private: visitor(m_lineIds, "line_ids"), visitor(m_point, "point"), visitor(m_titleAnchors, "title_anchors")) - MonotoneStopId m_id = MonotoneStopId(kInvalidStopId); + WrappedStopId m_id = WrappedStopId(kInvalidStopId); FeatureIdentifiers m_featureIdentifiers; TransferId m_transferId = kInvalidTransferId; std::vector m_lineIds; m2::PointD m_point; std::vector m_titleAnchors; }; -NEWTYPE_SIMPLE_OUTPUT(Stop::MonotoneStopId) +NEWTYPE_SIMPLE_OUTPUT(Stop::WrappedStopId) class SingleMwmSegment { @@ -304,7 +304,7 @@ std::string DebugPrint(EdgeFlags const & f); class Edge { public: - NEWTYPE(StopId, MonotoneEdgeId); + NEWTYPE(StopId, WrappedEdgeId); Edge() = default; Edge(StopId stop1Id, StopId stop2Id, Weight weight, LineId lineId, bool transfer, @@ -330,14 +330,14 @@ private: visitor(m_lineId, "line_id"), visitor(m_flags, "transfer"), visitor(m_shapeIds, "shape_ids")) - MonotoneEdgeId m_stop1Id = MonotoneEdgeId(kInvalidStopId); + WrappedEdgeId m_stop1Id = WrappedEdgeId(kInvalidStopId); StopId m_stop2Id = kInvalidStopId; Weight m_weight = kInvalidWeight; // in seconds LineId m_lineId = kInvalidLineId; EdgeFlags m_flags; std::vector m_shapeIds; }; -NEWTYPE_SIMPLE_OUTPUT(Edge::MonotoneEdgeId) +NEWTYPE_SIMPLE_OUTPUT(Edge::WrappedEdgeId) class Transfer {