forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
6e88197b5e
commit
44ab61e68d
4 changed files with 29 additions and 29 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ public:
|
|||
void operator()(StopIdRanges & rs, char const * name = nullptr);
|
||||
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_same<T, Edge::MonotoneEdgeId>::value ||
|
||||
std::is_same<T, Stop::MonotoneStopId>::value>::type
|
||||
typename std::enable_if<std::is_same<T, Edge::WrappedEdgeId>::value ||
|
||||
std::is_same<T, Stop::WrappedStopId>::value>::type
|
||||
operator()(T & t, char const * name = nullptr)
|
||||
{
|
||||
typename T::RepType id;
|
||||
|
@ -76,8 +76,8 @@ public:
|
|||
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_class<T>::value &&
|
||||
!std::is_same<T, Edge::MonotoneEdgeId>::value &&
|
||||
!std::is_same<T, Stop::MonotoneStopId>::value>::type
|
||||
!std::is_same<T, Edge::WrappedEdgeId>::value &&
|
||||
!std::is_same<T, Stop::WrappedStopId>::value>::type
|
||||
operator()(T & t, char const * name = nullptr)
|
||||
{
|
||||
if (name != nullptr && json_is_object(m_node))
|
||||
|
|
|
@ -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<uint64_t>(t.Get() - m_lastEncodedMonotoneEdgeId.Get()));
|
||||
m_lastEncodedMonotoneEdgeId = t;
|
||||
CHECK_GREATER_OR_EQUAL(id.Get(), m_lastWrappedEdgeId.Get(), ());
|
||||
WriteVarUint(m_sink, static_cast<uint64_t>(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<uint64_t>(t.Get() - m_lastEncodedMonotoneStopId.Get()));
|
||||
m_lastEncodedMonotoneStopId = t;
|
||||
CHECK_GREATER_OR_EQUAL(id.Get(), m_lastWrappedStopId.Get(), ());
|
||||
WriteVarUint(m_sink, static_cast<uint64_t>(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 <typename Source>
|
||||
|
@ -211,16 +211,16 @@ public:
|
|||
p = Int64ToPoint(ReadVarInt<int64_t, Source>(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<uint64_t, Source>(m_source));
|
||||
m_lastDecodedMonotoneEdgeId = t;
|
||||
t = m_lastWrappedEdgeId + Edge::WrappedEdgeId(ReadVarUint<uint64_t, Source>(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<uint64_t, Source>(m_source));
|
||||
m_lastDecodedMonotoneStopId = t;
|
||||
t = m_lastWrappedStopId + Stop::WrappedStopId(ReadVarUint<uint64_t, Source>(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 <typename Sink>
|
||||
|
|
|
@ -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<LineId> m_lineIds;
|
||||
m2::PointD m_point;
|
||||
std::vector<TitleAnchor> 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<ShapeId> m_shapeIds;
|
||||
};
|
||||
NEWTYPE_SIMPLE_OUTPUT(Edge::MonotoneEdgeId)
|
||||
NEWTYPE_SIMPLE_OUTPUT(Edge::WrappedEdgeId)
|
||||
|
||||
class Transfer
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue