Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2017-10-25 13:22:54 +0300
committermpimenov <mpimenov@users.noreply.github.com>2017-10-25 17:10:31 +0300
commitf8545f98718cdb4fce3be80dd1bddcd8a83a26e3 (patch)
tree85a60cca216d594a6a2529ec47ff28fe69b4f0fb
parent5dbd3057262333b305dbd445dbeb314e3edfe8bd (diff)
Review fixes.
-rw-r--r--generator/transit_generator.cpp1
-rw-r--r--generator/transit_generator.hpp5
-rw-r--r--routing_common/transit_serdes.hpp10
-rw-r--r--routing_common/transit_types.hpp17
4 files changed, 15 insertions, 18 deletions
diff --git a/generator/transit_generator.cpp b/generator/transit_generator.cpp
index fbe15a35ad..4d6753029a 100644
--- a/generator/transit_generator.cpp
+++ b/generator/transit_generator.cpp
@@ -227,7 +227,6 @@ void BuildTransit(string const & mwmDir, string const & countryId,
"sections."));
NOTIMPLEMENTED();
-// string const countryId = GetFileName(mwmDir);
std::string const mwmPath = my::JoinFoldersToPath(mwmDir, countryId + DATA_FILE_EXTENSION);
string const graphFullPath = my::JoinFoldersToPath(transitDir, countryId + TRANSIT_FILE_EXTENSION);
diff --git a/generator/transit_generator.hpp b/generator/transit_generator.hpp
index 8e598fb9a0..9bd5b1297d 100644
--- a/generator/transit_generator.hpp
+++ b/generator/transit_generator.hpp
@@ -108,8 +108,9 @@ private:
};
/// \brief Builds the transit section in the mwm.
-/// \param mwmDir relative or full path to an mwm. The name of mwm without extension is considered
-/// as country id.
+/// \param mwmDir relative or full path to a directory where mwm is located.
+/// \param countryId is an mwm name without extension of the processed mwm.
+/// \param osmIdsToFeatureIdPath is a path to a file with osm ids to feature id mapping.
/// \param transitDir a path to directory with json files with transit graphs.
/// \note An mwm pointed by |mwmPath| should contain:
/// * feature geometry
diff --git a/routing_common/transit_serdes.hpp b/routing_common/transit_serdes.hpp
index ffaba9def2..eee0640740 100644
--- a/routing_common/transit_serdes.hpp
+++ b/routing_common/transit_serdes.hpp
@@ -102,11 +102,6 @@ public:
(*this)(id.GetFeatureId(), name);
}
- void operator()(StopIdRanges const & rs, char const * name = nullptr)
- {
- (*this)(rs.GetIds(), name);
- }
-
template <typename T>
void operator()(std::vector<T> const & vs, char const * /* name */ = nullptr)
{
@@ -183,11 +178,6 @@ public:
id = FeatureIdentifiers(kInvalidOsmId, featureId);
}
- void operator()(StopIdRanges & rs, char const * name = nullptr)
- {
- operator()(rs.m_ids, name);
- }
-
void operator()(vector<m2::PointD> & vs, char const * /* name */ = nullptr)
{
auto const size = ReadVarUint<uint64_t, Source>(m_source);
diff --git a/routing_common/transit_types.hpp b/routing_common/transit_types.hpp
index 4fe96760f2..aae56180e8 100644
--- a/routing_common/transit_types.hpp
+++ b/routing_common/transit_types.hpp
@@ -15,14 +15,14 @@ namespace routing
class TransitGraphLoader;
namespace transit
{
+using Anchor = uint8_t;
+using FeatureId = uint32_t;
using LineId = uint32_t;
-using StopId = uint64_t;
-using TransferId = uint64_t;
using NetworkId = uint32_t;
-using FeatureId = uint32_t;
using OsmId = uint64_t;
+using StopId = uint64_t;
+using TransferId = uint64_t;
using Weight = double;
-using Anchor = uint8_t;
using Ranges = std::vector<std::vector<StopId>>;
LineId constexpr kInvalidLineId = std::numeric_limits<LineId>::max();
@@ -53,6 +53,7 @@ struct TransitHeader
TransitHeader(uint16_t version, uint32_t gatesOffset, uint32_t edgesOffset,
uint32_t transfersOffset, uint32_t linesOffset, uint32_t shapesOffset,
uint32_t networksOffset, uint32_t endOffset);
+
void Reset();
bool IsEqualForTesting(TransitHeader const & header) const;
bool IsValid() const;
@@ -185,6 +186,7 @@ public:
Gate() = default;
Gate(FeatureIdentifiers const & featureIdentifiers, bool entrance, bool exit, double weight,
std::vector<StopId> const & stopIds, m2::PointD const & point);
+
bool IsEqualForTesting(Gate const & gate) const;
bool IsValid() const;
void SetBestPedestrianSegment(SingleMwmSegment const & s) { m_bestPedestrianSegment = s; };
@@ -246,6 +248,7 @@ public:
Edge() = default;
Edge(StopId stop1Id, StopId stop2Id, double weight, LineId lineId, bool transfer,
std::vector<ShapeId> const & shapeIds);
+
bool IsEqualForTesting(Edge const & edge) const;
bool IsValid() const;
void SetWeight(double weight) { m_weight = weight; }
@@ -278,6 +281,7 @@ public:
Transfer() = default;
Transfer(StopId id, m2::PointD const & point, std::vector<StopId> const & stopIds,
std::vector<TitleAnchor> const & titleAnchors);
+
bool IsEqualForTesting(Transfer const & transfer) const;
bool IsValid() const;
@@ -303,8 +307,8 @@ class StopIdRanges
public:
StopIdRanges() = default;
explicit StopIdRanges(Ranges const & ids) : m_ids(ids) {}
+
bool operator==(StopIdRanges const & rhs) const { return m_ids == rhs.m_ids; }
- bool IsEqualForTesting(StopIdRanges const & rhs) const { return *this == rhs; }
bool IsValid() const { return !m_ids.empty(); }
Ranges const & GetIds() const { return m_ids; }
@@ -322,6 +326,7 @@ public:
Line() = default;
Line(LineId id, std::string const & number, std::string const & title, std::string const & type,
NetworkId networkId, Ranges const & stopIds);
+
bool IsEqualForTesting(Line const & line) const;
bool IsValid() const;
@@ -352,6 +357,7 @@ class Shape
public:
Shape() = default;
Shape(ShapeId const & id, std::vector<m2::PointD> const & polyline) : m_id(id), m_polyline(polyline) {}
+
bool IsEqualForTesting(Shape const & shape) const;
bool IsValid() const { return m_id.IsValid() && m_polyline.size() > 1; }
@@ -371,6 +377,7 @@ class Network
public:
Network() = default;
Network(NetworkId id, std::string const & title);
+
bool IsEqualForTesting(Network const & shape) const;
bool IsValid() const;