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:
authorMikhail Gorbushin <m.gorbushin@corp.mail.ru>2019-02-21 12:46:45 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2019-02-26 15:25:39 +0300
commitdbf3450da6eec83b2084afc32bd37b5b0e777516 (patch)
tree21bf2db6a717e51c64719a6dac45dfff6a71d4ec /routing
parentd3fd89a172afb342a0d637eadea5e778485a5981 (diff)
[routing] remove std/...
Diffstat (limited to 'routing')
-rw-r--r--routing/features_road_graph.hpp15
-rw-r--r--routing/index_graph_serialization.cpp12
-rw-r--r--routing/index_graph_serialization.hpp38
-rw-r--r--routing/index_router.hpp5
-rw-r--r--routing/joint_index.hpp6
-rw-r--r--routing/loaded_path_segment.hpp10
-rw-r--r--routing/online_absent_fetcher.hpp10
-rw-r--r--routing/online_cross_fetcher.cpp2
-rw-r--r--routing/road_index.cpp2
-rw-r--r--routing/road_index.hpp22
-rw-r--r--routing/route_point.hpp2
-rw-r--r--routing/router_delegate.cpp7
-rw-r--r--routing/router_delegate.hpp5
-rw-r--r--routing/routing_integration_tests/route_test.cpp3
14 files changed, 68 insertions, 71 deletions
diff --git a/routing/features_road_graph.hpp b/routing/features_road_graph.hpp
index de32c6813a..856a6c65db 100644
--- a/routing/features_road_graph.hpp
+++ b/routing/features_road_graph.hpp
@@ -13,9 +13,10 @@
#include "base/cache.hpp"
-#include "std/map.hpp"
-#include "std/unique_ptr.hpp"
-#include "std/vector.hpp"
+#include <map>
+#include <memory>
+#include <utility>
+#include <vector>
class DataSource;
class FeatureType;
@@ -48,7 +49,7 @@ private:
double const m_maxSpeed;
double const m_offroadSpeedKMpH;
- mutable map<MwmSet::MwmId, shared_ptr<VehicleModelInterface>> m_cache;
+ mutable std::map<MwmSet::MwmId, shared_ptr<VehicleModelInterface>> m_cache;
};
class RoadInfoCache
@@ -60,7 +61,7 @@ private:
private:
using TMwmFeatureCache = base::Cache<uint32_t, RoadInfo>;
- map<MwmSet::MwmId, TMwmFeatureCache> m_cache;
+ std::map<MwmSet::MwmId, TMwmFeatureCache> m_cache;
};
public:
@@ -76,7 +77,7 @@ public:
void ForEachFeatureClosestToCross(m2::PointD const & cross,
ICrossEdgesLoader & edgesLoader) const override;
void FindClosestEdges(m2::PointD const & point, uint32_t count,
- vector<pair<Edge, Junction>> & vicinities) const override;
+ std::vector<std::pair<Edge, Junction>> & vicinities) const override;
void GetFeatureTypes(FeatureID const & featureId, feature::TypesHolder & types) const override;
void GetJunctionTypes(Junction const & junction, feature::TypesHolder & types) const override;
IRoadGraph::Mode GetMode() const override;
@@ -117,7 +118,7 @@ private:
IRoadGraph::Mode const m_mode;
mutable RoadInfoCache m_cache;
mutable CrossCountryVehicleModel m_vehicleModel;
- mutable map<MwmSet::MwmId, Value> m_mwmLocks;
+ mutable std::map<MwmSet::MwmId, Value> m_mwmLocks;
};
// @returns a distance d such as that for a given point p any edge
diff --git a/routing/index_graph_serialization.cpp b/routing/index_graph_serialization.cpp
index cad6c63817..c55e316758 100644
--- a/routing/index_graph_serialization.cpp
+++ b/routing/index_graph_serialization.cpp
@@ -9,12 +9,12 @@ uint32_t constexpr IndexGraphSerializer::JointsFilter::kPushedEntry;
// IndexGraphSerializer::SectionSerializer ---------------------------------------------------------
void IndexGraphSerializer::SectionSerializer::PreSerialize(
- IndexGraph const & graph, unordered_map<uint32_t, VehicleMask> const & masks,
+ IndexGraph const & graph, std::unordered_map<uint32_t, VehicleMask> const & masks,
JointIdEncoder & jointEncoder)
{
m_buffer.clear();
- MemWriter<vector<uint8_t>> memWriter(m_buffer);
- BitWriter<MemWriter<vector<uint8_t>>> writer(memWriter);
+ MemWriter<std::vector<uint8_t>> memWriter(m_buffer);
+ BitWriter<MemWriter<std::vector<uint8_t>>> writer(memWriter);
// -1 for uint32_t is some confusing, but it allows process first iteration in the common way.
// Gamma coder can't write 0, so init prevFeatureId = -1 in case of first featureId == 0.
@@ -65,7 +65,7 @@ void IndexGraphSerializer::JointsFilter::Push(Joint::Id jointIdInFile, RoadPoint
// IndexGraphSerializer ----------------------------------------------------------------------------
// static
-VehicleMask IndexGraphSerializer::GetRoadMask(unordered_map<uint32_t, VehicleMask> const & masks,
+VehicleMask IndexGraphSerializer::GetRoadMask(std::unordered_map<uint32_t, VehicleMask> const & masks,
uint32_t featureId)
{
auto const & it = masks.find(featureId);
@@ -90,8 +90,8 @@ uint32_t IndexGraphSerializer::ConvertJointsNumber(uint32_t jointsNumber)
// static
void IndexGraphSerializer::PrepareSectionSerializers(
- IndexGraph const & graph, unordered_map<uint32_t, VehicleMask> const & masks,
- vector<SectionSerializer> & serializers)
+ IndexGraph const & graph, std::unordered_map<uint32_t, VehicleMask> const & masks,
+ std::vector<SectionSerializer> & serializers)
{
size_t maskToIndex[kNumVehicleMasks] = {};
// Car routing is most used routing: put car sections first.
diff --git a/routing/index_graph_serialization.hpp b/routing/index_graph_serialization.hpp
index eb811e84be..c36287e29c 100644
--- a/routing/index_graph_serialization.hpp
+++ b/routing/index_graph_serialization.hpp
@@ -12,13 +12,13 @@
#include "base/checked_cast.hpp"
-#include "std/algorithm.hpp"
-#include "std/cstdint.hpp"
-#include "std/limits.hpp"
-#include "std/type_traits.hpp"
-#include "std/unordered_map.hpp"
-#include "std/utility.hpp"
-#include "std/vector.hpp"
+#include <algorithm>
+#include <cstdint>
+#include <limits>
+#include <type_traits>
+#include <unordered_map>
+#include <utility>
+#include <vector>
namespace routing
{
@@ -29,12 +29,12 @@ public:
template <class Sink>
static void Serialize(IndexGraph const & graph,
- unordered_map<uint32_t, VehicleMask> const & masks, Sink & sink)
+ std::unordered_map<uint32_t, VehicleMask> const & masks, Sink & sink)
{
Header header(graph);
JointIdEncoder jointEncoder;
- vector<SectionSerializer> serializers;
+ std::vector<SectionSerializer> serializers;
PrepareSectionSerializers(graph, masks, serializers);
for (SectionSerializer & serializer : serializers)
@@ -234,7 +234,7 @@ private:
uint8_t m_version = kLastVersion;
uint32_t m_numRoads = 0;
Joint::Id m_numJoints = 0;
- vector<Section> m_sections;
+ std::vector<Section> m_sections;
};
class JointIdEncoder final
@@ -266,7 +266,7 @@ private:
private:
Joint::Id m_count = 0;
- unordered_map<Joint::Id, Joint::Id> m_convertedIds;
+ std::unordered_map<Joint::Id, Joint::Id> m_convertedIds;
};
class JointIdDecoder final
@@ -323,7 +323,7 @@ private:
Joint::Id GetCount() const { return m_count; }
private:
- static uint32_t constexpr kEmptyEntry = numeric_limits<uint32_t>::max();
+ static uint32_t constexpr kEmptyEntry = std::numeric_limits<uint32_t>::max();
static uint32_t constexpr kPushedEntry = kEmptyEntry - 1;
// Joints number is large.
@@ -337,7 +337,7 @@ private:
IndexGraph & m_graph;
Joint::Id m_count = 0;
- vector<pair<uint32_t, Point>> m_entries;
+ std::vector<std::pair<uint32_t, Point>> m_entries;
};
class SectionSerializer final
@@ -351,7 +351,7 @@ private:
void AddRoad(uint32_t featureId) { m_featureIds.push_back(featureId); }
void SortRoads() { sort(m_featureIds.begin(), m_featureIds.end()); }
- void PreSerialize(IndexGraph const & graph, unordered_map<uint32_t, VehicleMask> const & masks,
+ void PreSerialize(IndexGraph const & graph, std::unordered_map<uint32_t, VehicleMask> const & masks,
JointIdEncoder & jointEncoder);
template <class Sink>
@@ -363,15 +363,15 @@ private:
private:
VehicleMask const m_mask;
- vector<uint32_t> m_featureIds;
- vector<uint8_t> m_buffer;
+ std::vector<uint32_t> m_featureIds;
+ std::vector<uint8_t> m_buffer;
};
- static VehicleMask GetRoadMask(unordered_map<uint32_t, VehicleMask> const & masks,
+ static VehicleMask GetRoadMask(std::unordered_map<uint32_t, VehicleMask> const & masks,
uint32_t featureId);
static uint32_t ConvertJointsNumber(uint32_t jointsNumber);
static void PrepareSectionSerializers(IndexGraph const & graph,
- unordered_map<uint32_t, VehicleMask> const & masks,
- vector<SectionSerializer> & sections);
+ std::unordered_map<uint32_t, VehicleMask> const & masks,
+ std::vector<SectionSerializer> & sections);
};
} // namespace routing
diff --git a/routing/index_router.hpp b/routing/index_router.hpp
index 7b86e0d4bf..316bd42603 100644
--- a/routing/index_router.hpp
+++ b/routing/index_router.hpp
@@ -25,9 +25,8 @@
#include "geometry/tree4d.hpp"
-#include "std/unique_ptr.hpp"
-
#include <functional>
+#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -69,7 +68,7 @@ public:
IndexRouter(VehicleType vehicleType, bool loadAltitudes,
CountryParentNameGetterFn const & countryParentNameGetterFn,
TCountryFileFn const & countryFileFn, CourntryRectFn const & countryRectFn,
- shared_ptr<NumMwmIds> numMwmIds, unique_ptr<m4::Tree<NumMwmId>> numMwmTree,
+ shared_ptr<NumMwmIds> numMwmIds, std::unique_ptr<m4::Tree<NumMwmId>> numMwmTree,
traffic::TrafficCache const & trafficCache, DataSource & dataSource);
std::unique_ptr<WorldGraph> MakeSingleMwmWorldGraph();
diff --git a/routing/joint_index.hpp b/routing/joint_index.hpp
index 4bcb12e4ac..2a00e135d7 100644
--- a/routing/joint_index.hpp
+++ b/routing/joint_index.hpp
@@ -6,7 +6,7 @@
#include "base/assert.hpp"
-#include "std/vector.hpp"
+#include <vector>
namespace routing
{
@@ -52,7 +52,7 @@ private:
return m_offsets[nextId];
}
- vector<uint32_t> m_offsets;
- vector<RoadPoint> m_points;
+ std::vector<uint32_t> m_offsets;
+ std::vector<RoadPoint> m_points;
};
} // namespace routing
diff --git a/routing/loaded_path_segment.hpp b/routing/loaded_path_segment.hpp
index 6bd501e4cb..6e42842178 100644
--- a/routing/loaded_path_segment.hpp
+++ b/routing/loaded_path_segment.hpp
@@ -12,7 +12,7 @@
#include "base/buffer_vector.hpp"
-#include "std/vector.hpp"
+#include <vector>
namespace routing
{
@@ -23,12 +23,12 @@ namespace routing
*/
struct LoadedPathSegment
{
- vector<Junction> m_path;
- vector<turns::SingleLaneInfo> m_lanes;
+ std::vector<Junction> m_path;
+ std::vector<turns::SingleLaneInfo> m_lanes;
string m_name;
double m_weight = 0.0; /*!< Time in seconds to pass the segment. */
SegmentRange m_segmentRange;
- vector<Segment> m_segments; /*!< Traffic segments for |m_path|. */
+ std::vector<Segment> m_segments; /*!< Traffic segments for |m_path|. */
ftypes::HighwayClass m_highwayClass = ftypes::HighwayClass::Undefined;
bool m_onRoundabout = false;
bool m_isLink = false;
@@ -36,5 +36,5 @@ struct LoadedPathSegment
bool IsValid() const { return m_path.size() > 1; }
};
-using TUnpackedPathSegments = vector<LoadedPathSegment>;
+using TUnpackedPathSegments = std::vector<LoadedPathSegment>;
} // namespace routing
diff --git a/routing/online_absent_fetcher.hpp b/routing/online_absent_fetcher.hpp
index f05c267e98..d2bf05d628 100644
--- a/routing/online_absent_fetcher.hpp
+++ b/routing/online_absent_fetcher.hpp
@@ -7,13 +7,13 @@
#include "base/thread.hpp"
-#include "std/string.hpp"
-#include "std/unique_ptr.hpp"
-#include "std/vector.hpp"
+#include <memory>
+#include <string>
+#include <vector>
namespace routing
{
-using TCountryLocalFileFn = function<bool(string const &)>;
+using TCountryLocalFileFn = std::function<bool(string const &)>;
class IOnlineFetcher
{
@@ -41,6 +41,6 @@ private:
TCountryFileFn const m_countryFileFn;
TCountryLocalFileFn const m_countryLocalFileFn;
- unique_ptr<threads::Thread> m_fetcherThread;
+ std::unique_ptr<threads::Thread> m_fetcherThread;
};
} // namespace routing
diff --git a/routing/online_cross_fetcher.cpp b/routing/online_cross_fetcher.cpp
index 1b9ee52a68..c74864f153 100644
--- a/routing/online_cross_fetcher.cpp
+++ b/routing/online_cross_fetcher.cpp
@@ -10,8 +10,6 @@
#include "geometry/mercator.hpp"
-#include "std/bind.hpp"
-
namespace
{
inline string LatLonToURLArgs(ms::LatLon const & point)
diff --git a/routing/road_index.cpp b/routing/road_index.cpp
index 1232fe7ef3..4bbbf4df81 100644
--- a/routing/road_index.cpp
+++ b/routing/road_index.cpp
@@ -4,7 +4,7 @@
namespace routing
{
-void RoadIndex::Import(vector<Joint> const & joints)
+void RoadIndex::Import(std::vector<Joint> const & joints)
{
for (Joint::Id jointId = 0; jointId < joints.size(); ++jointId)
{
diff --git a/routing/road_index.hpp b/routing/road_index.hpp
index 24e7a6c194..b48b945e9d 100644
--- a/routing/road_index.hpp
+++ b/routing/road_index.hpp
@@ -5,11 +5,11 @@
#include "base/assert.hpp"
#include "base/checked_cast.hpp"
-#include "std/algorithm.hpp"
-#include "std/cstdint.hpp"
-#include "std/unordered_map.hpp"
-#include "std/utility.hpp"
-#include "std/vector.hpp"
+#include <algorithm>
+#include <cstdint>
+#include <unordered_map>
+#include <utility>
+#include <vector>
namespace routing
{
@@ -74,7 +74,7 @@ public:
}
}
- pair<Joint::Id, uint32_t> FindNeighbor(uint32_t pointId, bool forward, uint32_t pointsNumber) const
+ std::pair<Joint::Id, uint32_t> FindNeighbor(uint32_t pointId, bool forward, uint32_t pointsNumber) const
{
CHECK_GREATER_OR_EQUAL(pointsNumber, 2, ("Number of points of road should be greater or equal 2"));
@@ -90,7 +90,7 @@ public:
}
else
{
- for (index = min(pointId, pointsNumber) - 1; index < pointsNumber; --index)
+ for (index = std::min(pointId, pointsNumber) - 1; index < pointsNumber; --index)
{
Joint::Id const jointId = GetJointId(index);
if (jointId != Joint::kInvalidId)
@@ -106,13 +106,13 @@ public:
private:
// Joint ids indexed by point id.
// If some point id doesn't match any joint id, this vector contains Joint::kInvalidId.
- vector<Joint::Id> m_jointIds;
+ std::vector<Joint::Id> m_jointIds;
};
class RoadIndex final
{
public:
- void Import(vector<Joint> const & joints);
+ void Import(std::vector<Joint> const & joints);
void AddJoint(RoadPoint const & rp, Joint::Id jointId)
{
@@ -138,7 +138,7 @@ public:
// If forward == false: neighbor with smaller point id (left neighbor)
//
// If there is no nearest point, return {Joint::kInvalidId, 0}
- pair<Joint::Id, uint32_t> FindNeighbor(RoadPoint const & rp, bool forward) const;
+ std::pair<Joint::Id, uint32_t> FindNeighbor(RoadPoint const & rp, bool forward) const;
uint32_t GetSize() const { return base::asserted_cast<uint32_t>(m_roads.size()); }
@@ -160,6 +160,6 @@ public:
private:
// Map from feature id to RoadJointIds.
- unordered_map<uint32_t, RoadJointIds> m_roads;
+ std::unordered_map<uint32_t, RoadJointIds> m_roads;
};
} // namespace routing
diff --git a/routing/route_point.hpp b/routing/route_point.hpp
index e652b044ef..42c4585373 100644
--- a/routing/route_point.hpp
+++ b/routing/route_point.hpp
@@ -2,7 +2,7 @@
#include "routing/road_point.hpp"
-#include "std/cstdint.hpp"
+#include <cstdint>
namespace routing
{
diff --git a/routing/router_delegate.cpp b/routing/router_delegate.cpp
index 5951a20892..accde1bbd1 100644
--- a/routing/router_delegate.cpp
+++ b/routing/router_delegate.cpp
@@ -26,20 +26,20 @@ void RouterDelegate::SetPointCheckCallback(PointCheckCallback const & pointCallb
void RouterDelegate::OnProgress(float progress) const
{
- lock_guard<mutex> l(m_guard);
+ std::lock_guard<std::mutex> l(m_guard);
if (!IsCancelled())
m_progressCallback(progress);
}
void RouterDelegate::Reset()
{
- lock_guard<mutex> l(m_guard);
+ std::lock_guard<std::mutex> l(m_guard);
TimeoutCancellable::Reset();
}
void RouterDelegate::OnPointCheck(m2::PointD const & point) const
{
- lock_guard<mutex> l(m_guard);
+ std::lock_guard<std::mutex> l(m_guard);
if (!IsCancelled())
m_pointCallback(point);
}
@@ -66,5 +66,4 @@ void TimeoutCancellable::SetTimeout(uint32_t timeoutSec)
m_timeoutSec = timeoutSec;
m_timer.Reset();
}
-
} // namespace routing
diff --git a/routing/router_delegate.hpp b/routing/router_delegate.hpp
index 09a231f170..65cc0c3da3 100644
--- a/routing/router_delegate.hpp
+++ b/routing/router_delegate.hpp
@@ -6,8 +6,7 @@
#include "base/cancellable.hpp"
#include "base/timer.hpp"
-#include "std/function.hpp"
-#include "std/mutex.hpp"
+#include <mutex>
namespace routing
{
@@ -43,7 +42,7 @@ public:
void Reset() override;
private:
- mutable mutex m_guard;
+ mutable std::mutex m_guard;
ProgressCallback m_progressCallback;
PointCheckCallback m_pointCallback;
};
diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp
index 845e5a9a67..44a1bedb6a 100644
--- a/routing/routing_integration_tests/route_test.cpp
+++ b/routing/routing_integration_tests/route_test.cpp
@@ -6,9 +6,10 @@
#include "geometry/mercator.hpp"
-#include "std/limits.hpp"
+#include <limits>
using namespace routing;
+using namespace std;
namespace
{