diff options
252 files changed, 960 insertions, 1753 deletions
diff --git a/3party/jansson/myjansson.hpp b/3party/jansson/myjansson.hpp index f2d57085d9..a86687232a 100644 --- a/3party/jansson/myjansson.hpp +++ b/3party/jansson/myjansson.hpp @@ -7,6 +7,7 @@ #include "3party/jansson/src/jansson.h" +#include "std/string.hpp" #include "std/vector.hpp" namespace my diff --git a/3party/sdf_image/sdf_image.cpp b/3party/sdf_image/sdf_image.cpp index 912a0185ad..f0192b08ed 100644 --- a/3party/sdf_image/sdf_image.cpp +++ b/3party/sdf_image/sdf_image.cpp @@ -22,6 +22,7 @@ THE SOFTWARE. #include "base/math.hpp" #include "base/scope_guard.hpp" +#include "std/algorithm.hpp" #include "std/limits.hpp" #include "std/bind.hpp" diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index e71d7f4a6b..70b0832656 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -2,7 +2,6 @@ project(base) set( SRC - SRC_FIRST.hpp array_adapters.hpp assert.hpp base.cpp @@ -14,10 +13,6 @@ set( collection_cast.hpp condition.cpp condition.hpp -# condition_bada.cpp - condition_posix.cpp -# condition_windows_native.cpp - const_helper.hpp deferred_task.cpp deferred_task.hpp dfa_helpers.hpp @@ -38,8 +33,6 @@ set( mutex.hpp newtype.hpp normalize_unicode.cpp - object_tracker.cpp - object_tracker.hpp observer_list.hpp range_iterator.hpp ref_counted.hpp @@ -63,7 +56,6 @@ set( strings_bundle.hpp sunrise_sunset.cpp sunrise_sunset.hpp - swap.hpp thread.cpp thread.hpp thread_checker.cpp @@ -73,7 +65,6 @@ set( threaded_container.cpp threaded_container.hpp threaded_list.hpp - threaded_priority_queue.hpp internal/message.cpp internal/message.hpp timegm.cpp @@ -82,7 +73,6 @@ set( timer.hpp uni_string_dfa.cpp uni_string_dfa.hpp - worker_thread.hpp ) add_library(${PROJECT_NAME} ${SRC}) diff --git a/base/SRC_FIRST.hpp b/base/SRC_FIRST.hpp deleted file mode 100644 index b948f256c9..0000000000 --- a/base/SRC_FIRST.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "base/base.hpp" diff --git a/base/assert.hpp b/base/assert.hpp index de51536c67..d4f73c44d6 100644 --- a/base/assert.hpp +++ b/base/assert.hpp @@ -3,13 +3,13 @@ #include "base/internal/message.hpp" #include "base/src_point.hpp" -#include "std/string.hpp" +#include <string> namespace my { // Called when ASSERT, CHECK or VERIFY failed. - typedef void (*AssertFailedFn)(SrcPoint const &, string const &); + typedef void (*AssertFailedFn)(SrcPoint const &, std::string const &); extern AssertFailedFn OnAssertFailed; /// @return Pointer to previous message function. diff --git a/base/base.cpp b/base/base.cpp index dc93a19ea2..53d5c522f5 100644 --- a/base/base.cpp +++ b/base/base.cpp @@ -3,19 +3,19 @@ #include "base/exception.hpp" #include "std/target_os.hpp" -#include "std/iostream.hpp" +#include <iostream> #include <cassert> #include <cstdlib> namespace my { - void OnAssertFailedDefault(SrcPoint const & srcPoint, string const & msg) + void OnAssertFailedDefault(SrcPoint const & srcPoint, std::string const & msg) { - std::cerr << "ASSERT FAILED" << endl - << srcPoint.FileName() << ":" << srcPoint.Line() << endl - << msg << endl; + std::cerr << "ASSERT FAILED" << std::endl + << srcPoint.FileName() << ":" << srcPoint.Line() << std::endl + << msg << std::endl; #ifdef DEBUG assert(false); diff --git a/base/base.hpp b/base/base.hpp index 550dd538d6..e8543cb02e 100644 --- a/base/base.hpp +++ b/base/base.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/cstdint.hpp" +#include <cstdint> #if defined(DEBUG) || defined(_DEBUG) || defined(NRELEASE) #define MY_DEBUG_DEFINED 1 diff --git a/base/base.pro b/base/base.pro index 31f3f5bd88..aa42754cc5 100644 --- a/base/base.pro +++ b/base/base.pro @@ -18,7 +18,6 @@ SOURCES += \ logging.cpp \ lower_case.cpp \ normalize_unicode.cpp \ - object_tracker.cpp \ shared_buffer_manager.cpp \ src_point.cpp \ string_format.cpp \ @@ -29,7 +28,6 @@ SOURCES += \ thread_checker.cpp \ thread_pool.cpp \ threaded_container.cpp \ - time_samples.cpp \ timegm.cpp \ timer.cpp \ uni_string_dfa.cpp \ @@ -45,7 +43,6 @@ HEADERS += \ cancellable.hpp \ collection_cast.hpp \ condition.hpp \ - const_helper.hpp \ deferred_task.hpp \ dfa_helpers.hpp \ exception.hpp \ @@ -60,7 +57,6 @@ HEADERS += \ mem_trie.hpp \ mutex.hpp \ newtype.hpp \ - object_tracker.hpp \ observer_list.hpp \ range_iterator.hpp \ ref_counted.hpp \ @@ -79,15 +75,12 @@ HEADERS += \ string_utils.hpp \ strings_bundle.hpp \ sunrise_sunset.hpp \ - swap.hpp \ thread.hpp \ thread_checker.hpp \ thread_pool.hpp \ threaded_container.hpp \ threaded_list.hpp \ threaded_priority_queue.hpp \ - time_samples.hpp \ timegm.hpp \ timer.hpp \ uni_string_dfa.hpp \ - worker_thread.hpp \ diff --git a/base/base_tests/CMakeLists.txt b/base/base_tests/CMakeLists.txt index 0fa0ec6b3e..7d3106daaa 100644 --- a/base/base_tests/CMakeLists.txt +++ b/base/base_tests/CMakeLists.txt @@ -10,7 +10,6 @@ set( cache_test.cpp collection_cast_test.cpp condition_test.cpp - const_helper.cpp containers_test.cpp levenshtein_dfa_test.cpp logging_test.cpp @@ -35,7 +34,6 @@ set( timegm_test.cpp timer_test.cpp uni_string_dfa_test.cpp - worker_thread_test.cpp ) omim_add_test(${PROJECT_NAME} ${SRC}) diff --git a/base/base_tests/assert_test.cpp b/base/base_tests/assert_test.cpp index 7056d244d7..0df32cc5df 100644 --- a/base/base_tests/assert_test.cpp +++ b/base/base_tests/assert_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/base.hpp" diff --git a/base/base_tests/base_tests.pro b/base/base_tests/base_tests.pro index c8708b84d4..32049b5282 100644 --- a/base/base_tests/base_tests.pro +++ b/base/base_tests/base_tests.pro @@ -20,7 +20,6 @@ SOURCES += \ cache_test.cpp \ collection_cast_test.cpp \ condition_test.cpp \ - const_helper.cpp \ containers_test.cpp \ levenshtein_dfa_test.cpp \ logging_test.cpp \ @@ -45,6 +44,5 @@ SOURCES += \ timegm_test.cpp \ timer_test.cpp \ uni_string_dfa_test.cpp \ - worker_thread_test.cpp \ HEADERS += diff --git a/base/base_tests/bits_test.cpp b/base/base_tests/bits_test.cpp index bded2a18ec..c7184b6055 100644 --- a/base/base_tests/bits_test.cpp +++ b/base/base_tests/bits_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/bits.hpp" @@ -29,7 +28,7 @@ UNIT_TEST(PopcountArray32) { for (uint32_t j = 0; j < 2777; ++j) { - vector<uint32_t> v(j / 10); + std::vector<uint32_t> v(j / 10); for (size_t i = 0; i < v.size(); ++i) v[i] = ((uint32_t(rand()) & 255) << 24) + ((rand() & 255) << 16) + ((rand() & 255) << 8) + (rand() & 255); diff --git a/base/base_tests/buffer_vector_test.cpp b/base/base_tests/buffer_vector_test.cpp index 96a0a62a25..f9fd8f8130 100644 --- a/base/base_tests/buffer_vector_test.cpp +++ b/base/base_tests/buffer_vector_test.cpp @@ -144,21 +144,21 @@ UNIT_TEST(BufferVectorInsert) for (size_t insertPos = 0; insertPos <= initialLength; ++insertPos) { buffer_vector<char, 5> b; - vector<char> v; + std::vector<char> v; for (size_t i = 0; i < initialLength; ++i) { b.push_back('A' + i); v.push_back('A' + i); } - vector<int> dataToInsert(insertLength); + std::vector<int> dataToInsert(insertLength); for (size_t i = 0; i < insertLength; ++i) dataToInsert[i] = 'a' + i; b.insert(b.begin() + insertPos, dataToInsert.begin(), dataToInsert.end()); v.insert(v.begin() + insertPos, dataToInsert.begin(), dataToInsert.end()); - vector<char> result(b.begin(), b.end()); + std::vector<char> result(b.begin(), b.end()); TEST_EQUAL(v, result, (initialLength, insertLength, insertPos)); } } @@ -202,21 +202,21 @@ UNIT_TEST(BufferVectorAppend) for (size_t insertLength = 0; insertLength < 20; ++insertLength) { buffer_vector<char, 5> b; - vector<char> v; + std::vector<char> v; for (size_t i = 0; i < initialLength; ++i) { b.push_back('A' + i); v.push_back('A' + i); } - vector<int> dataToInsert(insertLength); + std::vector<int> dataToInsert(insertLength); for (size_t i = 0; i < insertLength; ++i) dataToInsert[i] = 'a' + i; b.append(dataToInsert.begin(), dataToInsert.end()); v.insert(v.end(), dataToInsert.begin(), dataToInsert.end()); - vector<char> result(b.begin(), b.end()); + std::vector<char> result(b.begin(), b.end()); TEST_EQUAL(v, result, (initialLength, insertLength)); } } @@ -325,11 +325,11 @@ UNIT_TEST(BufferVectorMove) v1.emplace_back("2"); TestVector(v1, 3); - VectorT v2(move(v1)); + VectorT v2(std::move(v1)); TestVector(v2, 3); VectorT().swap(v1); - v1 = move(v2); + v1 = std::move(v2); TestVector(v1, 3); } diff --git a/base/base_tests/cache_test.cpp b/base/base_tests/cache_test.cpp index 0073c65e59..e9d8f2e65e 100644 --- a/base/base_tests/cache_test.cpp +++ b/base/base_tests/cache_test.cpp @@ -18,7 +18,7 @@ public: m_v.push_back(c); } - vector<char> m_v; + std::vector<char> m_v; private: DISALLOW_COPY(SimpleFunctor); @@ -28,7 +28,7 @@ private: class SimpleMovableFunctor { public: - SimpleMovableFunctor(vector<char> * v) : m_v(v) {} + SimpleMovableFunctor(std::vector<char> * v) : m_v(v) {} // movable SimpleMovableFunctor(SimpleMovableFunctor && other) @@ -43,7 +43,7 @@ public: } private: - vector<char> * m_v; + std::vector<char> * m_v; DISALLOW_COPY(SimpleMovableFunctor); }; @@ -85,9 +85,9 @@ UNIT_TEST(CacheSmoke_0) bool found = true; cache.Find(0, found); TEST(!found, ()); - vector<char> v; + std::vector<char> v; cache.ForEachValue(MakeBackInsertFunctor(v)); - TEST_EQUAL(v, vector<char>(8, 0), ()); + TEST_EQUAL(v, std::vector<char>(8, 0), ()); } UNIT_TEST(CacheSmoke_1) @@ -95,7 +95,7 @@ UNIT_TEST(CacheSmoke_1) my::Cache<uint32_t, char> cache(3); // it contains 2^3=8 elements SimpleFunctor f; cache.ForEachValue(f); // f passed by reference - TEST_EQUAL(f.m_v, vector<char>(8, 0), ()); + TEST_EQUAL(f.m_v, std::vector<char>(8, 0), ()); } UNIT_TEST(CacheSmoke_2) @@ -103,7 +103,7 @@ UNIT_TEST(CacheSmoke_2) my::Cache<uint32_t, char> cache(3); // it contains 2^3=8 elements SimpleFunctor f; cache.ForEachValue(ref(f)); // f passed by reference - TEST_EQUAL(f.m_v, vector<char>(8, 0), ()); + TEST_EQUAL(f.m_v, std::vector<char>(8, 0), ()); } UNIT_TEST(CacheSmoke_3) @@ -142,7 +142,7 @@ UNIT_TEST(CacheSmoke_4) my::CacheWithStat<uint32_t, char> cache(3); // it contains 2^3=8 elements SimpleFunctor f; cache.ForEachValue(f); // f passed by reference - TEST_EQUAL(f.m_v, vector<char>(8, 0), ()); + TEST_EQUAL(f.m_v, std::vector<char>(8, 0), ()); } UNIT_TEST(CacheSmoke_5) @@ -150,15 +150,15 @@ UNIT_TEST(CacheSmoke_5) my::CacheWithStat<uint32_t, char> cache(3); // it contains 2^3=8 elements SimpleFunctor f; cache.ForEachValue(ref(f)); // f passed by reference - TEST_EQUAL(f.m_v, vector<char>(8, 0), ()); + TEST_EQUAL(f.m_v, std::vector<char>(8, 0), ()); } UNIT_TEST(CacheSmoke_6) { my::CacheWithStat<uint32_t, char> cache(3); // it contains 2^3=8 elements - vector<char> v; + std::vector<char> v; cache.ForEachValue(SimpleMovableFunctor(&v)); - TEST_EQUAL(v, vector<char>(8, 0), ()); + TEST_EQUAL(v, std::vector<char>(8, 0), ()); } UNIT_TEST(Cache_Init) diff --git a/base/base_tests/condition_test.cpp b/base/base_tests/condition_test.cpp index 45c8e6216c..b1e1b65739 100644 --- a/base/base_tests/condition_test.cpp +++ b/base/base_tests/condition_test.cpp @@ -1,11 +1,10 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/thread.hpp" #include "base/threaded_list.hpp" #include "base/condition.hpp" - #include "base/logging.hpp" +#include "base/stl_add.hpp" struct ConditionThread : public threads::IRoutine { @@ -25,10 +24,10 @@ UNIT_TEST(Condition_Test) ThreadedList<int> l; threads::Thread t0; - t0.Create(make_unique<ConditionThread>(&l)); + t0.Create(my::make_unique<ConditionThread>(&l)); threads::Thread t1; - t1.Create(make_unique<ConditionThread>(&l)); + t1.Create(my::make_unique<ConditionThread>(&l)); l.Cancel(); t0.Join(); diff --git a/base/base_tests/const_helper.cpp b/base/base_tests/const_helper.cpp deleted file mode 100644 index b46ce9dc93..0000000000 --- a/base/base_tests/const_helper.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "base/SRC_FIRST.hpp" -#include "testing/testing.hpp" - -#include "base/const_helper.hpp" -#include "std/typeinfo.hpp" - -UNIT_TEST(ConstHelper) -{ - TEST_EQUAL(typeid(my::PropagateConst<int, char>::type *).name(), typeid(char *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int, void>::type *).name(), typeid(void *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int const, char>::type *).name(), - typeid(char const *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int const, void>::type *).name(), - typeid(void const *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int, char const>::type *).name(), - typeid(char const *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int, void const>::type *).name(), - typeid(void const *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int const, char const>::type *).name(), - typeid(char const *).name(), ()); - TEST_EQUAL(typeid(my::PropagateConst<int const, void const>::type *).name(), - typeid(void const *).name(), ()); -} diff --git a/base/base_tests/containers_test.cpp b/base/base_tests/containers_test.cpp index 1ed3e807ab..577cdfd24b 100644 --- a/base/base_tests/containers_test.cpp +++ b/base/base_tests/containers_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/limited_priority_queue.hpp" diff --git a/base/base_tests/logging_test.cpp b/base/base_tests/logging_test.cpp index b3776da773..cb6439ef18 100644 --- a/base/base_tests/logging_test.cpp +++ b/base/base_tests/logging_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/logging.hpp" diff --git a/base/base_tests/ref_counted_tests.cpp b/base/base_tests/ref_counted_tests.cpp index f1863eb499..f7f690fa80 100644 --- a/base/base_tests/ref_counted_tests.cpp +++ b/base/base_tests/ref_counted_tests.cpp @@ -58,7 +58,7 @@ UNIT_TEST(RefCounted_Smoke) TEST_EQUAL(2, a->NumRefs(), ()); TEST(!destroyed, ()); - RefCountPtr<Resource> d(move(b)); + RefCountPtr<Resource> d(std::move(b)); TEST(b.Get() == nullptr, ()); TEST(a.Get() == d.Get(), ()); TEST_EQUAL(2, a->NumRefs(), ()); diff --git a/base/base_tests/regexp_test.cpp b/base/base_tests/regexp_test.cpp index bd13b9d1f4..a1f7474505 100644 --- a/base/base_tests/regexp_test.cpp +++ b/base/base_tests/regexp_test.cpp @@ -28,7 +28,7 @@ UNIT_TEST(RegExp_ForEachMatched) { string const s = "6.66, 9.99"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 1, ()); TEST_EQUAL(v[0], s, ()); @@ -37,7 +37,7 @@ UNIT_TEST(RegExp_ForEachMatched) { string const s1 = "6.66, 9.99"; string const s2 = "-5.55, -7.77"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s1 + " 180 , bfuewib 365@" + s2, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 2, ()); TEST_EQUAL(v[0], s1, ()); @@ -46,7 +46,7 @@ UNIT_TEST(RegExp_ForEachMatched) { string const s = "X6.66, 9.99"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 1, ()); TEST_EQUAL(v[0], string(s.begin() + 1, s.end()), ()); @@ -54,7 +54,7 @@ UNIT_TEST(RegExp_ForEachMatched) { string const s = "6.66, 9.99X"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 1, ()); TEST_EQUAL(v[0], string(s.begin(), s.end() - 1), ()); @@ -62,14 +62,14 @@ UNIT_TEST(RegExp_ForEachMatched) { string const s = "6.66X, 9.99"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 0, ()); } { string const s = "6.66, X9.99"; - vector<string> v; + std::vector<string> v; strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v)); TEST_EQUAL(v.size(), 0, ()); } diff --git a/base/base_tests/rolling_hash_test.cpp b/base/base_tests/rolling_hash_test.cpp index b96e41452a..21eb1caa1d 100644 --- a/base/base_tests/rolling_hash_test.cpp +++ b/base/base_tests/rolling_hash_test.cpp @@ -41,7 +41,7 @@ template <class RollingHasherT> void TestRollingHasher() { typedef typename RollingHasherT::hash_type hash_type; RollingHasherT hash; - vector<hash_type> hashes; + std::vector<hash_type> hashes; hashes.push_back(hash.Init(static_cast<char const *>(s), size)); for (uint32_t i = size; i < len; ++i) hashes.push_back(hash.Scroll(s[i - size], s[i])); diff --git a/base/base_tests/scope_guard_test.cpp b/base/base_tests/scope_guard_test.cpp index b66a474948..a3b9b8840d 100644 --- a/base/base_tests/scope_guard_test.cpp +++ b/base/base_tests/scope_guard_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/scope_guard.hpp" diff --git a/base/base_tests/stl_add_test.cpp b/base/base_tests/stl_add_test.cpp index ae3e8e9181..d425003cea 100644 --- a/base/base_tests/stl_add_test.cpp +++ b/base/base_tests/stl_add_test.cpp @@ -36,7 +36,7 @@ namespace UNIT_TEST(STLAdd_RemoveIfKeepValid) { { - vector<int> v; + std::vector<int> v; TEST(RemoveIfKeepValid(v.begin(), v.end(), EqualZero()) == v.end(), ()); v.push_back(1); @@ -47,7 +47,7 @@ UNIT_TEST(STLAdd_RemoveIfKeepValid) } { - vector<int> v; + std::vector<int> v; v.push_back(0); TEST(RemoveIfKeepValid(v.begin(), v.end(), EqualZero()) == v.begin(), ()); @@ -90,11 +90,11 @@ namespace { template <class T, size_t N1, size_t N2, size_t N3> void CheckAccumulateIntervals(size_t & idTest, - pair<T, T> (&arr1)[N1], - pair<T, T> (&arr2)[N2], - pair<T, T> (&arr3)[N3]) + std::pair<T, T> (&arr1)[N1], + std::pair<T, T> (&arr2)[N2], + std::pair<T, T> (&arr3)[N3]) { - vector<pair<T, T> > res; + std::vector<std::pair<T, T> > res; AccumulateIntervals1With2(arr1, arr1 + N1, arr2, arr2 + N2, back_inserter(res)); ++idTest; @@ -105,12 +105,12 @@ namespace UNIT_TEST(STLAdd_AccumulateIntervals) { - typedef pair<int, int> T; + typedef std::pair<int, int> T; size_t idTest = 0; // bound cases { - vector<T> res; + std::vector<T> res; T arr[] = { T(10, 20) }; res.clear(); diff --git a/base/base_tests/string_utils_test.cpp b/base/base_tests/string_utils_test.cpp index 6d09bd530d..8f01391353 100644 --- a/base/base_tests/string_utils_test.cpp +++ b/base/base_tests/string_utils_test.cpp @@ -44,7 +44,7 @@ UNIT_TEST(LowerUniChar) if (!semicolon) continue; string const capital = *semicolon; - istringstream stream(capital); + std::istringstream stream(capital); strings::UniChar uc; stream >> hex >> uc; ++semicolon; @@ -296,7 +296,7 @@ UNIT_TEST(to_string) TEST_EQUAL(strings::to_string(123456789123456789ULL), "123456789123456789", ()); TEST_EQUAL(strings::to_string(-987654321987654321LL), "-987654321987654321", ()); - uint64_t const n = numeric_limits<uint64_t>::max(); + uint64_t const n = std::numeric_limits<uint64_t>::max(); TEST_EQUAL(strings::to_string(n), "18446744073709551615", ()); } @@ -454,9 +454,9 @@ UNIT_TEST(SimpleTokenizer) UNIT_TEST(Tokenize) { { - initializer_list<string> expected{"acb", "def", "ghi"}; - TEST_EQUAL(strings::Tokenize<vector>("acb def ghi", " " /* delims */), vector<string>(expected), ()); - TEST_EQUAL(strings::Tokenize<set>("acb def ghi", " " /* delims */), set<string>(expected), ()); + std::initializer_list<string> expected{"acb", "def", "ghi"}; + TEST_EQUAL(strings::Tokenize<std::vector>("acb def ghi", " " /* delims */), std::vector<std::string>(expected), ()); + TEST_EQUAL(strings::Tokenize<std::set>("acb def ghi", " " /* delims */), std::set<std::string>(expected), ()); } } diff --git a/base/base_tests/threaded_list_test.cpp b/base/base_tests/threaded_list_test.cpp index 5deeba40ef..806e155823 100644 --- a/base/base_tests/threaded_list_test.cpp +++ b/base/base_tests/threaded_list_test.cpp @@ -1,11 +1,9 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "base/threaded_list.hpp" -#include "base/threaded_priority_queue.hpp" #include "base/thread.hpp" - #include "base/logging.hpp" +#include "base/stl_add.hpp" #include "std/mutex.hpp" @@ -13,10 +11,10 @@ struct ThreadedListProcessor : public threads::IRoutine { ThreadedList<int> & m_p; mutex & m_resMutex; - list<int> & m_res; + std::list<int> & m_res; int m_id; - ThreadedListProcessor(ThreadedList<int> & p, mutex & resMutex, list<int> & res, int id) + ThreadedListProcessor(ThreadedList<int> & p, mutex & resMutex, std::list<int> & res, int id) : m_p(p), m_resMutex(resMutex), m_res(res), m_id(id) { } @@ -37,52 +35,23 @@ struct ThreadedListProcessor : public threads::IRoutine } }; -struct ThreadedPriorityQueueProcessor : public threads::IRoutine -{ - ThreadedPriorityQueue<int> & m_p; - mutex & m_resMutex; - list<int> & m_res; - int m_id; - - ThreadedPriorityQueueProcessor(ThreadedPriorityQueue<int> & p, mutex & resMutex, list<int> & res, - int id) - : m_p(p), m_resMutex(resMutex), m_res(res), m_id(id) - { - } - - virtual void Do() - { - while (!m_p.IsCancelled()) - { - int res = m_p.Top(true /* doPop */); - { - lock_guard<mutex> resGuard(m_resMutex); - m_res.push_back(res); - } - LOG(LINFO, (m_id, " thread got ", res)); - threads::Sleep(10); - } - LOG(LINFO, (m_id, " thread is cancelled")); - } -}; - UNIT_TEST(ThreadedList) { - list<int> l; + std::list<int> l; mutex resMutex; - list<int> res; + std::list<int> res; ThreadedList<int> p; threads::Thread t0; - t0.Create(make_unique<ThreadedListProcessor>(p, resMutex, res, 0)); + t0.Create(my::make_unique<ThreadedListProcessor>(p, resMutex, res, 0)); threads::Thread t1; - t1.Create(make_unique<ThreadedListProcessor>(p, resMutex, res, 1)); + t1.Create(my::make_unique<ThreadedListProcessor>(p, resMutex, res, 1)); threads::Thread t2; - t2.Create(make_unique<ThreadedListProcessor>(p, resMutex, res, 2)); + t2.Create(my::make_unique<ThreadedListProcessor>(p, resMutex, res, 2)); p.PushBack(0); threads::Sleep(200); @@ -106,43 +75,3 @@ UNIT_TEST(ThreadedList) TEST_EQUAL(res.front(), 2, ()); res.pop_front(); } - -UNIT_TEST(ThreadedPriorityQueue) -{ - mutex resMutex; - list<int> res; - - ThreadedPriorityQueue<int> p; - - threads::Thread t0; - t0.Create(make_unique<ThreadedPriorityQueueProcessor>(p, resMutex, res, 0)); - - threads::Thread t1; - t1.Create(make_unique<ThreadedPriorityQueueProcessor>(p, resMutex, res, 1)); - - threads::Thread t2; - t2.Create(make_unique<ThreadedPriorityQueueProcessor>(p, resMutex, res, 2)); - - p.Push(0); - threads::Sleep(200); - - p.Push(1); - threads::Sleep(200); - - p.Push(2); - threads::Sleep(200); - - p.Cancel(); - - t0.Join(); - t1.Join(); - t2.Join(); - - TEST_EQUAL(res.front(), 0, ()); - res.pop_front(); - TEST_EQUAL(res.front(), 1, ()); - res.pop_front(); - TEST_EQUAL(res.front(), 2, ()); - res.pop_front(); -} - diff --git a/base/base_tests/threads_test.cpp b/base/base_tests/threads_test.cpp index 5f2af4bf29..e482cd55bb 100644 --- a/base/base_tests/threads_test.cpp +++ b/base/base_tests/threads_test.cpp @@ -1,8 +1,9 @@ #include "testing/testing.hpp" #include "base/thread.hpp" +#include "base/stl_add.hpp" -#include "std/vector.hpp" +#include <vector> typedef std::vector<int> Vector; @@ -44,13 +45,13 @@ UNIT_TEST(Simple_Threads) Vector vec; threads::Thread reader; - bool ok = reader.Create(make_unique<GeneratorThread>(vec)); + bool ok = reader.Create(my::make_unique<GeneratorThread>(vec)); TEST( ok, ("Create Generator thread") ); reader.Join(); threads::Thread writer; - ok = writer.Create(make_unique<ReaderThread>(vec)); + ok = writer.Create(my::make_unique<ReaderThread>(vec)); TEST( ok, ("Create Reader thread") ); writer.Join(); diff --git a/base/base_tests/worker_thread_test.cpp b/base/base_tests/worker_thread_test.cpp deleted file mode 100644 index a5f3ac456c..0000000000 --- a/base/base_tests/worker_thread_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "testing/testing.hpp" - -#include "base/worker_thread.hpp" - -#include "std/shared_ptr.hpp" -#include "std/vector.hpp" - -struct Task -{ - Task(vector<size_t> & buffer, size_t index) : m_buffer(buffer), m_index(index) {} - - void operator()() const { m_buffer.push_back(m_index); } - - vector<size_t> & m_buffer; - size_t m_index; -}; - -UNIT_TEST(WorkerThread_Basic) -{ - size_t const kNumTasks = 10; - size_t const kMaxTasksInQueue = 5; - - my::WorkerThread<Task> thread(kMaxTasksInQueue); - - vector<size_t> buffer; - for (size_t i = 0; i < kNumTasks; ++i) - thread.Push(make_shared<Task>(buffer, i)); - thread.RunUntilIdleAndStop(); - - TEST_EQUAL(kNumTasks, buffer.size(), ()); - for (size_t i = 0; i < buffer.size(); ++i) - TEST_EQUAL(i, buffer[i], ()); -} - -UNIT_TEST(WorkerThread_NoStopCall) -{ - size_t const kNumTasks = 10; - size_t const kMaxTasksInQueue = 5; - vector<size_t> buffer; - - { - my::WorkerThread<Task> thread(kMaxTasksInQueue); - for (size_t i = 0; i < kNumTasks; ++i) - thread.Push(make_shared<Task>(buffer, i)); - } - - TEST_EQUAL(kNumTasks, buffer.size(), ()); - for (size_t i = 0; i < buffer.size(); ++i) - TEST_EQUAL(i, buffer[i], ()); -} diff --git a/base/bits.hpp b/base/bits.hpp index 94c5d501db..f767c85d55 100644 --- a/base/bits.hpp +++ b/base/bits.hpp @@ -1,9 +1,9 @@ #pragma once #include "base/assert.hpp" -#include "std/cstdint.hpp" -#include "std/limits.hpp" -#include "std/type_traits.hpp" +#include <cstdint> +#include <limits> +#include <type_traits> namespace bits { @@ -112,16 +112,16 @@ namespace bits return (x << 1) | (x >> (sizeof(T) * 8 - 1)); } - template <typename T> inline typename make_unsigned<T>::type ZigZagEncode(T x) + template <typename T> inline typename std::make_unsigned<T>::type ZigZagEncode(T x) { - static_assert(is_signed<T>::value, "Type should be signed"); + static_assert(std::is_signed<T>::value, "Type should be signed"); return (x << 1) ^ (x >> (sizeof(x) * 8 - 1)); } - template <typename T> inline typename make_signed<T>::type ZigZagDecode(T x) + template <typename T> inline typename std::make_signed<T>::type ZigZagDecode(T x) { - static_assert(is_unsigned<T>::value, "Type should be unsigned."); - return (x >> 1) ^ -static_cast<typename make_signed<T>::type>(x & 1); + static_assert(std::is_unsigned<T>::value, "Type should be unsigned."); + return (x >> 1) ^ -static_cast<typename std::make_signed<T>::type>(x & 1); } inline uint32_t PerfectShuffle(uint32_t x) @@ -205,7 +205,7 @@ namespace bits inline uint64_t GetFullMask(uint8_t numBits) { ASSERT_LESS_OR_EQUAL(numBits, 64, ()); - return numBits == 64 ? numeric_limits<uint64_t>::max() + return numBits == 64 ? std::numeric_limits<uint64_t>::max() : (static_cast<uint64_t>(1) << numBits) - 1; } } // namespace bits diff --git a/base/buffer_vector.hpp b/base/buffer_vector.hpp index 646d41ef3e..f807cf18c7 100644 --- a/base/buffer_vector.hpp +++ b/base/buffer_vector.hpp @@ -1,13 +1,12 @@ #pragma once #include "base/assert.hpp" #include "base/stl_iterator.hpp" -#include "base/swap.hpp" -#include "std/algorithm.hpp" -#include "std/cstring.hpp" // for memcpy -#include "std/type_traits.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <cstring> // for memcpy +#include <type_traits> +#include <utility> +#include <vector> template <class T, size_t N> class buffer_vector @@ -16,34 +15,34 @@ private: enum { USE_DYNAMIC = N + 1 }; T m_static[N]; size_t m_size; - vector<T> m_dynamic; + std::vector<T> m_dynamic; inline bool IsDynamic() const { return m_size == USE_DYNAMIC; } /// @todo clang on linux doesn't have is_trivially_copyable. #ifndef OMIM_OS_LINUX template <class U = T> - typename enable_if<is_trivially_copyable<U>::value, void>::type + typename std::enable_if<std::is_trivially_copyable<U>::value, void>::type MoveStatic(buffer_vector<T, N> & rhs) { memcpy(m_static, rhs.m_static, rhs.m_size*sizeof(T)); } template <class U = T> - typename enable_if<!is_trivially_copyable<U>::value, void>::type + typename std::enable_if<!std::is_trivially_copyable<U>::value, void>::type MoveStatic(buffer_vector<T, N> & rhs) { for (size_t i = 0; i < rhs.m_size; ++i) - Swap(m_static[i], rhs.m_static[i]); + std::swap(m_static[i], rhs.m_static[i]); } #else template <class U = T> - typename enable_if<is_pod<U>::value, void>::type + typename std::enable_if<std::is_pod<U>::value, void>::type MoveStatic(buffer_vector<T, N> & rhs) { memcpy(m_static, rhs.m_static, rhs.m_size*sizeof(T)); } template <class U = T> - typename enable_if<!is_pod<U>::value, void>::type + typename std::enable_if<!std::is_pod<U>::value, void>::type MoveStatic(buffer_vector<T, N> & rhs) { for (size_t i = 0; i < rhs.m_size; ++i) @@ -65,7 +64,7 @@ public: resize(n, c); } - explicit buffer_vector(initializer_list<T> const & initList) : m_size(0) + explicit buffer_vector(std::initializer_list<T> const & initList) : m_size(0) { assign(initList.begin(), initList.end()); } @@ -280,9 +279,9 @@ public: void swap(buffer_vector & rhs) { m_dynamic.swap(rhs.m_dynamic); - Swap(m_size, rhs.m_size); + std::swap(m_size, rhs.m_size); for (size_t i = 0; i < N; ++i) - Swap(m_static[i], rhs.m_static[i]); + std::swap(m_static[i], rhs.m_static[i]); } void push_back(T const & t) @@ -310,19 +309,19 @@ public: { if (IsDynamic()) { - m_dynamic.push_back(move(t)); + m_dynamic.push_back(std::move(t)); return; } if (m_size < N) { - Swap(m_static[m_size++], t); + std::swap(m_static[m_size++], t); } else { ASSERT_EQUAL(m_size, N, ()); SwitchToDynamic(); - m_dynamic.push_back(move(t)); + m_dynamic.push_back(std::move(t)); ASSERT_EQUAL(m_dynamic.size(), N + 1, ()); } } @@ -344,20 +343,20 @@ public: { if (IsDynamic()) { - m_dynamic.emplace_back(forward<Args>(args)...); + m_dynamic.emplace_back(std::forward<Args>(args)...); return; } if (m_size < N) { - value_type v(forward<Args>(args)...); - Swap(v, m_static[m_size++]); + value_type v(std::forward<Args>(args)...); + std::swap(v, m_static[m_size++]); } else { ASSERT_EQUAL(m_size, N, ()); SwitchToDynamic(); - m_dynamic.emplace_back(forward<Args>(args)...); + m_dynamic.emplace_back(std::forward<Args>(args)...); ASSERT_EQUAL(m_dynamic.size(), N + 1, ()); } } @@ -379,7 +378,7 @@ public: { if (pos != m_size) for (ptrdiff_t i = m_size - 1; i >= pos; --i) - Swap(m_static[i], m_static[i + n]); + std::swap(m_static[i], m_static[i + n]); m_size += n; T * writableWhere = &m_static[0] + pos; @@ -405,9 +404,9 @@ public: { iterator b = begin(); iterator e = end(); - iterator i = remove_if(b, e, fn); + iterator i = std::remove_if(b, e, fn); if (i != e) - resize(distance(b, i)); + resize(std::distance(b, i)); } private: @@ -419,7 +418,7 @@ private: for (size_t i = 0; i < m_size; ++i) { m_dynamic.emplace_back(); - Swap(m_static[i], m_dynamic.back()); + std::swap(m_static[i], m_dynamic.back()); } m_size = USE_DYNAMIC; } @@ -432,7 +431,7 @@ void swap(buffer_vector<T, N> & r1, buffer_vector<T, N> & r2) } template <typename T, size_t N> -inline string DebugPrint(buffer_vector<T, N> const & v) +inline std::string DebugPrint(buffer_vector<T, N> const & v) { return ::my::impl::DebugPrintSequence(v.data(), v.data() + v.size()); } @@ -452,5 +451,5 @@ inline bool operator!=(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> con template <typename T, size_t N1, size_t N2> inline bool operator<(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> const & v2) { - return lexicographical_compare(v1.begin(), v1.end(), v2.begin(), v2.end()); + return std::lexicographical_compare(v1.begin(), v1.end(), v2.begin(), v2.end()); } diff --git a/base/cache.hpp b/base/cache.hpp index eb695c9af7..9efa576f56 100644 --- a/base/cache.hpp +++ b/base/cache.hpp @@ -4,9 +4,9 @@ #include "base/base.hpp" #include "base/macros.hpp" -#include "std/type_traits.hpp" -#include "std/unique_ptr.hpp" -#include "std/utility.hpp" +#include <type_traits> +#include <memory> +#include <utility> namespace my @@ -29,7 +29,7 @@ namespace my void Init(uint32_t logCacheSize) { ASSERT(logCacheSize > 0 && logCacheSize < 32, (logCacheSize)); - static_assert((is_same<KeyT, uint32_t>::value || is_same<KeyT, uint64_t>::value), ""); + static_assert((std::is_same<KeyT, uint32_t>::value || std::is_same<KeyT, uint64_t>::value), ""); m_cache.reset(new Data[1 << logCacheSize]); m_hashMask = (1 << logCacheSize) - 1; @@ -106,7 +106,7 @@ namespace my ValueT m_Value; }; - unique_ptr<Data[]> m_cache; + std::unique_ptr<Data[]> m_cache; uint32_t m_hashMask; }; diff --git a/base/cancellable.hpp b/base/cancellable.hpp index 819272f3cb..4eb5787769 100644 --- a/base/cancellable.hpp +++ b/base/cancellable.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/atomic.hpp" +#include <atomic> namespace my { @@ -23,6 +23,6 @@ public: virtual bool IsCancelled() const { return m_cancelled; } private: - atomic<bool> m_cancelled; + std::atomic<bool> m_cancelled; }; } // namespace my diff --git a/base/condition.cpp b/base/condition.cpp index be9ecc000c..fd66f3b872 100644 --- a/base/condition.cpp +++ b/base/condition.cpp @@ -1,12 +1,90 @@ -#include "condition.hpp" +#include "base/condition.hpp" #include "std/target_os.hpp" -#if defined(OMIM_OS_WINDOWS_NATIVE) - #include "condition_windows_native.cpp" -#else - #include "condition_posix.cpp" -#endif +#include "base/mutex.hpp" +#include "std/systime.hpp" + +#include <pthread.h> + +#include <cstdint> +#include <cerrno> + + +namespace threads +{ + namespace impl + { + class ConditionImpl + { + public: + Mutex m_Mutex; + pthread_cond_t m_Condition; + }; + } + + Condition::Condition() : m_pImpl(new impl::ConditionImpl()) + { + ::pthread_cond_init(&m_pImpl->m_Condition, 0); + } + + Condition::~Condition() + { + ::pthread_cond_destroy(&m_pImpl->m_Condition); + delete m_pImpl; + } + + void Condition::Signal(bool broadcast) + { + if (broadcast) + ::pthread_cond_broadcast(&m_pImpl->m_Condition); + else + ::pthread_cond_signal(&m_pImpl->m_Condition); + } + + void Condition::Wait() + { + ::pthread_cond_wait(&m_pImpl->m_Condition, &m_pImpl->m_Mutex.m_Mutex); + } + + bool Condition::Wait(unsigned ms) + { + if (ms == -1) + { + Wait(); + return false; + } + + ::timeval curtv; + ::gettimeofday(&curtv, 0); + + ::timespec ts; + + uint64_t deltaNanoSec = curtv.tv_usec * 1000 + ms * 1000000; + + ts.tv_sec = curtv.tv_sec + deltaNanoSec / 1000000000; + ts.tv_nsec = deltaNanoSec % 1000000000; + + int res = ::pthread_cond_timedwait(&m_pImpl->m_Condition, &m_pImpl->m_Mutex.m_Mutex, &ts); + + return (res == ETIMEDOUT); + } + + void Condition::Lock() + { + m_pImpl->m_Mutex.Lock(); + } + + bool Condition::TryLock() + { + return m_pImpl->m_Mutex.TryLock(); + } + + void Condition::Unlock() + { + m_pImpl->m_Mutex.Unlock(); + } +} namespace threads { diff --git a/base/condition_bada.cpp b/base/condition_bada.cpp deleted file mode 100644 index 22ed384169..0000000000 --- a/base/condition_bada.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "std/target_os.hpp" - -#ifdef OMIM_OS_BADA - -#include "base/condition.hpp" - -#include <FBaseRtThreadMonitor.h> - -namespace threads -{ - namespace impl - { - class ConditionImpl - { - public: - Osp::Base::Runtime::Monitor m_Monitor; - }; - } - - Condition::Condition() : m_pImpl(new impl::ConditionImpl()) - { - m_pImpl->m_Monitor.Construct(); - } - - Condition::~Condition() - { - delete m_pImpl; - } - - void Condition::Signal(bool broadcast) - { - if (broadcast) - m_pImpl->m_Monitor.NotifyAll(); - else - m_pImpl->m_Monitor.Notify(); - } - - void Condition::Wait() - { - m_pImpl->m_Monitor.Wait(); - } - - void Condition::Lock() - { - m_pImpl->m_Monitor.Enter(); - } - - void Condition::Unlock() - { - m_pImpl->m_Monitor.Exit(); - } -} - -#endif // OMIM_OS_BADA diff --git a/base/condition_posix.cpp b/base/condition_posix.cpp deleted file mode 100644 index 24c743bbd4..0000000000 --- a/base/condition_posix.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "std/target_os.hpp" - -#if !defined(OMIM_OS_WINDOWS_NATIVE) - -#include "base/condition.hpp" -#include "base/mutex.hpp" - -#include "std/cstdint.hpp" -#include "std/errno.hpp" -#include "std/systime.hpp" - -#include <pthread.h> - -namespace threads -{ - namespace impl - { - class ConditionImpl - { - public: - Mutex m_Mutex; - pthread_cond_t m_Condition; - }; - } - - Condition::Condition() : m_pImpl(new impl::ConditionImpl()) - { - ::pthread_cond_init(&m_pImpl->m_Condition, 0); - } - - Condition::~Condition() - { - ::pthread_cond_destroy(&m_pImpl->m_Condition); - delete m_pImpl; - } - - void Condition::Signal(bool broadcast) - { - if (broadcast) - ::pthread_cond_broadcast(&m_pImpl->m_Condition); - else - ::pthread_cond_signal(&m_pImpl->m_Condition); - } - - void Condition::Wait() - { - ::pthread_cond_wait(&m_pImpl->m_Condition, &m_pImpl->m_Mutex.m_Mutex); - } - - bool Condition::Wait(unsigned ms) - { - if (ms == -1) - { - Wait(); - return false; - } - - ::timeval curtv; - ::gettimeofday(&curtv, 0); - - ::timespec ts; - - uint64_t deltaNanoSec = curtv.tv_usec * 1000 + ms * 1000000; - - ts.tv_sec = curtv.tv_sec + deltaNanoSec / 1000000000; - ts.tv_nsec = deltaNanoSec % 1000000000; - - int res = ::pthread_cond_timedwait(&m_pImpl->m_Condition, &m_pImpl->m_Mutex.m_Mutex, &ts); - - return (res == ETIMEDOUT); - } - - void Condition::Lock() - { - m_pImpl->m_Mutex.Lock(); - } - - bool Condition::TryLock() - { - return m_pImpl->m_Mutex.TryLock(); - } - - void Condition::Unlock() - { - m_pImpl->m_Mutex.Unlock(); - } -} - -#endif diff --git a/base/condition_windows_native.cpp b/base/condition_windows_native.cpp deleted file mode 100644 index 3f6a69d7c3..0000000000 --- a/base/condition_windows_native.cpp +++ /dev/null @@ -1,291 +0,0 @@ -#include "std/target_os.hpp" - -#ifdef OMIM_OS_WINDOWS_NATIVE - -#include "base/condition.hpp" -#include "base/mutex.hpp" - -#include "std/windows.hpp" - -typedef void (WINAPI *InitFn)(PCONDITION_VARIABLE); -typedef void (WINAPI *WakeFn)(PCONDITION_VARIABLE); -typedef void (WINAPI *WakeAllFn)(PCONDITION_VARIABLE); -typedef BOOL (WINAPI *SleepFn)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD); - -namespace threads -{ - namespace impl - { - class ConditionImpl - { - public: - virtual ~ConditionImpl() {} - virtual void Signal(bool broadcast) = 0; - virtual void Wait() = 0; - virtual bool Wait(unsigned ms) = 0; - virtual void Lock() = 0; - virtual bool TryLock() = 0; - virtual void Unlock() = 0; - }; - - class ImplWinVista : public ConditionImpl - { - InitFn m_pInit; - WakeFn m_pWake; - WakeAllFn m_pWakeAll; - SleepFn m_pSleep; - - CONDITION_VARIABLE m_Condition; - Mutex m_mutex; - - public: - ImplWinVista(InitFn pInit, WakeFn pWake, WakeAllFn pWakeAll, SleepFn pSleep) - : m_pInit(pInit), m_pWake(pWake), m_pWakeAll(pWakeAll), m_pSleep(pSleep) - { - m_pInit(&m_Condition); - } - - void Signal(bool broadcast) - { - if (broadcast) - m_pWakeAll(&m_Condition); - else - m_pWake(&m_Condition); - } - - void Wait() - { - m_pSleep(&m_Condition, &m_mutex.m_Mutex, INFINITE); - } - - bool Wait(unsigned ms) - { - if (!m_pSleep(&m_Condition, &m_mutex.m_Mutex, ms)) - return GetLastError() == ERROR_TIMEOUT; - return false; - } - - void Lock() - { - m_mutex.Lock(); - } - - bool TryLock() - { - return m_mutex.TryLock(); - } - - void Unlock() - { - m_mutex.Unlock(); - } - }; - - /////////////////////////////////////////////////////////////// - /// Based on Richter's SignalObjectAndWait solution - class ImplWinXP : public ConditionImpl - { - /// Number of waiting threads - int waiters_count_; - /// Serialize access to <waiters_count_> - CRITICAL_SECTION waiters_count_lock_; - /// Semaphore used to queue up threads waiting for the condition to - /// become signaled - HANDLE sema_; - /// An auto-reset event used by the broadcast/signal thread to wait - /// for all the waiting thread(s) to wake up and be released from the - /// semaphore - HANDLE waiters_done_; - /// Keeps track of whether we were broadcasting or signaling. This - /// allows us to optimize the code if we're just signaling - size_t was_broadcast_; - - HANDLE m_mutex; - - public: - ImplWinXP() : waiters_count_(0), was_broadcast_(0) - { - ::InitializeCriticalSection(&waiters_count_lock_); - m_mutex = ::CreateMutexA(NULL, FALSE, NULL); - - sema_ = ::CreateSemaphore(NULL, // no security - 0, // initially 0 - 0x7fffffff, // max count - NULL); // unnamed - waiters_done_ = CreateEvent(NULL, // no security - FALSE, // auto-reset - FALSE, // non-signaled initially - NULL); // unnamed - } - - ~ImplWinXP() - { - ::CloseHandle(m_mutex); - ::DeleteCriticalSection(&waiters_count_lock_); - } - - void Signal(bool broadcast) - { - if (broadcast) - { - // This is needed to ensure that <waiters_count_> and <was_broadcast_> are - // consistent relative to each other - EnterCriticalSection(&waiters_count_lock_); - int have_waiters = 0; - - if (waiters_count_ > 0) - { - // We are broadcasting, even if there is just one waiter... - // Record that we are broadcasting, which helps optimize - // <pthread_cond_wait> for the non-broadcast case. - was_broadcast_ = 1; - have_waiters = 1; - } - - if (have_waiters) - { - // Wake up all the waiters atomically. - ReleaseSemaphore(sema_, waiters_count_, 0); - - LeaveCriticalSection(&waiters_count_lock_); - - // Wait for all the awakened threads to acquire the counting - // semaphore. - WaitForSingleObject(waiters_done_, INFINITE); - // This assignment is okay, wven without the <waiters_count_lock_> held - // because no other waiter threads can wake up to access it. - was_broadcast_ = 0; - } - else - LeaveCriticalSection(&waiters_count_lock_); - } - else - { - EnterCriticalSection(&waiters_count_lock_); - bool const have_waiters = waiters_count_ > 0; - LeaveCriticalSection(&waiters_count_lock_); - - // If there aren't any waiters, then this is a no-op. - if (have_waiters) - ::ReleaseSemaphore(sema_, 1, 0); - } - } - - void Wait() - { - Wait(-1); - } - - bool Wait(unsigned ms) - { - // Avoid race conditions - ::EnterCriticalSection(&waiters_count_lock_); - ++waiters_count_; - ::LeaveCriticalSection(&waiters_count_lock_); - - // This call atomically releases the mutex and waits on the - // semaphore until <pthread_cond_signal> or <pthread_cond_broadcast> - // are called by another thread - - DWORD toWait = (ms == -1) ? INFINITE : ms; - - bool res = false; - - if (::SignalObjectAndWait(m_mutex, sema_, toWait, FALSE) == WAIT_TIMEOUT) - res = true; - - // Reacquire lock to avoid race conditions - ::EnterCriticalSection(&waiters_count_lock_); - - // We're no longer waiting... - --waiters_count_; - - // Check to see if we're the last waiter after <pthread_cond_broadcast>. - bool const last_waiter = was_broadcast_ && waiters_count_ == 0; - - ::LeaveCriticalSection(&waiters_count_lock_); - - // If we're the last waiter thread during this particular broadcast - // then let all the other threads proceed - if (last_waiter) - // This call atomically signals the <waiters_done_> event and waits until - // it can acquire the <external_mutex>. This is required to ensure fairness. - ::SignalObjectAndWait(waiters_done_, m_mutex, INFINITE, FALSE); - else - // Always regain the external mutex since that's the guarantee we - // give to our callers. - ::WaitForSingleObject(m_mutex, INFINITE); - - return res; - } - - void Lock() - { - ::WaitForSingleObject(m_mutex, INFINITE); - } - - bool TryLock() - { - /// @todo I don't care :) - Lock(); - return true; - } - - void Unlock() - { - ::ReleaseMutex(m_mutex); - } - }; - } - /////////////////////////////////////////////////////////////// - Condition::Condition() - { - HMODULE handle = GetModuleHandle(TEXT("kernel32.dll")); - InitFn pInit = (InitFn)GetProcAddress(handle, "InitializeConditionVariable"); - WakeFn pWake = (WakeFn)GetProcAddress(handle, "WakeConditionVariable"); - WakeAllFn pWakeAll = (WakeFn)GetProcAddress(handle, "WakeAllConditionVariable"); - SleepFn pSleep = (SleepFn)GetProcAddress(handle, "SleepConditionVariableCS"); - - if (pInit && pWake && pWakeAll && pSleep) - m_pImpl = new impl::ImplWinVista(pInit, pWake, pWakeAll, pSleep); - else - m_pImpl = new impl::ImplWinXP(); - } - - Condition::~Condition() - { - delete m_pImpl; - } - - void Condition::Signal(bool broadcast) - { - m_pImpl->Signal(broadcast); - } - - void Condition::Wait() - { - return m_pImpl->Wait(); - } - - bool Condition::Wait(unsigned ms) - { - return m_pImpl->Wait(ms); - } - - void Condition::Lock() - { - m_pImpl->Lock(); - } - - bool Condition::TryLock() - { - return m_pImpl->TryLock(); - } - - void Condition::Unlock() - { - m_pImpl->Unlock(); - } -} - -#endif // OMIM_OS_WINDOWS_NATIVE diff --git a/base/const_helper.hpp b/base/const_helper.hpp deleted file mode 100644 index b5a71a9336..0000000000 --- a/base/const_helper.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace my -{ - template <typename TFrom, typename TTo> struct PropagateConst - { - typedef TTo type; - }; - template <typename TFrom, typename TTo> struct PropagateConst<TFrom const, TTo> - { - typedef TTo const type; - }; -} diff --git a/base/deferred_task.cpp b/base/deferred_task.cpp index b6d76e0029..c3cc50e6ff 100644 --- a/base/deferred_task.cpp +++ b/base/deferred_task.cpp @@ -6,7 +6,7 @@ DeferredTask::DeferredTask(TDuration const & duration) : m_duration(duration) { m_thread = threads::SimpleThread([this] { - unique_lock<mutex> l(m_mutex); + std::unique_lock<std::mutex> l(m_mutex); while (!m_terminate) { if (!m_fn) @@ -15,7 +15,7 @@ DeferredTask::DeferredTask(TDuration const & duration) : m_duration(duration) continue; } - if (m_cv.wait_for(l, m_duration) != cv_status::timeout || !m_fn) + if (m_cv.wait_for(l, m_duration) != std::cv_status::timeout || !m_fn) continue; auto fn = move(m_fn); @@ -31,7 +31,7 @@ DeferredTask::DeferredTask(TDuration const & duration) : m_duration(duration) DeferredTask::~DeferredTask() { { - unique_lock<mutex> l(m_mutex); + std::unique_lock<std::mutex> l(m_mutex); m_terminate = true; } m_cv.notify_one(); @@ -41,7 +41,7 @@ DeferredTask::~DeferredTask() void DeferredTask::Drop() { { - unique_lock<mutex> l(m_mutex); + std::unique_lock<std::mutex> l(m_mutex); m_fn = nullptr; } m_cv.notify_one(); diff --git a/base/deferred_task.hpp b/base/deferred_task.hpp index de9b9e40cc..246b99d554 100644 --- a/base/deferred_task.hpp +++ b/base/deferred_task.hpp @@ -2,20 +2,20 @@ #include "base/thread.hpp" -#include "std/chrono.hpp" -#include "std/condition_variable.hpp" -#include "std/function.hpp" -#include "std/mutex.hpp" +#include <chrono> +#include <condition_variable> +#include <functional> +#include <mutex> namespace my { class DeferredTask { - using TDuration = duration<double>; + using TDuration = std::chrono::duration<double>; threads::SimpleThread m_thread; - mutex m_mutex; - condition_variable m_cv; - function<void()> m_fn; + std::mutex m_mutex; + std::condition_variable m_cv; + std::function<void()> m_fn; TDuration m_duration; bool m_terminate = false; @@ -29,7 +29,7 @@ public: void RestartWith(TFn const && fn) { { - unique_lock<mutex> l(m_mutex); + std::unique_lock<std::mutex> l(m_mutex); m_fn = fn; } m_cv.notify_one(); diff --git a/base/dfa_helpers.hpp b/base/dfa_helpers.hpp index 5815f380f9..3c04cbcd27 100644 --- a/base/dfa_helpers.hpp +++ b/base/dfa_helpers.hpp @@ -2,7 +2,7 @@ #include "base/string_utils.hpp" -#include "std/string.hpp" +#include <string> namespace strings { @@ -59,7 +59,7 @@ void DFAMove(DFAIt & it, UniString const & s) } template <typename DFAIt> -void DFAMove(DFAIt & it, string const & s) +void DFAMove(DFAIt & it, std::string const & s) { DFAMove(it, MakeUniString(s)); } diff --git a/base/exception.cpp b/base/exception.cpp index 78853d0150..4f8584a2c1 100644 --- a/base/exception.cpp +++ b/base/exception.cpp @@ -4,7 +4,7 @@ char const * RootException::what() const throw() { size_t const count = m_Msg.size(); - string asciiMsg; + std::string asciiMsg; asciiMsg.resize(count); for (size_t i = 0; i < count; ++i) @@ -15,7 +15,7 @@ char const * RootException::what() const throw() asciiMsg[i] = '?'; } - static string msg; - msg = string(m_What) + ", \"" + asciiMsg + "\""; + static std::string msg; + msg = std::string(m_What) + ", \"" + asciiMsg + "\""; return msg.c_str(); } diff --git a/base/exception.hpp b/base/exception.hpp index 195ff101ee..87be96775e 100644 --- a/base/exception.hpp +++ b/base/exception.hpp @@ -2,13 +2,13 @@ #include "base/internal/message.hpp" #include "base/macros.hpp" -#include "std/exception.hpp" -#include "std/string.hpp" +#include <exception> +#include <string> -class RootException : public exception +class RootException : public std::exception { public: - RootException(char const * what, string const & msg) : m_What(what), m_Msg(msg) + RootException(char const * what, std::string const & msg) : m_What(what), m_Msg(msg) { } @@ -18,14 +18,14 @@ public: virtual char const * what() const throw(); - string const & Msg() const throw() + std::string const & Msg() const throw() { return m_Msg; } private: char const * m_What; - string m_Msg; + std::string m_Msg; }; #define DECLARE_EXCEPTION(exception_name, base_exception) \ diff --git a/base/gmtime.hpp b/base/gmtime.hpp index c67e9f7ab8..a9552836b8 100644 --- a/base/gmtime.hpp +++ b/base/gmtime.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/ctime.hpp" +#include <ctime> namespace my { diff --git a/base/internal/message.cpp b/base/internal/message.cpp index 5c9804c8e2..8a17c6bb13 100644 --- a/base/internal/message.cpp +++ b/base/internal/message.cpp @@ -3,7 +3,7 @@ #include "std/target_os.hpp" -string DebugPrint(string const & t) +std::string DebugPrint(std::string const & t) { #ifdef OMIM_OS_WINDOWS string res; diff --git a/base/internal/message.hpp b/base/internal/message.hpp index f9775a9a15..03d6d0f957 100644 --- a/base/internal/message.hpp +++ b/base/internal/message.hpp @@ -1,71 +1,71 @@ #pragma once -#include "std/array.hpp" -#include "std/deque.hpp" -#include "std/functional.hpp" -#include "std/initializer_list.hpp" -#include "std/iterator.hpp" -#include "std/list.hpp" -#include "std/map.hpp" -#include "std/set.hpp" -#include "std/sstream.hpp" -#include "std/string.hpp" -#include "std/unique_ptr.hpp" -#include "std/unordered_map.hpp" -#include "std/unordered_set.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" +#include <array> +#include <deque> +#include <functional> +#include <initializer_list> +#include <iterator> +#include <list> +#include <map> +#include <set> +#include <sstream> +#include <string> +#include <memory> +#include <unordered_map> +#include <unordered_set> +#include <utility> +#include <vector> /// @name Declarations. //@{ -template <typename T> inline string DebugPrint(T const & t); - -string DebugPrint(string const & t); -inline string DebugPrint(char const * t); -inline string DebugPrint(char t); - -template <typename U, typename V> inline string DebugPrint(pair<U, V> const & p); -template <typename T> inline string DebugPrint(list<T> const & v); -template <typename T> inline string DebugPrint(vector<T> const & v); -template <typename T, typename C = less<T>> inline string DebugPrint(set<T, C> const & v); -template <typename T, typename C = less<T>> inline string DebugPrint(multiset<T, C> const & v); -template <typename U, typename V, typename C = less<U>> inline string DebugPrint(map<U, V, C> const & v); -template <typename T> inline string DebugPrint(initializer_list<T> const & v); -template <typename T> inline string DebugPrint(unique_ptr<T> const & v); - -template <class Key, class Hash = hash<Key>, class Pred = equal_to<Key>> -inline string DebugPrint(unordered_set<Key, Hash, Pred> const & v); -template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>> -inline string DebugPrint(unordered_map<Key, T, Hash, Pred> const & v); +template <typename T> inline std::string DebugPrint(T const & t); + +std::string DebugPrint(std::string const & t); +inline std::string DebugPrint(char const * t); +inline std::string DebugPrint(char t); + +template <typename U, typename V> inline std::string DebugPrint(std::pair<U, V> const & p); +template <typename T> inline std::string DebugPrint(std::list<T> const & v); +template <typename T> inline std::string DebugPrint(std::vector<T> const & v); +template <typename T, typename C = std::less<T>> inline std::string DebugPrint(std::set<T, C> const & v); +template <typename T, typename C = std::less<T>> inline std::string DebugPrint(std::multiset<T, C> const & v); +template <typename U, typename V, typename C = std::less<U>> inline std::string DebugPrint(std::map<U, V, C> const & v); +template <typename T> inline std::string DebugPrint(std::initializer_list<T> const & v); +template <typename T> inline std::string DebugPrint(std::unique_ptr<T> const & v); + +template <class Key, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>> +inline std::string DebugPrint(std::unordered_set<Key, Hash, Pred> const & v); +template <class Key, class T, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>> +inline std::string DebugPrint(std::unordered_map<Key, T, Hash, Pred> const & v); //@} -inline string DebugPrint(char const * t) +inline std::string DebugPrint(char const * t) { if (t) - return DebugPrint(string(t)); + return DebugPrint(std::string(t)); else - return string("NULL string pointer"); + return std::string("NULL string pointer"); } -inline string DebugPrint(char t) +inline std::string DebugPrint(char t) { - return DebugPrint(string(1, t)); + return DebugPrint(std::string(1, t)); } -inline string DebugPrint(signed char t) +inline std::string DebugPrint(signed char t) { return DebugPrint(static_cast<int>(t)); } -inline string DebugPrint(unsigned char t) +inline std::string DebugPrint(unsigned char t) { return DebugPrint(static_cast<unsigned int>(t)); } -template <typename U, typename V> inline string DebugPrint(pair<U,V> const & p) +template <typename U, typename V> inline std::string DebugPrint(std::pair<U,V> const & p) { - ostringstream out; + std::ostringstream out; out << "(" << DebugPrint(p.first) << ", " << DebugPrint(p.second) << ")"; return out.str(); } @@ -74,10 +74,10 @@ namespace my { namespace impl { - template <typename IterT> inline string DebugPrintSequence(IterT beg, IterT end) + template <typename IterT> inline std::string DebugPrintSequence(IterT beg, IterT end) { - ostringstream out; - out << "[" << distance(beg, end) << ":"; + std::ostringstream out; + out << "[" << std::distance(beg, end) << ":"; for (; beg != end; ++beg) out << " " << DebugPrint(*beg); out << " ]"; @@ -86,73 +86,73 @@ namespace my } } -template <typename T, size_t N> inline string DebugPrint(T (&arr) [N]) +template <typename T, size_t N> inline std::string DebugPrint(T (&arr) [N]) { return ::my::impl::DebugPrintSequence(arr, arr + N); } -template <typename T, size_t N> inline string DebugPrint(array<T, N> const & v) +template <typename T, size_t N> inline std::string DebugPrint(std::array<T, N> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T> inline string DebugPrint(vector<T> const & v) +template <typename T> inline std::string DebugPrint(std::vector<T> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T> inline string DebugPrint(deque<T> const & d) +template <typename T> inline std::string DebugPrint(std::deque<T> const & d) { return ::my::impl::DebugPrintSequence(d.begin(), d.end()); } -template <typename T> inline string DebugPrint(list<T> const & v) +template <typename T> inline std::string DebugPrint(std::list<T> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T, typename C> inline string DebugPrint(set<T, C> const & v) +template <typename T, typename C> inline std::string DebugPrint(std::set<T, C> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T, typename C> inline string DebugPrint(multiset<T, C> const & v) +template <typename T, typename C> inline std::string DebugPrint(std::multiset<T, C> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename U, typename V, typename C> inline string DebugPrint(map<U, V, C> const & v) +template <typename U, typename V, typename C> inline std::string DebugPrint(std::map<U, V, C> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T> inline string DebugPrint(initializer_list<T> const & v) +template <typename T> inline std::string DebugPrint(std::initializer_list<T> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } template <class Key, class Hash, class Pred> -inline string DebugPrint(unordered_set<Key, Hash, Pred> const & v) +inline std::string DebugPrint(std::unordered_set<Key, Hash, Pred> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } template <class Key, class T, class Hash, class Pred> -inline string DebugPrint(unordered_map<Key, T, Hash, Pred> const & v) +inline std::string DebugPrint(std::unordered_map<Key, T, Hash, Pred> const & v) { return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } -template <typename T> inline string DebugPrint(T const & t) +template <typename T> inline std::string DebugPrint(T const & t) { - ostringstream out; + std::ostringstream out; out << t; return out.str(); } -template <typename T> inline string DebugPrint(unique_ptr<T> const & v) +template <typename T> inline std::string DebugPrint(std::unique_ptr<T> const & v) { - ostringstream out; + std::ostringstream out; if (v.get() != nullptr) out << DebugPrint(*v); else @@ -164,15 +164,15 @@ namespace my { namespace impl { - inline string Message() + inline std::string Message() { - return string(); + return std::string(); } - template <typename T> string Message(T const & t) + template <typename T> std::string Message(T const & t) { return DebugPrint(t); } - template <typename T, typename... ARGS> string Message(T const & t, ARGS const & ... others) + template <typename T, typename... ARGS> std::string Message(T const & t, ARGS const & ... others) { return DebugPrint(t) + " " + Message(others...); } diff --git a/base/levenshtein_dfa.cpp b/base/levenshtein_dfa.cpp index 0586e83390..53912830c4 100644 --- a/base/levenshtein_dfa.cpp +++ b/base/levenshtein_dfa.cpp @@ -3,11 +3,11 @@ #include "base/assert.hpp" #include "base/stl_helpers.hpp" -#include "std/algorithm.hpp" -#include "std/queue.hpp" -#include "std/set.hpp" -#include "std/sstream.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <queue> +#include <set> +#include <sstream> +#include <vector> namespace strings { @@ -78,7 +78,7 @@ private: bool FindRelevant(LevenshteinDFA::Position const & p, UniChar c, size_t & i) const { size_t const limit = - min(m_size - p.m_offset, static_cast<size_t>(p.m_errorsLeft) + 1); + std::min(m_size - p.m_offset, static_cast<size_t>(p.m_errorsLeft) + 1); for (i = 0; i < limit; ++i) { @@ -152,7 +152,7 @@ void LevenshteinDFA::State::Normalize() { ASSERT_GREATER(j, 0, ()); --j; - swap(m_positions[i], m_positions[j]); + std::swap(m_positions[i], m_positions[j]); } } @@ -176,8 +176,8 @@ LevenshteinDFA::LevenshteinDFA(UniString const & s, size_t prefixCharsToKeep, ui } m_alphabet.push_back(missed); - queue<State> states; - map<State, size_t> visited; + std::queue<State> states; + std::map<State, size_t> visited; auto pushState = [&states, &visited, this](State const & state, size_t id) { @@ -231,7 +231,7 @@ LevenshteinDFA::LevenshteinDFA(UniString const & s, size_t prefixCharsToKeep, ui } } -LevenshteinDFA::LevenshteinDFA(string const & s, size_t prefixCharsToKeep, uint8_t maxErrors) +LevenshteinDFA::LevenshteinDFA(std::string const & s, size_t prefixCharsToKeep, uint8_t maxErrors) : LevenshteinDFA(MakeUniString(s), prefixCharsToKeep, maxErrors) { } @@ -241,7 +241,7 @@ LevenshteinDFA::LevenshteinDFA(UniString const & s, uint8_t maxErrors) { } -LevenshteinDFA::LevenshteinDFA(string const & s, uint8_t maxErrors) +LevenshteinDFA::LevenshteinDFA(std::string const & s, uint8_t maxErrors) : LevenshteinDFA(s, 0 /* prefixCharsToKeep */, maxErrors) { } @@ -304,17 +304,17 @@ size_t LevenshteinDFA::Move(size_t s, UniChar c) const return m_transitions[s][i]; } -string DebugPrint(LevenshteinDFA::Position const & p) +std::string DebugPrint(LevenshteinDFA::Position const & p) { - ostringstream os; + std::ostringstream os; os << "Position [" << p.m_offset << ", " << static_cast<uint32_t>(p.m_errorsLeft) << ", " << p.m_transposed << "]"; return os.str(); } -string DebugPrint(LevenshteinDFA::State const & s) +std::string DebugPrint(LevenshteinDFA::State const & s) { - ostringstream os; + std::ostringstream os; os << "State ["; for (size_t i = 0; i < s.m_positions.size(); ++i) { diff --git a/base/levenshtein_dfa.hpp b/base/levenshtein_dfa.hpp index 3ba7bbb22c..4edc06022c 100644 --- a/base/levenshtein_dfa.hpp +++ b/base/levenshtein_dfa.hpp @@ -2,8 +2,8 @@ #include "base/string_utils.hpp" -#include "std/cstdint.hpp" -#include "std/vector.hpp" +#include <cstdint> +#include <vector> namespace strings { @@ -61,7 +61,7 @@ public: inline bool operator<(State const & rhs) const { return m_positions < rhs.m_positions; } - vector<Position> m_positions; + std::vector<Position> m_positions; }; // An iterator to the current state in the DFA. @@ -90,9 +90,9 @@ public: }; LevenshteinDFA(UniString const & s, size_t prefixCharsToKeep, uint8_t maxErrors); - LevenshteinDFA(string const & s, size_t prefixCharsToKeep, uint8_t maxErrors); + LevenshteinDFA(std::string const & s, size_t prefixCharsToKeep, uint8_t maxErrors); LevenshteinDFA(UniString const & s, uint8_t maxErrors); - LevenshteinDFA(string const & s, uint8_t maxErrors); + LevenshteinDFA(std::string const & s, uint8_t maxErrors); inline Iterator Begin() const { return Iterator(*this); } @@ -120,12 +120,12 @@ private: size_t const m_size; uint8_t const m_maxErrors; - vector<UniChar> m_alphabet; + std::vector<UniChar> m_alphabet; - vector<vector<size_t>> m_transitions; - vector<bool> m_accepting; + std::vector<std::vector<size_t>> m_transitions; + std::vector<bool> m_accepting; }; -string DebugPrint(LevenshteinDFA::Position const & p); -string DebugPrint(LevenshteinDFA::State const & s); +std::string DebugPrint(LevenshteinDFA::Position const & p); +std::string DebugPrint(LevenshteinDFA::State const & s); } // namespace strings diff --git a/base/limited_priority_queue.hpp b/base/limited_priority_queue.hpp index 281108ef86..15bf294bf0 100644 --- a/base/limited_priority_queue.hpp +++ b/base/limited_priority_queue.hpp @@ -3,20 +3,20 @@ #include "base/base.hpp" #include "base/assert.hpp" -#include "std/algorithm.hpp" -#include "std/functional.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <functional> +#include <vector> namespace my { // Priority queue that stores only N smallest elements. -template <typename T, typename CompareT = less<T> > +template <typename T, typename CompareT = std::less<T> > class limited_priority_queue { public: typedef T value_type; - typedef typename vector<T>::const_iterator const_iterator; + typedef typename std::vector<T>::const_iterator const_iterator; explicit limited_priority_queue(size_t maxSize = 1, CompareT compare = CompareT()) : m_maxSize(maxSize == 0 ? 1 : maxSize), m_compare(compare) @@ -79,7 +79,7 @@ public: void reserve(size_t n) { m_queue.reserve(n); } private: - vector<T> m_queue; + std::vector<T> m_queue; size_t m_maxSize; CompareT m_compare; }; diff --git a/base/logging.cpp b/base/logging.cpp index 7af5d1b8ae..5e77051daa 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -5,12 +5,12 @@ #include "base/thread.hpp" #include "base/timer.hpp" -#include "std/iomanip.hpp" -#include "std/iostream.hpp" -#include "std/mutex.hpp" -#include "std/sstream.hpp" +#include <iomanip> +#include <iostream> +#include <mutex> +#include <sstream> #include "std/target_os.hpp" -#include "std/windows.hpp" +//#include "std/windows.hpp" namespace my @@ -18,7 +18,7 @@ namespace my class LogHelper { int m_threadsCount; - map<threads::ThreadID, int> m_threadID; + std::map<threads::ThreadID, int> m_threadID; int GetThreadID() { @@ -43,7 +43,7 @@ namespace my m_names[4] = "CRITICAL"; m_lens[4] = 8; } - void WriteProlog(ostream & s, LogLevel level) + void WriteProlog(std::ostream & s, LogLevel level) { s << "LOG"; @@ -51,33 +51,33 @@ namespace my s << " " << m_names[level]; double const sec = m_timer.ElapsedSeconds(); - s << " " << setfill(' ') << setw(static_cast<int>(16 - m_lens[level])) << sec << " "; + s << " " << std::setfill(' ') << std::setw(static_cast<int>(16 - m_lens[level])) << sec << " "; } }; - mutex g_logMutex; + std::mutex g_logMutex; - void LogMessageDefault(LogLevel level, SrcPoint const & srcPoint, string const & msg) + void LogMessageDefault(LogLevel level, SrcPoint const & srcPoint, std::string const & msg) { - lock_guard<mutex> lock(g_logMutex); + std::lock_guard<std::mutex> lock(g_logMutex); static LogHelper logger; - ostringstream out; + std::ostringstream out; logger.WriteProlog(out, level); - out << DebugPrint(srcPoint) << msg << endl; + out << DebugPrint(srcPoint) << msg << std::endl; std::cerr << out.str(); CHECK_LESS(level, g_LogAbortLevel, ("Abort. Log level is too serious", level)); } - void LogMessageTests(LogLevel level, SrcPoint const &, string const & msg) + void LogMessageTests(LogLevel level, SrcPoint const &, std::string const & msg) { - lock_guard<mutex> lock(g_logMutex); + std::lock_guard<std::mutex> lock(g_logMutex); - ostringstream out; - out << msg << endl; + std::ostringstream out; + out << msg << std::endl; std::cerr << out.str(); CHECK_LESS(level, g_LogAbortLevel, ("Abort. Log level is too serious", level)); diff --git a/base/logging.hpp b/base/logging.hpp index 657682d746..678a1b1685 100644 --- a/base/logging.hpp +++ b/base/logging.hpp @@ -4,7 +4,7 @@ #include "base/internal/message.hpp" #include "base/src_point.hpp" -#include "std/atomic.hpp" +#include <atomic> namespace my { @@ -17,8 +17,8 @@ namespace my LCRITICAL }; - typedef atomic<LogLevel> TLogLevel; - typedef void (*LogMessageFn)(LogLevel level, SrcPoint const &, string const &); + using TLogLevel = std::atomic<LogLevel>; + typedef void (*LogMessageFn)(LogLevel level, SrcPoint const &, std::string const &); extern LogMessageFn LogMessage; extern TLogLevel g_LogLevel; @@ -27,8 +27,8 @@ namespace my /// @return Pointer to previous message function. LogMessageFn SetLogMessageFn(LogMessageFn fn); - void LogMessageDefault(LogLevel level, SrcPoint const & srcPoint, string const & msg); - void LogMessageTests(LogLevel level, SrcPoint const & srcPoint, string const & msg); + void LogMessageDefault(LogLevel level, SrcPoint const & srcPoint, std::string const & msg); + void LogMessageTests(LogLevel level, SrcPoint const & srcPoint, std::string const & msg); /// Scope Guard to temporarily suppress specific log level, for example, in unit tests: /// ... diff --git a/base/math.hpp b/base/math.hpp index eb20ca4295..a213d6a2a3 100644 --- a/base/math.hpp +++ b/base/math.hpp @@ -1,11 +1,13 @@ #pragma once #include "base/assert.hpp" -#include "std/algorithm.hpp" #include "std/cmath.hpp" -#include "std/functional.hpp" -#include "std/limits.hpp" -#include "std/type_traits.hpp" + +#include <algorithm> +#include <cmath> +#include <functional> +#include <limits> +#include <type_traits> #include <boost/integer.hpp> @@ -27,8 +29,8 @@ template <typename T> inline T Abs(T x) template <typename TFloat> bool AlmostEqualULPs(TFloat x, TFloat y, unsigned int maxULPs = 256) { - static_assert(is_floating_point<TFloat>::value, ""); - static_assert(numeric_limits<TFloat>::is_iec559, ""); + static_assert(std::is_floating_point<TFloat>::value, ""); + static_assert(std::numeric_limits<TFloat>::is_iec559, ""); // Make sure maxUlps is non-negative and small enough that the // default NaN won't compare as equal to anything. @@ -70,7 +72,7 @@ inline bool AlmostEqualAbs(TFloat x, TFloat y, TFloat eps) template <typename TFloat> inline bool AlmostEqualRel(TFloat x, TFloat y, TFloat eps) { - return fabs(x - y) < eps * max(fabs(x), fabs(y)); + return fabs(x - y) < eps * std::max(fabs(x), fabs(y)); } // Returns true if x and y are equal up to the absolute or relative difference eps. @@ -187,7 +189,7 @@ template <typename T> T GCD(T a, T b) { if (a == 0 || b == 0) { - gcd = max(a, b); + gcd = std::max(a, b); break; } @@ -207,15 +209,15 @@ template <typename T> T GCD(T a, T b) if ((a & 0x1) != 0 && (b & 0x1) != 0) { - T const minV = min(a, b); - T const maxV = max(a, b); + T const minV = std::min(a, b); + T const maxV = std::max(a, b); a = (maxV - minV) >> 1; b = minV; continue; } if ((a & 0x1) != 0) - swap(a, b); + std::swap(a, b); a >>= 1; } @@ -228,7 +230,7 @@ template <typename T1, typename T2> size_t Hash(T1 const & t1, T2 const & t2) { /// @todo Probably, we need better hash for 2 integral types. - return (hash<T1>()(t1) ^ (hash<T2>()(t2) << 1)); + return (std::hash<T1>()(t1) ^ (std::hash<T2>()(t2) << 1)); } } diff --git a/base/matrix.hpp b/base/matrix.hpp index 9733bb99a5..63df382938 100644 --- a/base/matrix.hpp +++ b/base/matrix.hpp @@ -2,8 +2,8 @@ #include "base/math.hpp" -#include "std/iomanip.hpp" -#include "std/initializer_list.hpp" +#include <iomanip> +#include <initializer_list> namespace math @@ -27,10 +27,10 @@ namespace math copy(data, data + Rows * Cols, m_data); } - Matrix(initializer_list<T> const & initList) + Matrix(std::initializer_list<T> const & initList) { ASSERT(initList.size() == Rows * Cols, ()); - copy(initList.begin(), initList.end(), m_data); + std::copy(initList.begin(), initList.end(), m_data); } template <typename U> @@ -196,17 +196,17 @@ namespace math return res; } - template <typename T, unsigned M, unsigned N> string DebugPrint(Matrix<T, M, N> const & m) + template <typename T, unsigned M, unsigned N> std::string DebugPrint(Matrix<T, M, N> const & m) { - ostringstream ss; + std::ostringstream ss; - ss << ":" << endl; + ss << ":" << std::endl; for (unsigned i = 0; i < M; ++i) { for (unsigned j = 0; j < N; ++j) - ss << setfill(' ') << setw(10) << m(i, j) << " "; - ss << endl; + ss << std::setfill(' ') << std::setw(10) << m(i, j) << " "; + ss << std::endl; } return ss.str(); diff --git a/base/mem_trie.hpp b/base/mem_trie.hpp index 7c2a0eb7f2..46affa1cdc 100644 --- a/base/mem_trie.hpp +++ b/base/mem_trie.hpp @@ -2,8 +2,8 @@ #include "base/macros.hpp" -#include "std/map.hpp" -#include "std/vector.hpp" +#include <map> +#include <vector> namespace my { @@ -47,7 +47,7 @@ public: void ForEach(ToDo && toDo) { TString prefix; - ForEach(&m_root, prefix, forward<ToDo>(toDo)); + ForEach(&m_root, prefix, std::forward<ToDo>(toDo)); } template <typename ToDo> @@ -55,7 +55,7 @@ public: { Node const * node = MoveTo(prefix); if (node) - ForEach(node, prefix, forward<ToDo>(toDo)); + ForEach(node, prefix, std::forward<ToDo>(toDo)); } size_t GetNumNodes() const { return m_numNodes; } @@ -91,8 +91,8 @@ private: void AddValue(TValue const & value) { m_values.push_back(value); } - map<TChar, Node *> m_moves; - vector<TValue> m_values; + std::map<TChar, Node *> m_moves; + std::vector<TValue> m_values; DISALLOW_COPY(Node); }; diff --git a/base/newtype.hpp b/base/newtype.hpp index 5d435eda24..f9306c3ae7 100644 --- a/base/newtype.hpp +++ b/base/newtype.hpp @@ -1,21 +1,21 @@ #pragma once -#include "std/iostream.hpp" -#include "std/type_traits.hpp" +#include <iostream> +#include <type_traits> namespace my { namespace impl { template <typename From, typename To> -using IsConvertibleGuard = typename enable_if<is_convertible<From, To>::value>::type *; +using IsConvertibleGuard = typename std::enable_if<std::is_convertible<From, To>::value>::type *; } // namespace impl /// Creates a typesafe alias to a given numeric Type. template <typename Type, typename Tag> class NewType { - static_assert(is_integral<Type>::value || is_floating_point<Type>::value, + static_assert(std::is_integral<Type>::value || std::is_floating_point<Type>::value, "NewType can be used only with integral and floating point type."); public: diff --git a/base/object_tracker.cpp b/base/object_tracker.cpp deleted file mode 100644 index acad6d0a15..0000000000 --- a/base/object_tracker.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "base/object_tracker.hpp" -#include "base/assert.hpp" -#include "base/logging.hpp" - -#include "std/target_os.hpp" - -#ifndef OMIM_OS_WINDOWS - #include <signal.h> - #include <unistd.h> -#else - #include "std/windows.hpp" -#endif - - -namespace dbg -{ - -map<void *, size_t> ObjectTracker::m_map; -size_t ObjectTracker::m_counter = 0; - -#ifdef TRACKER_MULTITHREADED -threads::Mutex ObjectTracker::m_mutex; -#endif - -void ObjectTracker::Add(void * p) -{ -#ifdef TRACKER_MULTITHREADED - threads::MutexGuard guard(m_mutex); -#endif - - CHECK ( m_map.insert(make_pair(p, m_counter++)).second == true, (p) ); -} - -void ObjectTracker::Remove(void * p) -{ -#ifdef TRACKER_MULTITHREADED - threads::MutexGuard guard(m_mutex); -#endif - - CHECK ( m_map.erase(p) == 1, (p) ); -} - -ObjectTracker::ObjectTracker() -{ - Add(this); -} - -ObjectTracker::ObjectTracker(ObjectTracker const &) -{ - Add(this); -} - -ObjectTracker::~ObjectTracker() -{ - Remove(this); -} - -void ObjectTracker::PrintLeaks() -{ -#ifdef TRACKER_MULTITHREADED - threads::MutexGuard guard(m_mutex); -#endif - - if (m_map.empty()) - LOG(LINFO, ("No leaks found!")); - else - LOG(LINFO, ("Leaks map:", m_map)); -} - -void BreakIntoDebugger() -{ - /// @todo Probably we can make it more simple (like std::terminate). - -#if defined(OMIM_OS_WINDOWS) - DebugBreak(); -#else - kill(getpid(), SIGINT); -#endif -} - -} diff --git a/base/object_tracker.hpp b/base/object_tracker.hpp deleted file mode 100644 index 377f511e96..0000000000 --- a/base/object_tracker.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include "base/base.hpp" -#include "base/mutex.hpp" - -#include "std/map.hpp" - - -#define TRACKER_MULTITHREADED - -namespace dbg -{ - class ObjectTracker - { - /// Pointer -> Info (Serial number of creation) - static map<void *, size_t> m_map; - static size_t m_counter; - -#ifdef TRACKER_MULTITHREADED - static threads::Mutex m_mutex; -#endif - - static void Add(void *); - static void Remove(void *); - - public: - ObjectTracker(); - ObjectTracker(ObjectTracker const & rhs); - ~ObjectTracker(); - - static void PrintLeaks(); - }; - - void BreakIntoDebugger(); -} diff --git a/base/observer_list.hpp b/base/observer_list.hpp index 04aab44b9b..0599a15ead 100644 --- a/base/observer_list.hpp +++ b/base/observer_list.hpp @@ -2,9 +2,9 @@ #include "base/logging.hpp" -#include "std/algorithm.hpp" -#include "std/mutex.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <mutex> +#include <vector> namespace my { @@ -16,7 +16,7 @@ class ObserverList public: bool Add(TObserver & observer) { - lock_guard<mutex> lock(m_observersLock); + std::lock_guard<std::mutex> lock(m_observersLock); auto const it = find(m_observers.begin(), m_observers.end(), &observer); if (it != m_observers.end()) { @@ -29,7 +29,7 @@ public: bool Remove(TObserver const & observer) { - lock_guard<mutex> lock(m_observersLock); + std::lock_guard<std::mutex> lock(m_observersLock); auto const it = find(m_observers.begin(), m_observers.end(), &observer); if (it == m_observers.end()) { @@ -43,13 +43,13 @@ public: template <typename F, typename... Args> void ForEach(F fn, Args const &... args) { - lock_guard<mutex> lock(m_observersLock); + std::lock_guard<std::mutex> lock(m_observersLock); for (TObserver * observer : m_observers) (observer->*fn)(args...); } private: - vector<TObserver *> m_observers; - mutex m_observersLock; + std::vector<TObserver *> m_observers; + std::mutex m_observersLock; }; } // namespace my diff --git a/base/range_iterator.hpp b/base/range_iterator.hpp index 7f2ee7ca3a..26e5270a98 100644 --- a/base/range_iterator.hpp +++ b/base/range_iterator.hpp @@ -1,7 +1,7 @@ #pragma once -#include "std/iterator.hpp" -#include "std/type_traits.hpp" +#include <iterator> +#include <type_traits> namespace my { diff --git a/base/ref_counted.hpp b/base/ref_counted.hpp index 54feffc08b..c63d388568 100644 --- a/base/ref_counted.hpp +++ b/base/ref_counted.hpp @@ -2,8 +2,8 @@ #include "base/macros.hpp" -#include "std/cstdint.hpp" -#include "std/unique_ptr.hpp" +#include <cstdint> +#include <memory> namespace my { @@ -36,15 +36,15 @@ public: m_p->IncRef(); } - explicit RefCountPtr(unique_ptr<T> p) noexcept : RefCountPtr(p.release()) {} + explicit RefCountPtr(std::unique_ptr<T> p) noexcept : RefCountPtr(p.release()) {} RefCountPtr(RefCountPtr const & rhs) { *this = rhs; } - RefCountPtr(RefCountPtr && rhs) { *this = move(rhs); } + RefCountPtr(RefCountPtr && rhs) { *this = std::move(rhs); } ~RefCountPtr() { Reset(); } - RefCountPtr & operator=(unique_ptr<T> p) + RefCountPtr & operator=(std::unique_ptr<T> p) { Reset(); diff --git a/base/set_operations.hpp b/base/set_operations.hpp index 4b28d93edf..a65a33629b 100644 --- a/base/set_operations.hpp +++ b/base/set_operations.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/algorithm.hpp" +#include <algorithm> // Similar to set_difference(), but if element is present n times in the first sequence and once in // the second sequence, all n copies are filtered, insted of one. @@ -29,5 +29,5 @@ OutIterT SetDifferenceUnlimited(Iter1T beg1, Iter1T end1, // ++beg2; } } - return copy(beg1, end1, out); + return std::copy(beg1, end1, out); } diff --git a/base/shared_buffer_manager.cpp b/base/shared_buffer_manager.cpp index 0e530e627f..1e5a33b085 100644 --- a/base/shared_buffer_manager.cpp +++ b/base/shared_buffer_manager.cpp @@ -20,7 +20,7 @@ SharedBufferManager::shared_buffer_ptr_t SharedBufferManager::reserveSharedBuffe shared_buffer_ptr_list_t & l = m_sharedBuffers[s]; if (l.empty()) - l.push_back(make_shared<shared_buffer_t>(s)); + l.push_back(std::make_shared<shared_buffer_t>(s)); shared_buffer_ptr_t res = l.front(); l.pop_front(); diff --git a/base/shared_buffer_manager.hpp b/base/shared_buffer_manager.hpp index c73b9d9215..42a6da9aa2 100644 --- a/base/shared_buffer_manager.hpp +++ b/base/shared_buffer_manager.hpp @@ -1,18 +1,19 @@ #pragma once #include "base/mutex.hpp" -#include "std/vector.hpp" -#include "std/shared_ptr.hpp" -#include "std/list.hpp" -#include "std/map.hpp" + +#include <vector> +#include <memory> +#include <list> +#include <map> class SharedBufferManager { public: - typedef vector<uint8_t> shared_buffer_t; - typedef shared_ptr<shared_buffer_t> shared_buffer_ptr_t; - typedef list<shared_buffer_ptr_t> shared_buffer_ptr_list_t; - typedef map<size_t, shared_buffer_ptr_list_t> shared_buffers_t; + typedef std::vector<uint8_t> shared_buffer_t; + typedef std::shared_ptr<shared_buffer_t> shared_buffer_ptr_t; + typedef std::list<shared_buffer_ptr_t> shared_buffer_ptr_list_t; + typedef std::map<size_t, shared_buffer_ptr_list_t> shared_buffers_t; private: threads::Mutex m_mutex; diff --git a/base/src_point.cpp b/base/src_point.cpp index 54b8976c18..663054f229 100644 --- a/base/src_point.cpp +++ b/base/src_point.cpp @@ -1,7 +1,7 @@ #include "base/src_point.hpp" -#include "std/algorithm.hpp" -#include "std/sstream.hpp" +#include <algorithm> +#include <sstream> namespace my @@ -15,7 +15,7 @@ void SrcPoint::TruncateFileName() { if (m_fileName[i] == '\\' || m_fileName[i] == '/') { - swap(p[0], p[1]); + std::swap(p[0], p[1]); p[0] = m_fileName + i + 1; } } @@ -24,9 +24,9 @@ void SrcPoint::TruncateFileName() } // namespace my -string DebugPrint(my::SrcPoint const & srcPoint) +std::string DebugPrint(my::SrcPoint const & srcPoint) { - ostringstream out; + std::ostringstream out; if (srcPoint.Line() > 0) out << srcPoint.FileName() << ":" << srcPoint.Line() << " " << srcPoint.Function() << srcPoint.Postfix() << " "; diff --git a/base/src_point.hpp b/base/src_point.hpp index d7552deba3..2d46d0af56 100644 --- a/base/src_point.hpp +++ b/base/src_point.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/string.hpp" +#include <string> #ifndef SRC_LOGGING @@ -63,4 +63,4 @@ namespace my }; } -string DebugPrint(my::SrcPoint const & srcPoint); +std::string DebugPrint(my::SrcPoint const & srcPoint); diff --git a/base/stats.hpp b/base/stats.hpp index 93982659f3..590c296ed4 100644 --- a/base/stats.hpp +++ b/base/stats.hpp @@ -1,8 +1,8 @@ #pragma once #include "base/base.hpp" -#include "std/sstream.hpp" -#include "std/string.hpp" +#include <sstream> +#include <string> namespace my @@ -13,7 +13,7 @@ template <typename T> class NoopStats public: NoopStats() {} inline void operator() (T const &) {} - inline string GetStatsStr() const { return ""; } + inline std::string GetStatsStr() const { return ""; } }; template <typename T> class AverageStats @@ -29,7 +29,7 @@ public: string GetStatsStr() const { - ostringstream out; + std::ostringstream out; out << "N: " << m_Count; if (m_Count > 0) out << " Av: " << m_Sum / m_Count; diff --git a/base/std_serialization.hpp b/base/std_serialization.hpp index b9767d8634..87dc188668 100644 --- a/base/std_serialization.hpp +++ b/base/std_serialization.hpp @@ -2,26 +2,26 @@ #include "base/base.hpp" -#include "std/map.hpp" -#include "std/set.hpp" -#include "std/unordered_map.hpp" -#include "std/vector.hpp" -#include "std/array.hpp" -#include "std/utility.hpp" +#include <array> +#include <map> +#include <set> +#include <unordered_map> +#include <utility> +#include <vector> /// @name std containers serialization /// TArchive should be an archive class in global namespace. //@{ template <class TArchive, class T1, class T2> -TArchive & operator << (TArchive & ar, pair<T1, T2> const & t) +TArchive & operator << (TArchive & ar, std::pair<T1, T2> const & t) { ar << t.first << t.second; return ar; } template <class TArchive, class T1, class T2> -TArchive & operator >> (TArchive & ar, pair<T1, T2> & t) +TArchive & operator >> (TArchive & ar, std::pair<T1, T2> & t) { ar >> t.first >> t.second; return ar; @@ -100,74 +100,74 @@ template <class TArchive, class TCont> void load_like_set(TArchive & ar, TCont & } } -template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, map<T1, T2> const & rMap) +template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, std::map<T1, T2> const & rMap) { save_like_map(ar, rMap); return ar; } -template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, map<T1, T2> & rMap) +template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, std::map<T1, T2> & rMap) { load_like_map(ar, rMap); return ar; } -template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, multimap<T1, T2> const & rMap) +template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, std::multimap<T1, T2> const & rMap) { save_like_map(ar, rMap); return ar; } -template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, multimap<T1, T2> & rMap) +template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, std::multimap<T1, T2> & rMap) { load_like_map(ar, rMap); return ar; } -template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, unordered_map<T1, T2> const & rMap) +template <class TArchive, class T1, class T2> TArchive & operator << (TArchive & ar, std::unordered_map<T1, T2> const & rMap) { save_like_map(ar, rMap); return ar; } -template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, unordered_map<T1, T2> & rMap) +template <class TArchive, class T1, class T2> TArchive & operator >> (TArchive & ar, std::unordered_map<T1, T2> & rMap) { load_like_map(ar, rMap); return ar; } -template <class TArchive, class T> TArchive & operator << (TArchive & ar, vector<T> const & rVector) +template <class TArchive, class T> TArchive & operator << (TArchive & ar, std::vector<T> const & rVector) { save_like_vector(ar, rVector); return ar; } -template <class TArchive, class T> TArchive & operator >> (TArchive & ar, vector<T> & rVector) +template <class TArchive, class T> TArchive & operator >> (TArchive & ar, std::vector<T> & rVector) { load_like_vector(ar, rVector); return ar; } -template <class TArchive, class T> TArchive & operator << (TArchive & ar, set<T> const & rSet) +template <class TArchive, class T> TArchive & operator << (TArchive & ar, std::set<T> const & rSet) { save_like_set(ar, rSet); return ar; } -template <class TArchive, class T> TArchive & operator >> (TArchive & ar, set<T> & rSet) +template <class TArchive, class T> TArchive & operator >> (TArchive & ar, std::set<T> & rSet) { load_like_set(ar, rSet); return ar; } -template <class TArchive, class T, size_t N> TArchive & operator << (TArchive & ar, array<T, N> const & rArray) +template <class TArchive, class T, size_t N> TArchive & operator << (TArchive & ar, std::array<T, N> const & rArray) { for (size_t i = 0; i < N; ++i) ar << rArray[i]; return ar; } -template <class TArchive, class T, size_t N> TArchive & operator >> (TArchive & ar, array<T, N> & rArray) +template <class TArchive, class T, size_t N> TArchive & operator >> (TArchive & ar, std::array<T, N> & rArray) { for (size_t i = 0; i < N; ++i) ar >> rArray[i]; @@ -179,7 +179,7 @@ namespace serial { /// @name This functions invokes overriten do_load for type T with index in array. //@{ - template <class TArchive, class T> void do_load(TArchive & ar, size_t ind, vector<T> & rVector) + template <class TArchive, class T> void do_load(TArchive & ar, size_t ind, std::vector<T> & rVector) { uint32_t count; ar >> count; @@ -189,7 +189,7 @@ namespace serial do_load(ar, ind, rVector[i]); } - template <class TArchive, class T, size_t N> void do_load(TArchive & ar, array<T, N> & rArray) + template <class TArchive, class T, size_t N> void do_load(TArchive & ar, std::array<T, N> & rArray) { for (size_t i = 0; i < N; ++i) do_load(ar, i, rArray[i]); diff --git a/base/stl_add.hpp b/base/stl_add.hpp index 8ccfdffa53..d30c16d2b8 100644 --- a/base/stl_add.hpp +++ b/base/stl_add.hpp @@ -1,7 +1,19 @@ #pragma once -#include "std/functional.hpp" -#include "std/iterator.hpp" -#include "std/algorithm.hpp" + +#include <algorithm> +#include <functional> +#include <iterator> + +namespace my +{ +/// @todo(y): replace this hand-written helper function by +/// std::make_unique when it will be available in C++14 +template <typename T, typename... Args> +std::unique_ptr<T> make_unique(Args &&... args) +{ + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} +} template <class ContainerT> class BackInsertFunctor @@ -80,7 +92,7 @@ IterT RemoveIfKeepValid(IterT beg, IterT end, CompareT comp) { if (!comp(*end)) { - swap(*beg, *end); + std::swap(*beg, *end); ++beg; break; } @@ -96,12 +108,12 @@ IterT RemoveIfKeepValid(IterT beg, IterT end, CompareT comp) template <class IterT> inline bool IsSorted(IterT beg, IterT end) { - return IsSorted(beg, end, less<typename iterator_traits<IterT>::value_type>()); + return IsSorted(beg, end, std::less<typename std::iterator_traits<IterT>::value_type>()); } template <class IterT> inline bool IsSortedAndUnique(IterT beg, IterT end) { - return IsSortedAndUnique(beg, end, less<typename iterator_traits<IterT>::value_type>()); + return IsSortedAndUnique(beg, end, std::less<typename std::iterator_traits<IterT>::value_type>()); } struct DeleteFunctor @@ -186,7 +198,7 @@ template <class IterT1, class IterT2, class InsertIterT> void AccumulateIntervals1With2(IterT1 b1, IterT1 e1, IterT2 b2, IterT2 e2, InsertIterT res) { //typedef typename iterator_traits<InsertIterT>::value_type T; - typedef typename iterator_traits<IterT1>::value_type T; + typedef typename std::iterator_traits<IterT1>::value_type T; T prev; bool validPrev = false; diff --git a/base/stl_helpers.hpp b/base/stl_helpers.hpp index 3a667766de..7f39e39a59 100644 --- a/base/stl_helpers.hpp +++ b/base/stl_helpers.hpp @@ -1,9 +1,9 @@ #pragma once -#include "std/algorithm.hpp" -#include "std/functional.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <functional> +#include <utility> +#include <vector> namespace my { @@ -93,14 +93,14 @@ void SortUnique(Cont & c) template <class Cont, typename Less, typename Equals> void SortUnique(Cont & c, Less && less, Equals && equals) { - sort(c.begin(), c.end(), forward<Less>(less)); - c.erase(unique(c.begin(), c.end(), forward<Equals>(equals)), c.end()); + sort(c.begin(), c.end(), std::forward<Less>(less)); + c.erase(unique(c.begin(), c.end(), std::forward<Equals>(equals)), c.end()); } template <class Cont, class Fn> void EraseIf(Cont & c, Fn && fn) { - c.erase(remove_if(c.begin(), c.end(), forward<Fn>(fn)), c.end()); + c.erase(remove_if(c.begin(), c.end(), std::forward<Fn>(fn)), c.end()); } // Creates a comparer being able to compare two instances of class C diff --git a/base/stl_iterator.hpp b/base/stl_iterator.hpp index 153c6436fa..a409f08b5f 100644 --- a/base/stl_iterator.hpp +++ b/base/stl_iterator.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/iterator_facade.hpp" +#include <boost/iterator/iterator_facade.hpp> namespace detail { @@ -11,7 +11,7 @@ struct Dummy } class CounterIterator : - public iterator_facade<CounterIterator, detail::Dummy, forward_traversal_tag> + public boost::iterator_facade<CounterIterator, detail::Dummy, boost::forward_traversal_tag> { size_t m_count; public: diff --git a/base/string_format.cpp b/base/string_format.cpp index 86a7447743..7f4c7019a1 100644 --- a/base/string_format.cpp +++ b/base/string_format.cpp @@ -1,21 +1,21 @@ #include "base/string_format.hpp" -#include "std/list.hpp" +#include <list> namespace strings { - string const FormatImpl(string const & s, string arr[], size_t count) + std::string const FormatImpl(std::string const & s, std::string arr[], size_t count) { size_t offs = 0; - list<size_t> fieldOffs; + std::list<size_t> fieldOffs; - string res = s; + std::string res = s; while (true) { offs = res.find("^", offs); - if (offs == string::npos) + if (offs == std::string::npos) break; else { @@ -34,7 +34,7 @@ namespace strings offs = 0; size_t i = 0; - for (list<size_t>::const_iterator offsIt = fieldOffs.begin(); + for (std::list<size_t>::const_iterator offsIt = fieldOffs.begin(); (offsIt != fieldOffs.end()) && (i < count); ++offsIt, ++i) { diff --git a/base/string_format.hpp b/base/string_format.hpp index 05875cac48..a5186fcbaa 100644 --- a/base/string_format.hpp +++ b/base/string_format.hpp @@ -2,56 +2,56 @@ #include "base/base.hpp" #include "base/macros.hpp" -#include "std/string.hpp" -#include "std/sstream.hpp" +#include <string> +#include <sstream> namespace strings { template <typename T> - string ToString(T const & t) + std::string ToString(T const & t) { // May be we should use DebugPrint here. Not sure. - ostringstream out; + std::ostringstream out; out << t; return out.str(); } - string const FormatImpl(string const & s, string arr[], size_t count); + std::string const FormatImpl(std::string const & s, std::string arr[], size_t count); template <typename T1> - string const Format(string const & s, T1 const & t1) + std::string const Format(std::string const & s, T1 const & t1) { - string arr[] = { ToString(t1) }; + std::string arr[] = { ToString(t1) }; return FormatImpl(s, arr, ARRAY_SIZE(arr)); } template <typename T1, typename T2> - string const Format(string const & s, T1 const & t1, T2 const & t2) + std::string const Format(std::string const & s, T1 const & t1, T2 const & t2) { - string arr[] = { ToString(t1), ToString(t2) }; + std::string arr[] = { ToString(t1), ToString(t2) }; return FormatImpl(s, arr, ARRAY_SIZE(arr)); } template <typename T1, typename T2, typename T3> - string const Format(string const & s, T1 const & t1, T2 const & t2, T3 const & t3) + std::string const Format(std::string const & s, T1 const & t1, T2 const & t2, T3 const & t3) { - string arr[] = { ToString(t1), ToString(t2), ToString(t3) }; + std::string arr[] = { ToString(t1), ToString(t2), ToString(t3) }; return FormatImpl(s, arr, ARRAY_SIZE(arr)); } template <typename T1, typename T2, typename T3, typename T4> - string const Format(string const & s, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4) + std::string const Format(std::string const & s, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4) { - string arr[] = { ToString(t1), ToString(t2), ToString(t3), ToString(t4) }; + std::string arr[] = { ToString(t1), ToString(t2), ToString(t3), ToString(t4) }; return FormatImpl(s, arr, ARRAY_SIZE(arr)); } template <typename T1, typename T2, typename T3, typename T4, typename T5> - string const Format(string const & s, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5) + std::string const Format(std::string const & s, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5) { - string arr[] = { ToString(t1), ToString(t2), ToString(t3), ToString(t4), ToString(t5) }; + std::string arr[] = { ToString(t1), ToString(t2), ToString(t3), ToString(t4), ToString(t5) }; return FormatImpl(s, arr, ARRAY_SIZE(arr)); } } diff --git a/base/string_utils.cpp b/base/string_utils.cpp index 67eed2cb12..6379deab9e 100644 --- a/base/string_utils.cpp +++ b/base/string_utils.cpp @@ -1,25 +1,26 @@ #include "base/assert.hpp" #include "base/string_utils.hpp" -#include "std/algorithm.hpp" -#include "std/cmath.hpp" -#include "std/iomanip.hpp" -#include "std/iterator.hpp" #include "std/target_os.hpp" +#include <algorithm> +#include <cmath> +#include <iomanip> +#include <iterator> + #include <boost/algorithm/string/trim.hpp> namespace strings { bool UniString::IsEqualAscii(char const * s) const { - return (size() == strlen(s) && equal(begin(), end(), s)); + return (size() == strlen(s) && std::equal(begin(), end(), s)); } SimpleDelimiter::SimpleDelimiter(char const * delims) { - string const s(delims); - string::const_iterator it = s.begin(); + std::string const s(delims); + std::string::const_iterator it = s.begin(); while (it != s.end()) m_delims.push_back(utf8::unchecked::next(it)); } @@ -31,14 +32,14 @@ SimpleDelimiter::SimpleDelimiter(char delim) bool SimpleDelimiter::operator()(UniChar c) const { - return find(m_delims.begin(), m_delims.end(), c) != m_delims.end(); + return std::find(m_delims.begin(), m_delims.end(), c) != m_delims.end(); } -UniChar LastUniChar(string const & s) +UniChar LastUniChar(std::string const & s) { if (s.empty()) return 0; - utf8::unchecked::iterator<string::const_iterator> iter(s.end()); + utf8::unchecked::iterator<std::string::const_iterator> iter(s.end()); --iter; return *iter; } @@ -117,18 +118,18 @@ UniString MakeLowerCase(UniString const & s) return result; } -void MakeLowerCaseInplace(string & s) +void MakeLowerCaseInplace(std::string & s) { UniString uniStr; - utf8::unchecked::utf8to32(s.begin(), s.end(), back_inserter(uniStr)); + utf8::unchecked::utf8to32(s.begin(), s.end(), std::back_inserter(uniStr)); MakeLowerCaseInplace(uniStr); s.clear(); utf8::unchecked::utf32to8(uniStr.begin(), uniStr.end(), back_inserter(s)); } -string MakeLowerCase(string const & s) +std::string MakeLowerCase(std::string const & s) { - string result(s); + std::string result(s); MakeLowerCaseInplace(result); return result; } @@ -140,7 +141,7 @@ UniString Normalize(UniString const & s) return result; } -void NormalizeDigits(string & utf8) +void NormalizeDigits(std::string & utf8) { size_t const n = utf8.size(); size_t const m = n >= 2 ? n - 2 : 0; @@ -204,29 +205,29 @@ char ascii_to_lower(char in) } } -void AsciiToLower(string & s) { transform(s.begin(), s.end(), s.begin(), &ascii_to_lower); } -void Trim(string & s) { boost::trim(s); } -void Trim(string & s, char const * anyOf) { boost::trim_if(s, boost::is_any_of(anyOf)); } -bool EqualNoCase(string const & s1, string const & s2) +void AsciiToLower(std::string & s) { transform(s.begin(), s.end(), s.begin(), &ascii_to_lower); } +void Trim(std::string & s) { boost::trim(s); } +void Trim(std::string & s, char const * anyOf) { boost::trim_if(s, boost::is_any_of(anyOf)); } +bool EqualNoCase(std::string const & s1, std::string const & s2) { return MakeLowerCase(s1) == MakeLowerCase(s2); } -UniString MakeUniString(string const & utf8s) +UniString MakeUniString(std::string const & utf8s) { UniString result; - utf8::unchecked::utf8to32(utf8s.begin(), utf8s.end(), back_inserter(result)); + utf8::unchecked::utf8to32(utf8s.begin(), utf8s.end(), std::back_inserter(result)); return result; } -string ToUtf8(UniString const & s) +std::string ToUtf8(UniString const & s) { - string result; + std::string result; utf8::unchecked::utf32to8(s.begin(), s.end(), back_inserter(result)); return result; } -bool IsASCIIString(string const & str) +bool IsASCIIString(std::string const & str) { for (size_t i = 0; i < str.size(); ++i) if (str[i] & 0x80) @@ -248,8 +249,8 @@ bool StartsWith(UniString const & s, UniString const & p) return true; } -bool StartsWith(string const & s1, char const * s2) { return (s1.compare(0, strlen(s2), s2) == 0); } -bool EndsWith(string const & s1, char const * s2) +bool StartsWith(std::string const & s1, char const * s2) { return (s1.compare(0, strlen(s2), s2) == 0); } +bool EndsWith(std::string const & s1, char const * s2) { size_t const n = s1.size(); size_t const m = strlen(s2); @@ -258,29 +259,29 @@ bool EndsWith(string const & s1, char const * s2) return (s1.compare(n - m, m, s2) == 0); } -bool EndsWith(string const & s1, string const & s2) +bool EndsWith(std::string const & s1, std::string const & s2) { return s1.size() >= s2.size() && s1.compare(s1.size() - s2.size(), s2.size(), s2) == 0; } -string to_string_dac(double d, int dac) +std::string to_string_dac(double d, int dac) { - dac = min(numeric_limits<double>::digits10, dac); + dac = std::min(std::numeric_limits<double>::digits10, dac); - ostringstream ss; + std::ostringstream ss; if (d < 1. && d > -1.) { - string res; + std::string res; if (d >= 0.) { - ss << setprecision(dac + 1) << d + 1; + ss << std::setprecision(dac + 1) << d + 1; res = ss.str(); res[0] = '0'; } else { - ss << setprecision(dac + 1) << d - 1; + ss << std::setprecision(dac + 1) << d - 1; res = ss.str(); res[1] = '0'; } @@ -289,19 +290,19 @@ string to_string_dac(double d, int dac) // Calc digits before comma (log10). double fD = fabs(d); - while (fD >= 1.0 && dac < numeric_limits<double>::digits10) + while (fD >= 1.0 && dac < std::numeric_limits<double>::digits10) { fD /= 10.0; ++dac; } - ss << setprecision(dac) << d; + ss << std::setprecision(dac) << d; return ss.str(); } -bool IsHTML(string const & utf8) +bool IsHTML(std::string const & utf8) { - string::const_iterator it = utf8.begin(); + std::string::const_iterator it = utf8.begin(); size_t ltCount = 0; size_t gtCount = 0; while (it != utf8.end()) @@ -315,15 +316,15 @@ bool IsHTML(string const & utf8) return (ltCount > 0 && gtCount > 0); } -bool AlmostEqual(string const & str1, string const & str2, size_t mismatchedCount) +bool AlmostEqual(std::string const & str1, std::string const & str2, size_t mismatchedCount) { - pair<string::const_iterator, string::const_iterator> mis(str1.begin(), str2.begin()); + std::pair<std::string::const_iterator, std::string::const_iterator> mis(str1.begin(), str2.begin()); auto const str1End = str1.end(); auto const str2End = str2.end(); for (size_t i = 0; i <= mismatchedCount; ++i) { - auto const end = mis.first + min(distance(mis.first, str1End), distance(mis.second, str2End)); + auto const end = mis.first + std::min(distance(mis.first, str1End), distance(mis.second, str2End)); mis = mismatch(mis.first, end, mis.second); if (mis.first == str1End && mis.second == str2End) return true; @@ -335,13 +336,13 @@ bool AlmostEqual(string const & str1, string const & str2, size_t mismatchedCoun return false; } -void ParseCSVRow(string const & s, char const delimiter, vector<string> & target) +void ParseCSVRow(std::string const & s, char const delimiter, std::vector<std::string> & target) { target.clear(); - using It = TokenizeIterator<SimpleDelimiter, string::const_iterator, true>; + using It = TokenizeIterator<SimpleDelimiter, std::string::const_iterator, true>; for (It it(s, SimpleDelimiter(delimiter)); it; ++it) { - string column = *it; + std::string column = *it; strings::Trim(column); target.push_back(move(column)); } diff --git a/base/string_utils.hpp b/base/string_utils.hpp index 8a9c925ef4..af8670c5a4 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -3,14 +3,14 @@ #include "base/buffer_vector.hpp" #include "base/stl_add.hpp" -#include "std/algorithm.hpp" -#include "std/cstdint.hpp" -#include "std/iterator.hpp" -#include "std/limits.hpp" -#include "std/regex.hpp" -#include "std/sstream.hpp" -#include "std/string.hpp" -#include "std/type_traits.hpp" +#include <algorithm> +#include <cstdint> +#include <iterator> +#include <limits> +#include <regex> +#include <sstream> +#include <string> +#include <type_traits> #include "3party/utfcpp/source/utf8/unchecked.h" @@ -63,7 +63,7 @@ void NormalizeInplace(UniString & s); UniString Normalize(UniString const & s); /// Replaces "full width" unicode digits with ascii ones. -void NormalizeDigits(string & utf8); +void NormalizeDigits(std::string & utf8); void NormalizeDigits(UniString & us); /// Counts number of start symbols in string s (that is not lower and not normalized) that maches @@ -72,37 +72,37 @@ void NormalizeDigits(UniString & us); /// For implementation @see base/lower_case.cpp size_t CountNormLowerSymbols(UniString const & s, UniString const & lowStr); -void AsciiToLower(string & s); +void AsciiToLower(std::string & s); // TODO(AlexZ): current boost impl uses default std::locale() to trim. // In general, it does not work for any unicode whitespace except ASCII U+0020 one. -void Trim(string & s); +void Trim(std::string & s); /// Remove any characters that contain in "anyOf" on left and right side of string s -void Trim(string & s, char const * anyOf); +void Trim(std::string & s, char const * anyOf); -void MakeLowerCaseInplace(string & s); -string MakeLowerCase(string const & s); -bool EqualNoCase(string const & s1, string const & s2); +void MakeLowerCaseInplace(std::string & s); +std::string MakeLowerCase(std::string const & s); +bool EqualNoCase(std::string const & s1, std::string const & s2); -UniString MakeUniString(string const & utf8s); -string ToUtf8(UniString const & s); -bool IsASCIIString(string const & str); +UniString MakeUniString(std::string const & utf8s); +std::string ToUtf8(UniString const & s); +bool IsASCIIString(std::string const & str); bool IsASCIIDigit(UniChar c); bool IsASCIILatin(UniChar c); -inline string DebugPrint(UniString const & s) { return ToUtf8(s); } +inline std::string DebugPrint(UniString const & s) { return ToUtf8(s); } template <typename TDelimFn, typename TIt = UniString::const_iterator, bool KeepEmptyTokens = false> class TokenizeIterator { public: using difference_type = std::ptrdiff_t; - using value_type = string; + using value_type = std::string; using pointer = void; - using reference = string; + using reference = std::string; using iterator_category = std::input_iterator_tag; // *NOTE* |s| must be not temporary! - TokenizeIterator(string const & s, TDelimFn const & delimFn) + TokenizeIterator(std::string const & s, TDelimFn const & delimFn) : m_start(s.begin()), m_end(s.begin()), m_finish(s.end()), m_delimFn(delimFn) { Move(); @@ -115,10 +115,10 @@ public: Move(); } - string operator*() const + std::string operator*() const { ASSERT(m_start != m_finish, ("Dereferencing of empty iterator.")); - return string(m_start.base(), m_end.base()); + return std::string(m_start.base(), m_end.base()); } UniString GetUniString() const @@ -181,13 +181,13 @@ class TokenizeIterator<TDelimFn, TIt, true /* KeepEmptyTokens */> { public: using difference_type = std::ptrdiff_t; - using value_type = string; + using value_type = std::string; using pointer = void; - using reference = string; + using reference = std::string; using iterator_category = std::input_iterator_tag; // *NOTE* |s| must be not temporary! - TokenizeIterator(string const & s, TDelimFn const & delimFn) + TokenizeIterator(std::string const & s, TDelimFn const & delimFn) : m_start(s.begin()), m_end(s.begin()), m_finish(s.end()), m_delimFn(delimFn), m_finished(false) { while (m_end != m_finish && !m_delimFn(*m_end)) @@ -202,10 +202,10 @@ public: ++m_end; } - string operator*() const + std::string operator*() const { ASSERT(!m_finished, ("Dereferencing of empty iterator.")); - return string(m_start.base(), m_end.base()); + return std::string(m_start.base(), m_end.base()); } UniString GetUniString() const @@ -291,14 +291,14 @@ public: }; using SimpleTokenizer = - TokenizeIterator<SimpleDelimiter, ::utf8::unchecked::iterator<string::const_iterator>, + TokenizeIterator<SimpleDelimiter, ::utf8::unchecked::iterator<std::string::const_iterator>, false /* KeepEmptyTokens */>; using SimpleTokenizerWithEmptyTokens = - TokenizeIterator<SimpleDelimiter, ::utf8::unchecked::iterator<string::const_iterator>, + TokenizeIterator<SimpleDelimiter, ::utf8::unchecked::iterator<std::string::const_iterator>, true /* KeepEmptyTokens */>; template <typename TFunctor> -void Tokenize(string const & str, char const * delims, TFunctor && f) +void Tokenize(std::string const & str, char const * delims, TFunctor && f) { SimpleTokenizer iter(str, delims); while (iter) @@ -308,23 +308,23 @@ void Tokenize(string const & str, char const * delims, TFunctor && f) } } -template <template <typename ...> class Collection = vector> -Collection<string> Tokenize(string const & str, char const * delims) +template <template <typename ...> class Collection = std::vector> +Collection<std::string> Tokenize(std::string const & str, char const * delims) { - Collection<string> c; + Collection<std::string> c; Tokenize(str, delims, MakeInsertFunctor(c)); return c; } -static_assert(is_same<vector<string>, decltype(strings::Tokenize("", ""))>::value, +static_assert(std::is_same<std::vector<std::string>, decltype(strings::Tokenize("", ""))>::value, "Tokenize() should return vector<string> by default."); /// Splits a string by the delimiter, keeps empty parts, on an empty string returns an empty vector. /// Does not support quoted columns, newlines in columns and escaped quotes. -void ParseCSVRow(string const & s, char const delimiter, vector<string> & target); +void ParseCSVRow(std::string const & s, char const delimiter, std::vector<std::string> & target); /// @return code of last symbol in string or 0 if s is empty -UniChar LastUniChar(string const & s); +UniChar LastUniChar(std::string const & s); template <class T, size_t N, class TT> bool IsInArray(T(&arr)[N], TT const & t) @@ -344,31 +344,31 @@ bool to_int64(char const * s, int64_t & i); bool to_float(char const * s, float & f); bool to_double(char const * s, double & d); -inline bool is_number(string const & s) +inline bool is_number(std::string const & s) { int64_t dummy; return to_int64(s.c_str(), dummy); } -inline bool to_int(string const & s, int & i, int base = 10) { return to_int(s.c_str(), i, base); } -inline bool to_uint(string const & s, unsigned int & i, int base = 10) +inline bool to_int(std::string const & s, int & i, int base = 10) { return to_int(s.c_str(), i, base); } +inline bool to_uint(std::string const & s, unsigned int & i, int base = 10) { return to_uint(s.c_str(), i, base); } -inline bool to_uint64(string const & s, uint64_t & i) { return to_uint64(s.c_str(), i); } -inline bool to_int64(string const & s, int64_t & i) { return to_int64(s.c_str(), i); } -inline bool to_float(string const & s, float & f) { return to_float(s.c_str(), f); } -inline bool to_double(string const & s, double & d) { return to_double(s.c_str(), d); } +inline bool to_uint64(std::string const & s, uint64_t & i) { return to_uint64(s.c_str(), i); } +inline bool to_int64(std::string const & s, int64_t & i) { return to_int64(s.c_str(), i); } +inline bool to_float(std::string const & s, float & f) { return to_float(s.c_str(), f); } +inline bool to_double(std::string const & s, double & d) { return to_double(s.c_str(), d); } //@} /// @name From numeric to string. //@{ -inline string to_string(string const & s) { return s; } -inline string to_string(char const * s) { return s; } +inline std::string to_string(std::string const & s) { return s; } +inline std::string to_string(char const * s) { return s; } template <typename T> -string to_string(T t) +std::string to_string(T t) { - ostringstream ss; + std::ostringstream ss; ss << t; return ss.str(); } @@ -389,7 +389,7 @@ int UpperBoundOnChars() // // NOTE: following code works only on two-complement systems! - return numeric_limits<T>::digits10 + is_signed<T>::value + 1; + return std::numeric_limits<T>::digits10 + std::is_signed<T>::value + 1; } template <typename T> @@ -405,7 +405,7 @@ char * to_string_digits(char * buf, T i) } template <typename T> -string to_string_signed(T i) +std::string to_string_signed(T i) { bool const negative = i < 0; int const sz = UpperBoundOnChars<T>(); @@ -417,41 +417,41 @@ string to_string_signed(T i) --beg; *beg = '-'; } - return string(beg, end - beg); + return std::string(beg, end - beg); } template <typename T> -string to_string_unsigned(T i) +std::string to_string_unsigned(T i) { int const sz = UpperBoundOnChars<T>(); char buf[sz]; char * end = buf + sz; char * beg = to_string_digits(end, i); - return string(beg, end - beg); + return std::string(beg, end - beg); } } -inline string to_string(int64_t i) { return impl::to_string_signed(i); } -inline string to_string(uint64_t i) { return impl::to_string_unsigned(i); } +inline std::string to_string(int64_t i) { return impl::to_string_signed(i); } +inline std::string to_string(uint64_t i) { return impl::to_string_unsigned(i); } /// Use this function to get string with fixed count of /// "Digits after comma". -string to_string_dac(double d, int dac); -inline string to_string_with_digits_after_comma(double d, int dac) { return to_string_dac(d, dac); } +std::string to_string_dac(double d, int dac); +inline std::string to_string_with_digits_after_comma(double d, int dac) { return to_string_dac(d, dac); } //@} bool StartsWith(UniString const & s, UniString const & p); -bool StartsWith(string const & s1, char const * s2); +bool StartsWith(std::string const & s1, char const * s2); -bool EndsWith(string const & s1, char const * s2); +bool EndsWith(std::string const & s1, char const * s2); -bool EndsWith(string const & s1, string const & s2); +bool EndsWith(std::string const & s1, std::string const & s2); /// Try to guess if it's HTML or not. No guarantee. -bool IsHTML(string const & utf8); +bool IsHTML(std::string const & utf8); /// Compare str1 and str2 and return if they are equal except for mismatchedSymbolsNum symbols -bool AlmostEqual(string const & str1, string const & str2, size_t mismatchedCount); +bool AlmostEqual(std::string const & str1, std::string const & str2, size_t mismatchedCount); template <typename TIterator, typename TDelimiter> typename TIterator::value_type JoinStrings(TIterator begin, TIterator end, @@ -478,9 +478,9 @@ typename TContainer::value_type JoinStrings(TContainer const & container, } template <typename TFn> -void ForEachMatched(string const & s, regex const & regex, TFn && fn) +void ForEachMatched(std::string const & s, std::regex const & regex, TFn && fn) { - for (sregex_token_iterator cur(s.begin(), s.end(), regex), end; cur != end; ++cur) + for (std::sregex_token_iterator cur(s.begin(), s.end(), regex), end; cur != end; ++cur) fn(*cur); } @@ -496,16 +496,16 @@ void ForEachMatched(string const & s, regex const & regex, TFn && fn) template <typename TIter> size_t EditDistance(TIter const & b1, TIter const & e1, TIter const & b2, TIter const & e2) { - size_t const n = distance(b1, e1); - size_t const m = distance(b2, e2); + size_t const n = std::distance(b1, e1); + size_t const m = std::distance(b2, e2); if (m > n) return EditDistance(b2, e2, b1, e1); // |curr| and |prev| are current and previous rows of the // dynamic programming table. - vector<size_t> prev(m + 1); - vector<size_t> curr(m + 1); + std::vector<size_t> prev(m + 1); + std::vector<size_t> curr(m + 1); for (size_t j = 0; j <= m; ++j) prev[j] = j; auto it1 = b1; @@ -519,8 +519,8 @@ size_t EditDistance(TIter const & b1, TIter const & e1, TIter const & b2, TIter { auto const & c2 = *it2; - curr[j] = min(curr[j - 1], prev[j]) + 1; - curr[j] = min(curr[j], prev[j - 1] + (c1 == c2 ? 0 : 1)); + curr[j] = std::min(curr[j - 1], prev[j]) + 1; + curr[j] = std::min(curr[j], prev[j - 1] + (c1 == c2 ? 0 : 1)); } prev.swap(curr); } diff --git a/base/strings_bundle.cpp b/base/strings_bundle.cpp index fcfdecb7a8..07fa30ed66 100644 --- a/base/strings_bundle.cpp +++ b/base/strings_bundle.cpp @@ -1,17 +1,17 @@ #include "base/strings_bundle.hpp" -void StringsBundle::SetDefaultString(string const & name, string const & value) +void StringsBundle::SetDefaultString(std::string const & name, std::string const & value) { m_defValues[name] = value; } -void StringsBundle::SetString(string const & name, string const & value) +void StringsBundle::SetString(std::string const & name, std::string const & value) { m_values[name] = value; } -string const StringsBundle::GetString(string const & name) const +std::string const StringsBundle::GetString(std::string const & name) const { TStringMap::const_iterator it = m_values.find(name); if (it != m_values.end()) diff --git a/base/strings_bundle.hpp b/base/strings_bundle.hpp index 5fc90eca04..8cc407bc0b 100644 --- a/base/strings_bundle.hpp +++ b/base/strings_bundle.hpp @@ -1,17 +1,17 @@ #pragma once -#include "std/string.hpp" -#include "std/map.hpp" +#include <string> +#include <map> class StringsBundle { - typedef map<string, string> TStringMap; + using TStringMap = std::map<std::string, std::string>; TStringMap m_values; TStringMap m_defValues; public: - void SetDefaultString(string const & name, string const & value); - void SetString(string const & name, string const & value); - string const GetString(string const & name) const; + void SetDefaultString(std::string const & name, std::string const & value); + void SetString(std::string const & name, std::string const & value); + std::string const GetString(std::string const & name) const; }; diff --git a/base/sunrise_sunset.cpp b/base/sunrise_sunset.cpp index 16e11dd03a..3d8356caae 100644 --- a/base/sunrise_sunset.cpp +++ b/base/sunrise_sunset.cpp @@ -83,7 +83,7 @@ enum class DayEventType // This function was taken from source http://williams.best.vwh.net/sunrise_sunset_algorithm.htm. // Notation is kept to have source close to source. // Original article is // http://babel.hathitrust.org/cgi/pt?id=uiug.30112059294311;view=1up;seq=25 -pair<DayEventType, time_t> CalculateDayEventTime(time_t timeUtc, +std::pair<DayEventType, time_t> CalculateDayEventTime(time_t timeUtc, double latitude, double longitude, bool sunrise) { @@ -155,7 +155,7 @@ pair<DayEventType, time_t> CalculateDayEventTime(time_t timeUtc, int const m = sunrise ? 0 : 59; int const s = sunrise ? 0 : 59; - return make_pair((cosH < -1) ? DayEventType::PolarDay : DayEventType::PolarNight, + return std::make_pair((cosH < -1) ? DayEventType::PolarDay : DayEventType::PolarNight, base::TimeGM(year, month, day, h, m, s)); } @@ -199,7 +199,7 @@ pair<DayEventType, time_t> CalculateDayEventTime(time_t timeUtc, int const m = floor((UT - h) * 60); // [0;60) int const s = fmod(floor(UT * 60 * 60) /* number of seconds from 0:0 to UT */, 60); // [0;60) - return make_pair(sunrise ? DayEventType::Sunrise : DayEventType::Sunset, + return std::make_pair(sunrise ? DayEventType::Sunrise : DayEventType::Sunset, base::TimeGM(year, month, day, h, m, s)); } @@ -242,7 +242,7 @@ DayTimeType GetDayTime(time_t timeUtc, double latitude, double longitude) return DayTimeType::Day; } -string DebugPrint(DayTimeType type) +std::string DebugPrint(DayTimeType type) { switch (type) { @@ -251,5 +251,5 @@ string DebugPrint(DayTimeType type) case DayTimeType::PolarDay: return "PolarDay"; case DayTimeType::PolarNight: return "PolarNight"; } - return string(); + return std::string(); } diff --git a/base/sunrise_sunset.hpp b/base/sunrise_sunset.hpp index 110c9c4151..f748505a64 100644 --- a/base/sunrise_sunset.hpp +++ b/base/sunrise_sunset.hpp @@ -1,7 +1,7 @@ #pragma once -#include "std/ctime.hpp" -#include "std/string.hpp" +#include <ctime> +#include <string> enum class DayTimeType { @@ -11,7 +11,7 @@ enum class DayTimeType PolarNight }; -string DebugPrint(DayTimeType type); +std::string DebugPrint(DayTimeType type); /// Helpers which calculates 'is day time' without a time calculation error. /// @param timeUtc - utc time diff --git a/base/swap.hpp b/base/swap.hpp deleted file mode 100644 index 6d817e3ff6..0000000000 --- a/base/swap.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "std/algorithm.hpp" - -// Calls swap() function using argument dependant lookup. -// Do NOT override this function, but override swap() function instead! -template <typename T> inline void Swap(T & a, T & b) -{ - using std::swap; - swap(a, b); -} diff --git a/base/thread.cpp b/base/thread.cpp index 2c3bc913e8..6b94df4ce5 100644 --- a/base/thread.cpp +++ b/base/thread.cpp @@ -2,8 +2,8 @@ #include "base/logging.hpp" -#include "std/chrono.hpp" -#include "std/exception.hpp" +#include <chrono> +#include <exception> #if defined(OMIM_OS_ANDROID) void AndroidThreadAttachToJVM(); @@ -15,7 +15,7 @@ namespace threads namespace { /// Prepares worker thread and runs routine. -void RunRoutine(shared_ptr<IRoutine> routine) +void RunRoutine(std::shared_ptr<IRoutine> routine) { #if defined(OMIM_OS_ANDROID) AndroidThreadAttachToJVM(); @@ -47,16 +47,16 @@ Thread::~Thread() m_thread.detach(); } -bool Thread::Create(unique_ptr<IRoutine> && routine) +bool Thread::Create(std::unique_ptr<IRoutine> && routine) { ASSERT(!m_routine, ("Current implementation doesn't allow to reuse thread")); - thread routineThread; + std::thread routineThread; try { m_routine.reset(routine.release()); - routineThread = thread(&RunRoutine, m_routine); + routineThread = std::thread(&RunRoutine, m_routine); } - catch (exception & e) + catch (std::exception & e) { LOG(LERROR, ("Thread creation failed with error:", e.what())); m_routine.reset(); @@ -88,7 +88,7 @@ IRoutine * Thread::GetRoutine() { return m_routine.get(); } SimpleThreadPool::SimpleThreadPool(size_t reserve) { m_pool.reserve(reserve); } -void SimpleThreadPool::Add(unique_ptr<IRoutine> && routine) +void SimpleThreadPool::Add(std::unique_ptr<IRoutine> && routine) { m_pool.emplace_back(new Thread()); m_pool.back()->Create(move(routine)); @@ -102,14 +102,14 @@ void SimpleThreadPool::Join() IRoutine * SimpleThreadPool::GetRoutine(size_t i) const { return m_pool[i]->GetRoutine(); } -void Sleep(size_t ms) { this_thread::sleep_for(milliseconds(ms)); } +void Sleep(size_t ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); } -ThreadID GetCurrentThreadID() { return this_thread::get_id(); } +ThreadID GetCurrentThreadID() { return std::this_thread::get_id(); } ///////////////////////////////////////////////////////////////////// // SimpleThread implementation -void SimpleThread::ThreadFunc(function<void()> && fn) +void SimpleThread::ThreadFunc(std::function<void()> && fn) { #if defined(OMIM_OS_ANDROID) AndroidThreadAttachToJVM(); diff --git a/base/thread.hpp b/base/thread.hpp index c5bc84bcd5..88eb7cdf20 100644 --- a/base/thread.hpp +++ b/base/thread.hpp @@ -4,16 +4,16 @@ #include "base/cancellable.hpp" #include "base/macros.hpp" -#include "std/bind.hpp" -#include "std/cstdint.hpp" -#include "std/function.hpp" -#include "std/noncopyable.hpp" -#include "std/shared_ptr.hpp" #include "std/target_os.hpp" -#include "std/thread.hpp" -#include "std/unique_ptr.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" + +#include <cstdint> +#include <functional> +#include <memory> +#include <thread> +#include <utility> +#include <vector> + +#include <boost/noncopyable.hpp> #ifdef OMIM_OS_WINDOWS #include "std/windows.hpp" // for DWORD @@ -37,8 +37,8 @@ public: /// IRoutine. class Thread { - thread m_thread; - shared_ptr<IRoutine> m_routine; + std::thread m_thread; + std::shared_ptr<IRoutine> m_routine; DISALLOW_COPY(Thread); @@ -52,7 +52,7 @@ public: /// destroyed by the current Thread instance or by /// the m_thread, if it is detached during the /// execution of routine. - bool Create(unique_ptr<IRoutine> && routine); + bool Create(std::unique_ptr<IRoutine> && routine); /// Calling the IRoutine::Cancel method, and Join'ing with the task /// execution. After that, routine is deleted. @@ -78,14 +78,14 @@ public: }; /// Simple threads container. Takes ownership for every added IRoutine. -class SimpleThreadPool : public noncopyable +class SimpleThreadPool : public boost::noncopyable { - vector<unique_ptr<Thread>> m_pool; + std::vector<std::unique_ptr<Thread>> m_pool; public: SimpleThreadPool(size_t reserve = 0); - void Add(unique_ptr<IRoutine> && routine); + void Add(std::unique_ptr<IRoutine> && routine); void Join(); IRoutine * GetRoutine(size_t i) const; @@ -95,7 +95,7 @@ public: /// @param[in] ms time-out interval in milliseconds void Sleep(size_t ms); -typedef thread::id ThreadID; +using ThreadID = std::thread::id; ThreadID GetCurrentThreadID(); @@ -104,8 +104,8 @@ ThreadID GetCurrentThreadID(); class SimpleThread { public: - using id = thread::id; - using native_handle_type = thread::native_handle_type; + using id = std::thread::id; + using native_handle_type = std::thread::native_handle_type; SimpleThread() noexcept {} SimpleThread(SimpleThread && x) noexcept @@ -114,7 +114,7 @@ public: template <class Fn, class... Args> explicit SimpleThread(Fn && fn, Args &&... args) - : m_thread(&SimpleThread::ThreadFunc, bind(forward<Fn>(fn), forward<Args>(args)...)) + : m_thread(&SimpleThread::ThreadFunc, std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...)) {} SimpleThread & operator= (SimpleThread && x) noexcept @@ -131,10 +131,10 @@ public: void swap(SimpleThread & x) noexcept { m_thread.swap(x.m_thread); } private: - static void ThreadFunc(function<void()> && fn); + static void ThreadFunc(std::function<void()> && fn); DISALLOW_COPY(SimpleThread); - thread m_thread; + std::thread m_thread; }; } // namespace threads diff --git a/base/thread_checker.cpp b/base/thread_checker.cpp index 0a6ea92444..84688b19b8 100644 --- a/base/thread_checker.cpp +++ b/base/thread_checker.cpp @@ -1,5 +1,5 @@ #include "base/thread_checker.hpp" -ThreadChecker::ThreadChecker() : m_id(this_thread::get_id()) {} +ThreadChecker::ThreadChecker() : m_id(std::this_thread::get_id()) {} -bool ThreadChecker::CalledOnOriginalThread() const { return this_thread::get_id() == m_id; } +bool ThreadChecker::CalledOnOriginalThread() const { return std::this_thread::get_id() == m_id; } diff --git a/base/thread_checker.hpp b/base/thread_checker.hpp index e5f44b7486..c4592016ad 100644 --- a/base/thread_checker.hpp +++ b/base/thread_checker.hpp @@ -3,7 +3,7 @@ #include "base/assert.hpp" #include "base/macros.hpp" -#include "std/thread.hpp" +#include <thread> /// This class remembers id of a thread on which it was created, and /// then can be used to verify that CalledOnOriginalThread() is called @@ -18,7 +18,7 @@ public: bool CalledOnOriginalThread() const; private: - thread::id const m_id; + std::thread::id const m_id; DISALLOW_COPY_AND_MOVE(ThreadChecker); }; diff --git a/base/thread_pool.cpp b/base/thread_pool.cpp index 626061fd2b..99952809f0 100644 --- a/base/thread_pool.cpp +++ b/base/thread_pool.cpp @@ -1,17 +1,18 @@ #include "base/thread_pool.hpp" +#include "base/stl_add.hpp" #include "base/thread.hpp" #include "base/threaded_list.hpp" -#include "std/vector.hpp" -#include "std/utility.hpp" -#include "std/bind.hpp" +#include <functional> +#include <utility> +#include <vector> namespace threads { namespace { - typedef function<threads::IRoutine *()> TPopRoutineFn; + typedef std::function<threads::IRoutine *()> TPopRoutineFn; class PoolRoutine : public IRoutine { @@ -53,7 +54,7 @@ namespace threads for (auto & thread : m_threads) { thread.reset(new threads::Thread()); - thread->Create(make_unique<PoolRoutine>(bind(&ThreadPool::Impl::PopFront, this), m_finishFn)); + thread->Create(my::make_unique<PoolRoutine>(std::bind(&ThreadPool::Impl::PopFront, this), m_finishFn)); } } @@ -85,7 +86,7 @@ namespace threads thread->Cancel(); m_threads.clear(); - m_tasks.ProcessList([this](list<threads::IRoutine *> & tasks) + m_tasks.ProcessList([this](std::list<threads::IRoutine *> & tasks) { FinishTasksOnStop(tasks); }); @@ -93,9 +94,9 @@ namespace threads } private: - void FinishTasksOnStop(list<threads::IRoutine *> & tasks) + void FinishTasksOnStop(std::list<threads::IRoutine *> & tasks) { - typedef list<threads::IRoutine *>::iterator task_iter; + typedef std::list<threads::IRoutine *>::iterator task_iter; for (task_iter it = tasks.begin(); it != tasks.end(); ++it) { (*it)->Cancel(); @@ -107,7 +108,7 @@ namespace threads ThreadedList<threads::IRoutine *> m_tasks; TFinishRoutineFn m_finishFn; - vector<unique_ptr<threads::Thread>> m_threads; + std::vector<std::unique_ptr<threads::Thread>> m_threads; }; ThreadPool::ThreadPool(size_t size, const TFinishRoutineFn & finishFn) diff --git a/base/thread_pool.hpp b/base/thread_pool.hpp index 292799b42b..ddd664ae28 100644 --- a/base/thread_pool.hpp +++ b/base/thread_pool.hpp @@ -2,13 +2,13 @@ #include "base/base.hpp" -#include "std/function.hpp" +#include <functional> namespace threads { class IRoutine; - typedef function<void(threads::IRoutine *)> TFinishRoutineFn; + typedef std::function<void(threads::IRoutine *)> TFinishRoutineFn; class ThreadPool { diff --git a/base/threaded_list.hpp b/base/threaded_list.hpp index ee9e5d72e5..4390ed1f6a 100644 --- a/base/threaded_list.hpp +++ b/base/threaded_list.hpp @@ -1,19 +1,19 @@ #pragma once +#include "base/threaded_container.hpp" #include "base/condition.hpp" #include "base/logging.hpp" -#include "std/list.hpp" -#include "base/threaded_container.hpp" +#include <list> template <typename T> class ThreadedList : public ThreadedContainer { private: - list<T> m_list; + std::list<T> m_list; bool m_isEmpty; - string m_resName; + std::string m_resName; public: @@ -69,7 +69,7 @@ public: m_resName = name; } - string const & GetName() const + std::string const & GetName() const { return m_resName; } diff --git a/base/threaded_priority_queue.hpp b/base/threaded_priority_queue.hpp deleted file mode 100644 index 060ca70963..0000000000 --- a/base/threaded_priority_queue.hpp +++ /dev/null @@ -1,83 +0,0 @@ -#pragma once - -#include "base/threaded_container.hpp" -#include "std/queue.hpp" - -template <typename T> -class ThreadedPriorityQueue : public ThreadedContainer -{ -private: - priority_queue<T> m_queue; -public: - - template <typename Fn> - void ProcessQueue(Fn const & fn) - { - threads::ConditionGuard g(m_Cond); - - bool hadElements = !m_queue.empty(); - - fn(m_queue); - - bool hasElements = !m_queue.empty(); - - if (!hadElements && hasElements) - m_Cond.Signal(); - } - - void Push(T const & t) - { - threads::ConditionGuard g(m_Cond); - - bool doSignal = m_queue.empty(); - - m_queue.push(t); - - if (doSignal) - m_Cond.Signal(); - } - - bool WaitNonEmpty() - { - while (m_queue.empty()) - { - if (IsCancelled()) - break; - - m_Cond.Wait(); - } - - if (IsCancelled()) - return true; - - return false; - } - - T Top(bool doPop) - { - threads::ConditionGuard g(m_Cond); - - if (WaitNonEmpty()) - return T(); - - T res = m_queue.top(); - - if (doPop) - m_queue.pop(); - - return res; - } - - bool Empty() const - { - threads::ConditionGuard g(m_Cond); - return m_queue.empty(); - } - - void Clear() - { - threads::ConditionGuard g(m_Cond); - while (!m_queue.empty()) - m_queue.pop(); - } -}; diff --git a/base/time_samples.cpp b/base/time_samples.cpp deleted file mode 100644 index 209385b060..0000000000 --- a/base/time_samples.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "base/time_samples.hpp" - -#include "std/cmath.hpp" - -namespace my -{ -void TimeSamples::Add(double seconds) -{ - m_sum += seconds; - m_sum2 += seconds * seconds; - ++m_total; -} - -double TimeSamples::GetMean() const { return m_total == 0 ? 0.0 : m_sum / m_total; } - -double TimeSamples::GetSD() const -{ - if (m_total < 2) - return 0.0; - return std::max((m_sum2 - m_sum * m_sum / static_cast<double>(m_total)) / (m_total - 1), 0.0); -} - -double TimeSamples::GetVar() const { return sqrt(GetSD()); } -} // namespace my diff --git a/base/time_samples.hpp b/base/time_samples.hpp deleted file mode 100644 index c4f1fdf072..0000000000 --- a/base/time_samples.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include "base/timer.hpp" - -#include "std/cstdint.hpp" - -namespace my -{ -// This class can be used in measurements of code blocks performance. -// It can accumulate time samples, and can calculate mean time and -// standard deviation. -// -// *NOTE* This class is NOT thread-safe. -class TimeSamples final -{ -public: - void Add(double seconds); - - // Mean of the accumulated time samples. - double GetMean() const; - - // Unbiased standard deviation of the accumulated time samples. - double GetSD() const; - - // Unbiased variance of the accumulated time samples. - double GetVar() const; - -private: - double m_sum = 0.0; - double m_sum2 = 0.0; - size_t m_total = 0; -}; - -// This class can be used as a single scoped time sample. It -// automatically adds time sample on destruction. -// -// *NOTE* This class is NOT thread-safe. -class ScopedTimeSample final -{ -public: - ScopedTimeSample(TimeSamples & ts) : m_ts(ts) {} - ~ScopedTimeSample() { m_ts.Add(m_t.ElapsedSeconds()); } - -private: - TimeSamples & m_ts; - my::Timer m_t; -}; - -} // namespace my diff --git a/base/timegm.cpp b/base/timegm.cpp index 659ad067ec..02461d6095 100644 --- a/base/timegm.cpp +++ b/base/timegm.cpp @@ -3,7 +3,7 @@ #include "base/assert.hpp" #include "base/timer.hpp" -#include "std/chrono.hpp" +#include <chrono> // There are issues with this implementation due to absence // of time_t fromat specification. There are no guarantees diff --git a/base/timegm.hpp b/base/timegm.hpp index b5bc0e763d..1b4c27d438 100644 --- a/base/timegm.hpp +++ b/base/timegm.hpp @@ -1,7 +1,7 @@ #pragma once -#include "std/cstdint.hpp" -#include "std/ctime.hpp" +#include <cstdint> +#include <ctime> namespace base { diff --git a/base/timer.cpp b/base/timer.cpp index 60d87ff730..f8796b0479 100644 --- a/base/timer.cpp +++ b/base/timer.cpp @@ -3,14 +3,15 @@ #include "base/timegm.hpp" #include "base/timer.hpp" -#include "std/algorithm.hpp" -#include "std/chrono.hpp" -#include "std/cstdio.hpp" -#include "std/iomanip.hpp" -#include "std/sstream.hpp" #include "std/systime.hpp" #include "std/target_os.hpp" +#include <algorithm> +#include <chrono> +#include <cstdio> +#include <iomanip> +#include <sstream> + namespace my { @@ -38,10 +39,10 @@ double Timer::LocalTime() #endif } -string FormatCurrentTime() +std::string FormatCurrentTime() { time_t t = time(NULL); - string s(ctime(&t)); + std::string s(ctime(&t)); replace(s.begin(), s.end(), ' ', '_'); @@ -63,10 +64,10 @@ uint64_t SecondsSinceEpoch() return TimeTToSecondsSinceEpoch(::time(nullptr)); } -string TimestampToString(time_t time) +std::string TimestampToString(time_t time) { if (time == INVALID_TIME_STAMP) - return string("INVALID_TIME_STAMP"); + return std::string("INVALID_TIME_STAMP"); tm * t = gmtime(&time); char buf[21] = { 0 }; @@ -92,7 +93,7 @@ bool IsValid(tm const & t) } } -time_t StringToTimestamp(string const & s) +time_t StringToTimestamp(std::string const & s) { // Return current time in the case of failure time_t res = INVALID_TIME_STAMP; @@ -101,8 +102,8 @@ time_t StringToTimestamp(string const & s) { // Parse UTC format: 1970-01-01T00:00:00Z tm t{}; - istringstream ss(s); - ss >> get_time(&t, "%Y-%m-%dT%H:%M:%SZ"); + std::istringstream ss(s); + ss >> std::get_time(&t, "%Y-%m-%dT%H:%M:%SZ"); if (!ss.fail() && IsValid(t)) res = base::TimeGM(t); @@ -112,8 +113,8 @@ time_t StringToTimestamp(string const & s) // Parse custom time zone offset format: 2012-12-03T00:38:34+03:30 tm t1{}, t2{}; char sign; - istringstream ss(s); - ss >> get_time(&t1, "%Y-%m-%dT%H:%M:%S") >> sign >> get_time(&t2, "%H:%M"); + std::istringstream ss(s); + ss >> std::get_time(&t1, "%Y-%m-%dT%H:%M:%S") >> sign >> std::get_time(&t2, "%H:%M"); if (!ss.fail() && IsValid(t1)) { @@ -138,33 +139,33 @@ HighResTimer::HighResTimer(bool start/* = true*/) void HighResTimer::Reset() { - m_start = high_resolution_clock::now(); + m_start = std::chrono::high_resolution_clock::now(); } uint64_t HighResTimer::ElapsedNano() const { - return duration_cast<nanoseconds>(high_resolution_clock::now() - m_start).count(); + return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - m_start).count(); } uint64_t HighResTimer::ElapsedMillis() const { - return duration_cast<milliseconds>(high_resolution_clock::now() - m_start).count(); + return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - m_start).count(); } double HighResTimer::ElapsedSeconds() const { - return duration_cast<duration<double>>(high_resolution_clock::now() - m_start).count(); + return std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - m_start).count(); } time_t SecondsSinceEpochToTimeT(uint64_t secondsSinceEpoch) { - time_point<system_clock> const tpoint{seconds(secondsSinceEpoch)}; - return system_clock::to_time_t(tpoint); + std::chrono::time_point<std::chrono::system_clock> const tpoint{std::chrono::seconds(secondsSinceEpoch)}; + return std::chrono::system_clock::to_time_t(tpoint); } uint64_t TimeTToSecondsSinceEpoch(time_t time) { - auto const tpoint = system_clock::from_time_t(time); - return duration_cast<seconds>(tpoint.time_since_epoch()).count(); + auto const tpoint = std::chrono::system_clock::from_time_t(time); + return std::chrono::duration_cast<std::chrono::seconds>(tpoint.time_since_epoch()).count(); } } diff --git a/base/timer.hpp b/base/timer.hpp index d64c66a0ac..72992b523d 100644 --- a/base/timer.hpp +++ b/base/timer.hpp @@ -1,9 +1,9 @@ #pragma once -#include "std/chrono.hpp" -#include "std/cstdint.hpp" -#include "std/ctime.hpp" -#include "std/string.hpp" +#include <chrono> +#include <cstdint> +#include <ctime> +#include <string> namespace my { @@ -11,7 +11,7 @@ namespace my /// Cross platform timer class Timer { - steady_clock::time_point m_startTime; + std::chrono::steady_clock::time_point m_startTime; public: explicit Timer(bool start = true); @@ -20,20 +20,20 @@ public: static double LocalTime(); /// @return Elapsed time from start (@see Reset). - inline steady_clock::duration TimeElapsed() const { return steady_clock::now() - m_startTime; } + inline std::chrono::steady_clock::duration TimeElapsed() const { return std::chrono::steady_clock::now() - m_startTime; } template <typename TDuration> inline TDuration TimeElapsedAs() const { - return duration_cast<TDuration>(TimeElapsed()); + return std::chrono::duration_cast<TDuration>(TimeElapsed()); } - inline double ElapsedSeconds() const { return TimeElapsedAs<duration<double>>().count(); } + inline double ElapsedSeconds() const { return TimeElapsedAs<std::chrono::duration<double>>().count(); } - inline void Reset() { m_startTime = steady_clock::now(); } + inline void Reset() { m_startTime = std::chrono::steady_clock::now(); } }; -string FormatCurrentTime(); +std::string FormatCurrentTime(); /// Generates timestamp for a specified day. /// \param year The number of years since 1900. @@ -46,20 +46,20 @@ uint64_t SecondsSinceEpoch(); /// Always creates strings in UTC time: 1997-07-16T07:30:15Z /// Returns empty string on error -string TimestampToString(time_t time); +std::string TimestampToString(time_t time); time_t const INVALID_TIME_STAMP = -1; /// Accepts strings in UTC format: 1997-07-16T07:30:15Z /// And with custom time offset: 1997-07-16T10:30:15+03:00 /// @return INVALID_TIME_STAMP if string is invalid -time_t StringToTimestamp(string const & s); +time_t StringToTimestamp(std::string const & s); /// High resolution timer to use in comparison tests. class HighResTimer { - typedef high_resolution_clock::time_point PointT; + typedef std::chrono::high_resolution_clock::time_point PointT; PointT m_start; public: diff --git a/base/uni_string_dfa.cpp b/base/uni_string_dfa.cpp index 4106bb8717..e4faaf2828 100644 --- a/base/uni_string_dfa.cpp +++ b/base/uni_string_dfa.cpp @@ -32,7 +32,7 @@ UniStringDFA::Iterator & UniStringDFA::Iterator::Move(UniChar c) // UniStringDFA::UniStringDFA ---------------------------------------------------------------------- UniStringDFA::UniStringDFA(UniString const & s) : m_s(s) {} -UniStringDFA::UniStringDFA(string const & s): UniStringDFA(MakeUniString(s)) {} +UniStringDFA::UniStringDFA(std::string const & s): UniStringDFA(MakeUniString(s)) {} UniStringDFA::Iterator UniStringDFA::Begin() const { diff --git a/base/uni_string_dfa.hpp b/base/uni_string_dfa.hpp index f7e75085a1..bd2d2b6bb0 100644 --- a/base/uni_string_dfa.hpp +++ b/base/uni_string_dfa.hpp @@ -3,7 +3,7 @@ #include "base/logging.hpp" #include "base/string_utils.hpp" -#include "std/string.hpp" +#include <string> namespace strings { @@ -29,7 +29,7 @@ public: }; explicit UniStringDFA(UniString const & s); - explicit UniStringDFA(string const & s); + explicit UniStringDFA(std::string const & s); Iterator Begin() const; diff --git a/base/worker_thread.hpp b/base/worker_thread.hpp deleted file mode 100644 index 8f47c8f2ae..0000000000 --- a/base/worker_thread.hpp +++ /dev/null @@ -1,113 +0,0 @@ -#pragma once - -#include "base/assert.hpp" -#include "base/macros.hpp" -#include "base/thread_checker.hpp" - -#include "std/condition_variable.hpp" -#include "std/mutex.hpp" -#include "std/queue.hpp" -#include "std/shared_ptr.hpp" -#include "std/thread.hpp" - - -namespace my -{ -/// This class wraps a sequential worker thread, that performs tasks -/// one-by-one. This class is not thread-safe, so, it should be -/// instantiated, used and destroyed on the same thread. -template <typename Task> -class WorkerThread -{ -public: - WorkerThread(int maxTasks) - : m_maxTasks(maxTasks), m_shouldFinish(false), m_workerThread(&WorkerThread::Worker, this) - { - } - - ~WorkerThread() - { - ASSERT(m_threadChecker.CalledOnOriginalThread(), ()); - if (IsRunning()) - RunUntilIdleAndStop(); - ASSERT(!IsRunning(), ()); - } - - /// Pushes new task into worker thread's queue. If the queue is - /// full, current thread is blocked. - /// - /// \param task A callable object that will be called by worker thread. - void Push(shared_ptr<Task> task) - { - ASSERT(m_threadChecker.CalledOnOriginalThread(), ()); - ASSERT(IsRunning(), ()); - unique_lock<mutex> lock(m_mutex); - m_condNotFull.wait(lock, [this]() - { - return m_tasks.size() < m_maxTasks; - }); - m_tasks.push(task); - m_condNonEmpty.notify_one(); - } - - /// Runs worker thread until it'll become idle. After that, - /// terminates worker thread. - void RunUntilIdleAndStop() - { - ASSERT(m_threadChecker.CalledOnOriginalThread(), ()); - ASSERT(IsRunning(), ()); - { - lock_guard<mutex> lock(m_mutex); - m_shouldFinish = true; - m_condNonEmpty.notify_one(); - } - m_workerThread.join(); - } - - /// \return True if worker thread is running, false otherwise. - inline bool IsRunning() const - { - ASSERT(m_threadChecker.CalledOnOriginalThread(), ()); - return m_workerThread.joinable(); - } - -private: - void Worker() - { - shared_ptr<Task> task; - while (true) - { - { - unique_lock<mutex> lock(m_mutex); - m_condNonEmpty.wait(lock, [this]() - { - return m_shouldFinish || !m_tasks.empty(); - }); - if (m_shouldFinish && m_tasks.empty()) - break; - task = m_tasks.front(); - m_tasks.pop(); - m_condNotFull.notify_one(); - } - (*task)(); - } - } - - /// Maximum number of tasks in the queue. - int const m_maxTasks; - queue<shared_ptr<Task>> m_tasks; - - /// When true, worker thread should finish all tasks in the queue - /// and terminate. - bool m_shouldFinish; - - mutex m_mutex; - condition_variable m_condNotFull; - condition_variable m_condNonEmpty; - thread m_workerThread; -#ifdef DEBUG - ThreadChecker m_threadChecker; -#endif - DISALLOW_COPY_AND_MOVE(WorkerThread); -}; // class WorkerThread -} // namespace my diff --git a/coding/coding_tests/coder_util_test.cpp b/coding/coding_tests/coder_util_test.cpp index 56541c0d61..ff693e3009 100644 --- a/coding/coding_tests/coder_util_test.cpp +++ b/coding/coding_tests/coder_util_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "coding/coder_util.hpp" diff --git a/coding/coding_tests/mem_file_reader_test.cpp b/coding/coding_tests/mem_file_reader_test.cpp index bfa5311a23..867f522143 100644 --- a/coding/coding_tests/mem_file_reader_test.cpp +++ b/coding/coding_tests/mem_file_reader_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "coding/reader.hpp" diff --git a/coding/coding_tests/mem_file_writer_test.cpp b/coding/coding_tests/mem_file_writer_test.cpp index 2625649795..bd3a9e2ad4 100644 --- a/coding/coding_tests/mem_file_writer_test.cpp +++ b/coding/coding_tests/mem_file_writer_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "coding/writer.hpp" diff --git a/coding/coding_tests/png_decoder_test.cpp b/coding/coding_tests/png_decoder_test.cpp index 91a148046f..74e4638535 100644 --- a/coding/coding_tests/png_decoder_test.cpp +++ b/coding/coding_tests/png_decoder_test.cpp @@ -2,6 +2,7 @@ #include "std/string.hpp" #include "std/fstream.hpp" +#include "std/vector.hpp" void loadFile(vector<unsigned char> & buffer, string const & filename) //designed for loading files from hard disk in an std::vector { diff --git a/coding/coding_tests/reader_writer_ops_test.cpp b/coding/coding_tests/reader_writer_ops_test.cpp index 5b30313f2d..ecf6ff2081 100644 --- a/coding/coding_tests/reader_writer_ops_test.cpp +++ b/coding/coding_tests/reader_writer_ops_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "testing/testing.hpp" #include "coding/reader_writer_ops.hpp" diff --git a/coding/diff.hpp b/coding/diff.hpp index 754db84459..4287df422a 100644 --- a/coding/diff.hpp +++ b/coding/diff.hpp @@ -1,9 +1,12 @@ #pragma once #include "coding/diff_patch_common.hpp" + #include "base/assert.hpp" #include "base/base.hpp" + #include "std/algorithm.hpp" #include "std/unordered_map.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" namespace diff diff --git a/coding/file_container.cpp b/coding/file_container.cpp index e37dc86731..2598fa299a 100644 --- a/coding/file_container.cpp +++ b/coding/file_container.cpp @@ -4,6 +4,7 @@ #include "coding/internal/file_data.hpp" #include "std/cstring.hpp" +#include "std/sstream.hpp" #ifndef OMIM_OS_WINDOWS #include <stdio.h> diff --git a/coding/file_container.hpp b/coding/file_container.hpp index 50458450f5..01e3fd8c0e 100644 --- a/coding/file_container.hpp +++ b/coding/file_container.hpp @@ -5,6 +5,7 @@ #include "std/vector.hpp" #include "std/string.hpp" #include "std/noncopyable.hpp" +#include "std/utility.hpp" class FilesContainerBase diff --git a/coding/fixed_bits_ddvector.hpp b/coding/fixed_bits_ddvector.hpp index c87a416335..a1b619fb61 100644 --- a/coding/fixed_bits_ddvector.hpp +++ b/coding/fixed_bits_ddvector.hpp @@ -8,6 +8,7 @@ #include "std/algorithm.hpp" #include "std/unique_ptr.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" diff --git a/coding/multilang_utf8_string.hpp b/coding/multilang_utf8_string.hpp index fc547cd327..db0ffa0f5d 100644 --- a/coding/multilang_utf8_string.hpp +++ b/coding/multilang_utf8_string.hpp @@ -4,6 +4,7 @@ #include "base/assert.hpp" +#include "std/array.hpp" #include "std/string.hpp" diff --git a/coding/parse_xml.hpp b/coding/parse_xml.hpp index 2fc3cf81c6..ee2b34db10 100644 --- a/coding/parse_xml.hpp +++ b/coding/parse_xml.hpp @@ -4,6 +4,8 @@ #include "base/assert.hpp" +#include "std/algorithm.hpp" + template <typename XMLDispatcherT, typename SequenceT> uint64_t ParseXMLSequence(SequenceT & source, XMLDispatcherT & dispatcher, bool useCharData = false) diff --git a/coding/read_write_utils.hpp b/coding/read_write_utils.hpp index 9c0ecd2362..0536894a91 100644 --- a/coding/read_write_utils.hpp +++ b/coding/read_write_utils.hpp @@ -4,6 +4,7 @@ #include "base/buffer_vector.hpp" +#include "std/algorithm.hpp" #include "std/string.hpp" #include "std/vector.hpp" #include "std/type_traits.hpp" diff --git a/coding/reader_cache.hpp b/coding/reader_cache.hpp index d8e5bdf91c..6f2c758d26 100644 --- a/coding/reader_cache.hpp +++ b/coding/reader_cache.hpp @@ -4,9 +4,10 @@ #include "base/cache.hpp" #include "base/stats.hpp" -#include "std/vector.hpp" -#include "std/cstring.hpp" #include "std/algorithm.hpp" +#include "std/cstring.hpp" +#include "std/sstream.hpp" +#include "std/vector.hpp" namespace impl diff --git a/coding/varint.hpp b/coding/varint.hpp index 5777085fcc..a22b77e703 100644 --- a/coding/varint.hpp +++ b/coding/varint.hpp @@ -7,6 +7,8 @@ #include "base/bits.hpp" #include "base/exception.hpp" #include "base/stl_add.hpp" + +#include "std/string.hpp" #include "std/type_traits.hpp" diff --git a/coding/zip_reader.hpp b/coding/zip_reader.hpp index bea0496ae5..7e6360ffbe 100644 --- a/coding/zip_reader.hpp +++ b/coding/zip_reader.hpp @@ -6,6 +6,7 @@ #include "base/exception.hpp" #include "std/function.hpp" +#include "std/utility.hpp" class ZipFileReader : public FileReader diff --git a/drape/attribute_buffer_mutator.hpp b/drape/attribute_buffer_mutator.hpp index b23ee8e68e..a215e64c7f 100644 --- a/drape/attribute_buffer_mutator.hpp +++ b/drape/attribute_buffer_mutator.hpp @@ -7,6 +7,7 @@ #include "std/cstdint.hpp" #include "std/map.hpp" +#include "std/vector.hpp" namespace dp { diff --git a/drape/batcher_helpers.hpp b/drape/batcher_helpers.hpp index 8ccc53d286..1d8ee5ae3b 100644 --- a/drape/batcher_helpers.hpp +++ b/drape/batcher_helpers.hpp @@ -3,6 +3,7 @@ #include "drape/pointers.hpp" #include "std/function.hpp" +#include "std/vector.hpp" namespace dp { diff --git a/drape/drape_tests/fribidi_tests.cpp b/drape/drape_tests/fribidi_tests.cpp index 4dd39af892..85061113d8 100644 --- a/drape/drape_tests/fribidi_tests.cpp +++ b/drape/drape_tests/fribidi_tests.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "drape/fribidi.hpp" diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 41ec7c1632..413cad27af 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -10,9 +10,12 @@ #ifdef DEBUG #include "base/thread.hpp" -#include "std/map.hpp" #endif +#include "std/algorithm.hpp" +#include "std/map.hpp" +#include "std/utility.hpp" + #if defined(OMIM_OS_WINDOWS) #define DP_APIENTRY __stdcall #elif defined(OMIM_OS_ANDROID) diff --git a/drape/glsl_types.hpp b/drape/glsl_types.hpp index 7831e2d45b..588b609128 100644 --- a/drape/glsl_types.hpp +++ b/drape/glsl_types.hpp @@ -4,6 +4,8 @@ #include "drape/color.hpp" +#include "std/type_traits.hpp" + #include <glm_config.hpp> #include <glm/vec2.hpp> #include <glm/vec3.hpp> diff --git a/drape/glyph_manager.cpp b/drape/glyph_manager.cpp index 809e27f58b..32556a3075 100644 --- a/drape/glyph_manager.cpp +++ b/drape/glyph_manager.cpp @@ -10,6 +10,8 @@ #include "base/math.hpp" #include "base/timer.hpp" +#include "std/limits.hpp" +#include "std/sstream.hpp" #include "std/unique_ptr.hpp" #include "std/unordered_set.hpp" diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp index 930ad547b2..725a82d44d 100644 --- a/drape/overlay_handle.hpp +++ b/drape/overlay_handle.hpp @@ -14,6 +14,8 @@ #include "base/buffer_vector.hpp" +#include "std/set.hpp" + namespace dp { diff --git a/drape/pointers.hpp b/drape/pointers.hpp index 66a4eeea09..f7d956dfa5 100644 --- a/drape/pointers.hpp +++ b/drape/pointers.hpp @@ -5,8 +5,12 @@ #include "std/map.hpp" #include "std/mutex.hpp" +#include "std/string.hpp" #include "std/type_traits.hpp" #include "std/typeinfo.hpp" +#include "std/utility.hpp" +#include "std/unique_ptr.hpp" + //#define TRACK_POINTERS diff --git a/drape/render_bucket.hpp b/drape/render_bucket.hpp index 7c3d9a0e73..6253a8c9db 100644 --- a/drape/render_bucket.hpp +++ b/drape/render_bucket.hpp @@ -4,6 +4,7 @@ #include "std/function.hpp" #include "std/limits.hpp" +#include "std/vector.hpp" class ScreenBase; diff --git a/drape/shader.cpp b/drape/shader.cpp index 240715a887..4d434c3d65 100644 --- a/drape/shader.cpp +++ b/drape/shader.cpp @@ -4,6 +4,8 @@ #include "base/assert.hpp" #include "base/string_utils.hpp" +#include "std/algorithm.hpp" + namespace dp { diff --git a/drape/stipple_pen_resource.cpp b/drape/stipple_pen_resource.cpp index f190054d4b..59b557844e 100644 --- a/drape/stipple_pen_resource.cpp +++ b/drape/stipple_pen_resource.cpp @@ -5,6 +5,7 @@ #include "base/shared_buffer_manager.hpp" #include "std/numeric.hpp" +#include "std/iomanip.hpp" #include "std/sstream.hpp" #include "std/cstring.hpp" diff --git a/drape/support_manager.cpp b/drape/support_manager.cpp index 516f5fa41b..10a0ecccc8 100644 --- a/drape/support_manager.cpp +++ b/drape/support_manager.cpp @@ -4,6 +4,7 @@ #include "base/logging.hpp" #include "std/algorithm.hpp" +#include "std/vector.hpp" #include "3party/Alohalytics/src/alohalytics.h" diff --git a/drape/symbols_texture.hpp b/drape/symbols_texture.hpp index 1bc8b04565..219f7f4e53 100644 --- a/drape/symbols_texture.hpp +++ b/drape/symbols_texture.hpp @@ -4,6 +4,7 @@ #include "std/string.hpp" #include "std/map.hpp" +#include "std/vector.hpp" namespace dp { diff --git a/drape/utils/glyph_usage_tracker.hpp b/drape/utils/glyph_usage_tracker.hpp index 74a9e61dfa..8555265e09 100644 --- a/drape/utils/glyph_usage_tracker.hpp +++ b/drape/utils/glyph_usage_tracker.hpp @@ -6,6 +6,7 @@ #include "std/set.hpp" #include "std/list.hpp" #include "std/mutex.hpp" +#include "std/string.hpp" #include "std/unordered_set.hpp" //#define TRACK_GLYPH_USAGE diff --git a/drape/utils/gpu_mem_tracker.hpp b/drape/utils/gpu_mem_tracker.hpp index 4a58c52d71..eb350f9f22 100644 --- a/drape/utils/gpu_mem_tracker.hpp +++ b/drape/utils/gpu_mem_tracker.hpp @@ -4,6 +4,9 @@ #include "std/map.hpp" #include "std/noncopyable.hpp" +#include "std/string.hpp" +#include "std/utility.hpp" + //#define TRACK_GPU_MEM diff --git a/drape_frontend/animation/base_interpolator.cpp b/drape_frontend/animation/base_interpolator.cpp index f7f7ca35b4..60e097111c 100644 --- a/drape_frontend/animation/base_interpolator.cpp +++ b/drape_frontend/animation/base_interpolator.cpp @@ -4,6 +4,8 @@ #include "base/assert.hpp" #include "base/math.hpp" +#include "std/algorithm.hpp" + namespace df { diff --git a/drape_frontend/animation/parallel_animation.hpp b/drape_frontend/animation/parallel_animation.hpp index 5fa9952660..6d9a419e75 100644 --- a/drape_frontend/animation/parallel_animation.hpp +++ b/drape_frontend/animation/parallel_animation.hpp @@ -4,6 +4,8 @@ #include "drape/pointers.hpp" +#include "std/list.hpp" + namespace df { diff --git a/drape_frontend/animation_system.cpp b/drape_frontend/animation_system.cpp index 2e06a55b0f..1021c3f3dd 100644 --- a/drape_frontend/animation_system.cpp +++ b/drape_frontend/animation_system.cpp @@ -3,6 +3,7 @@ #include "base/logging.hpp" #include "std/bind.hpp" +#include "std/vector.hpp" #include "std/weak_ptr.hpp" namespace df diff --git a/drape_frontend/animation_system.hpp b/drape_frontend/animation_system.hpp index f163f09695..cc18969338 100644 --- a/drape_frontend/animation_system.hpp +++ b/drape_frontend/animation_system.hpp @@ -6,6 +6,7 @@ #include "std/cstring.hpp" #include "std/deque.hpp" +#include "std/list.hpp" #include "std/noncopyable.hpp" #include "std/shared_ptr.hpp" #include "std/string.hpp" diff --git a/drape_frontend/drape_frontend_tests/object_pool_tests.cpp b/drape_frontend/drape_frontend_tests/object_pool_tests.cpp index dd514be473..e87bd10c26 100644 --- a/drape_frontend/drape_frontend_tests/object_pool_tests.cpp +++ b/drape_frontend/drape_frontend_tests/object_pool_tests.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "drape/object_pool.hpp" diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 58a5979c8f..ec26b2ad48 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -33,6 +33,7 @@ #include "std/algorithm.hpp" #include "std/bind.hpp" #include "std/cmath.hpp" +#include "std/chrono.hpp" namespace df { diff --git a/drape_frontend/gui/skin.hpp b/drape_frontend/gui/skin.hpp index d326a8e1d0..de1cbb894b 100644 --- a/drape_frontend/gui/skin.hpp +++ b/drape_frontend/gui/skin.hpp @@ -5,6 +5,7 @@ #include "coding/reader.hpp" #include "std/map.hpp" +#include "std/utility.hpp" //#define RENRER_DEBUG_INFO_LABELS diff --git a/drape_frontend/map_shape.hpp b/drape_frontend/map_shape.hpp index a26723ffa3..f2253df961 100644 --- a/drape_frontend/map_shape.hpp +++ b/drape_frontend/map_shape.hpp @@ -7,6 +7,8 @@ #include "geometry/point2d.hpp" +#include "std/vector.hpp" + namespace dp { class Batcher; diff --git a/drape_frontend/message_queue.hpp b/drape_frontend/message_queue.hpp index 5330827735..f51acaadda 100644 --- a/drape_frontend/message_queue.hpp +++ b/drape_frontend/message_queue.hpp @@ -8,6 +8,7 @@ #include "std/condition_variable.hpp" #include "std/deque.hpp" +#include "std/functional.hpp" #include "std/mutex.hpp" namespace df diff --git a/drape_frontend/read_manager.cpp b/drape_frontend/read_manager.cpp index d2b21c499d..ad47e27616 100755 --- a/drape_frontend/read_manager.cpp +++ b/drape_frontend/read_manager.cpp @@ -7,8 +7,9 @@ #include "base/buffer_vector.hpp" #include "base/stl_add.hpp" -#include "std/bind.hpp" #include "std/algorithm.hpp" +#include "std/bind.hpp" +#include "std/iterator.hpp" namespace df { diff --git a/drape_frontend/read_mwm_task.hpp b/drape_frontend/read_mwm_task.hpp index c9fb57a7d3..d4cb208670 100644 --- a/drape_frontend/read_mwm_task.hpp +++ b/drape_frontend/read_mwm_task.hpp @@ -4,10 +4,6 @@ #include "base/thread.hpp" -#ifdef DEBUG -#include "base/object_tracker.hpp" -#endif - #include "std/shared_ptr.hpp" #include "std/weak_ptr.hpp" @@ -32,7 +28,6 @@ private: MapDataProvider & m_model; #ifdef DEBUG - dbg::ObjectTracker m_objTracker; bool m_checker; #endif }; diff --git a/drape_frontend/text_layout.cpp b/drape_frontend/text_layout.cpp index 009b69efe2..c433d76d13 100644 --- a/drape_frontend/text_layout.cpp +++ b/drape_frontend/text_layout.cpp @@ -6,9 +6,11 @@ #include "drape/glsl_func.hpp" #include "drape/overlay_handle.hpp" -#include "std/numeric.hpp" #include "std/algorithm.hpp" #include "std/bind.hpp" +#include "std/iterator.hpp" +#include "std/numeric.hpp" + namespace df { diff --git a/drape_frontend/tile_utils.hpp b/drape_frontend/tile_utils.hpp index c6a098ceb7..7779a65daf 100755 --- a/drape_frontend/tile_utils.hpp +++ b/drape_frontend/tile_utils.hpp @@ -3,6 +3,7 @@ #include "drape_frontend/tile_key.hpp" #include "std/function.hpp" +#include "std/set.hpp" namespace df { diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 1f10bebd42..d8c25f1dda 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -18,6 +18,8 @@ #include "base/logging.hpp" #include "base/macros.hpp" +#include "std/chrono.hpp" + #ifdef DEBUG #define TEST_CALL(action) if (m_testFn) m_testFn(action) #else diff --git a/drape_frontend/visual_params.cpp b/drape_frontend/visual_params.cpp index d4b449ee9d..e690e976e9 100644 --- a/drape_frontend/visual_params.cpp +++ b/drape_frontend/visual_params.cpp @@ -8,8 +8,9 @@ #include "indexer/scales.hpp" -#include "std/limits.hpp" #include "std/algorithm.hpp" +#include "std/limits.hpp" +#include "std/utility.hpp" namespace df { diff --git a/drape_frontend/watch/feature_processor.hpp b/drape_frontend/watch/feature_processor.hpp index 9d13fc512b..b8c1cf431b 100644 --- a/drape_frontend/watch/feature_processor.hpp +++ b/drape_frontend/watch/feature_processor.hpp @@ -13,6 +13,8 @@ #include "geometry/rect2d.hpp" +#include "std/list.hpp" + class ScreenBase; namespace df diff --git a/drape_frontend/watch/pen_info.hpp b/drape_frontend/watch/pen_info.hpp index b51a3daac5..e81d7b51b7 100644 --- a/drape_frontend/watch/pen_info.hpp +++ b/drape_frontend/watch/pen_info.hpp @@ -7,6 +7,9 @@ #include "base/buffer_vector.hpp" #include "base/math.hpp" +#include "std/algorithm.hpp" +#include "std/iterator.hpp" + namespace df { namespace watch diff --git a/drape_frontend/watch/proto_to_styles.cpp b/drape_frontend/watch/proto_to_styles.cpp index 8d745761ca..321986daa0 100644 --- a/drape_frontend/watch/proto_to_styles.cpp +++ b/drape_frontend/watch/proto_to_styles.cpp @@ -3,6 +3,7 @@ #include "indexer/drules_include.hpp" #include "std/algorithm.hpp" +#include "std/vector.hpp" namespace { diff --git a/drape_frontend/watch/software_renderer.hpp b/drape_frontend/watch/software_renderer.hpp index bd3ca4462a..04eeb9fea5 100644 --- a/drape_frontend/watch/software_renderer.hpp +++ b/drape_frontend/watch/software_renderer.hpp @@ -22,7 +22,9 @@ #include "3party/agg/agg_renderer_primitives.h" #include "3party/agg/agg_path_storage.h" +#include "std/algorithm.hpp" #include "std/cstdint.hpp" +#include "std/map.hpp" #include "std/unique_ptr.hpp" namespace df diff --git a/drape_frontend/watch/text_engine.h b/drape_frontend/watch/text_engine.h index 8a7e92cac8..6f9a633d27 100644 --- a/drape_frontend/watch/text_engine.h +++ b/drape_frontend/watch/text_engine.h @@ -20,6 +20,9 @@ #include "base/string_utils.hpp" +#include "std/utility.hpp" + + namespace ml { class text_engine; diff --git a/editor/config_loader.cpp b/editor/config_loader.cpp index b5ef7241a4..1900cbeacf 100644 --- a/editor/config_loader.cpp +++ b/editor/config_loader.cpp @@ -1,15 +1,16 @@ #include "editor/config_loader.hpp" #include "editor/editor_config.hpp" +#include "platform/http_client.hpp" #include "platform/platform.hpp" #include "coding/internal/file_data.hpp" #include "coding/reader.hpp" +#include "std/exception.hpp" #include "std/fstream.hpp" #include "std/iterator.hpp" -#include "platform/http_client.hpp" #include "3party/pugixml/src/pugixml.hpp" namespace diff --git a/editor/editor_notes.cpp b/editor/editor_notes.cpp index 162e9f7d61..bd9a66267a 100644 --- a/editor/editor_notes.cpp +++ b/editor/editor_notes.cpp @@ -11,6 +11,7 @@ #include "base/string_utils.hpp" #include "base/timer.hpp" +#include "std/chrono.hpp" #include "std/future.hpp" #include "3party/pugixml/src/pugixml.hpp" diff --git a/editor/editor_tests/ui2oh_test.cpp b/editor/editor_tests/ui2oh_test.cpp index 7d58ae87b1..271aad9c03 100644 --- a/editor/editor_tests/ui2oh_test.cpp +++ b/editor/editor_tests/ui2oh_test.cpp @@ -2,6 +2,8 @@ #include "editor/ui2oh.hpp" +#include "std/sstream.hpp" + using namespace osmoh; using namespace editor; using namespace editor::ui; diff --git a/editor/opening_hours_ui.cpp b/editor/opening_hours_ui.cpp index cf72296cc0..7914d292bb 100644 --- a/editor/opening_hours_ui.cpp +++ b/editor/opening_hours_ui.cpp @@ -329,7 +329,7 @@ TimeTable TimeTableSet::GetComplementTimeTable() const bool TimeTableSet::IsTwentyFourPerSeven() const { return GetUnhandledDays().empty() && - all_of(::begin(m_table), ::end(m_table), [](TimeTable const & tt) + all_of(std::begin(m_table), std::end(m_table), [](TimeTable const & tt) { return tt.IsTwentyFourHours(); }); diff --git a/editor/osm_feature_matcher.cpp b/editor/osm_feature_matcher.cpp index fe421ba47e..786ebda161 100644 --- a/editor/osm_feature_matcher.cpp +++ b/editor/osm_feature_matcher.cpp @@ -4,6 +4,7 @@ #include "base/stl_helpers.hpp" #include "std/algorithm.hpp" +#include "std/utility.hpp" using editor::XMLFeature; diff --git a/generator/booking_dataset.cpp b/generator/booking_dataset.cpp index 6dcb74a126..7a6d63b869 100644 --- a/generator/booking_dataset.cpp +++ b/generator/booking_dataset.cpp @@ -8,6 +8,8 @@ #include "base/string_utils.hpp" +#include "std/iomanip.hpp" + #include "boost/algorithm/string/replace.hpp" namespace generator diff --git a/generator/feature_builder.hpp b/generator/feature_builder.hpp index efc16df14f..54216a5cd2 100644 --- a/generator/feature_builder.hpp +++ b/generator/feature_builder.hpp @@ -8,6 +8,7 @@ #include "coding/read_write_utils.hpp" #include "std/bind.hpp" +#include "std/list.hpp" namespace serial { class CodingParams; } diff --git a/generator/feature_merger.hpp b/generator/feature_merger.hpp index 65082019cf..600ff90e05 100644 --- a/generator/feature_merger.hpp +++ b/generator/feature_merger.hpp @@ -3,6 +3,7 @@ #include "generator/feature_builder.hpp" #include "std/map.hpp" +#include "std/set.hpp" #include "std/vector.hpp" diff --git a/generator/generator_tests/osm_o5m_source_test.cpp b/generator/generator_tests/osm_o5m_source_test.cpp index c4b2157397..f3b539cd78 100644 --- a/generator/generator_tests/osm_o5m_source_test.cpp +++ b/generator/generator_tests/osm_o5m_source_test.cpp @@ -1,8 +1,11 @@ #include "testing/testing.hpp" #include "generator/osm_o5m_source.hpp" + #include "std/iterator.hpp" #include "std/set.hpp" +#include "std/vector.hpp" +#include "std/utility.hpp" #include "source_data.hpp" diff --git a/generator/generator_tests/source_to_element_test.cpp b/generator/generator_tests/source_to_element_test.cpp index a2c80f8e4f..23011ee15c 100644 --- a/generator/generator_tests/source_to_element_test.cpp +++ b/generator/generator_tests/source_to_element_test.cpp @@ -4,6 +4,8 @@ #include "generator/osm_source.hpp" #include "generator/osm_element.hpp" +#include "std/iterator.hpp" + #include "source_data.hpp" UNIT_TEST(Source_To_Element_create_from_xml_test) diff --git a/generator/intermediate_data.hpp b/generator/intermediate_data.hpp index e0e89629b6..f961c47223 100644 --- a/generator/intermediate_data.hpp +++ b/generator/intermediate_data.hpp @@ -13,6 +13,7 @@ #include "std/deque.hpp" #include "std/exception.hpp" #include "std/limits.hpp" +#include "std/unordered_map.hpp" #include "std/utility.hpp" #include "std/vector.hpp" diff --git a/generator/intermediate_elements.hpp b/generator/intermediate_elements.hpp index 8267f1599a..1abbbd9840 100644 --- a/generator/intermediate_elements.hpp +++ b/generator/intermediate_elements.hpp @@ -10,7 +10,9 @@ #include "std/algorithm.hpp" #include "std/bind.hpp" #include "std/limits.hpp" +#include "std/map.hpp" #include "std/string.hpp" +#include "std/sstream.hpp" #include "std/utility.hpp" #include "std/vector.hpp" diff --git a/generator/opentable_dataset.cpp b/generator/opentable_dataset.cpp index 499a2ef833..01faa6104a 100644 --- a/generator/opentable_dataset.cpp +++ b/generator/opentable_dataset.cpp @@ -8,6 +8,8 @@ #include "base/string_utils.hpp" +#include "std/iomanip.hpp" + #include "boost/algorithm/string/replace.hpp" namespace generator diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index 6aeccab3d0..5544de47fa 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -11,10 +11,11 @@ #include "base/assert.hpp" #include "base/string_utils.hpp" -#include "std/vector.hpp" #include "std/bind.hpp" -#include "std/function.hpp" #include "std/initializer_list.hpp" +#include "std/function.hpp" +#include "std/set.hpp" +#include "std/vector.hpp" namespace ftype { diff --git a/generator/osm_element.cpp b/generator/osm_element.cpp index 272bf4cc4b..c82f3a9257 100644 --- a/generator/osm_element.cpp +++ b/generator/osm_element.cpp @@ -3,9 +3,9 @@ #include "base/string_utils.hpp" #include "coding/parse_xml.hpp" -#include "std/cstdio.hpp" #include "std/algorithm.hpp" - +#include "std/cstdio.hpp" +#include "std/sstream.hpp" string DebugPrint(OsmElement::EntityType e) { diff --git a/generator/osm_o5m_source.hpp b/generator/osm_o5m_source.hpp index de57d64767..b492e9556f 100644 --- a/generator/osm_o5m_source.hpp +++ b/generator/osm_o5m_source.hpp @@ -3,6 +3,7 @@ #include "std/algorithm.hpp" #include "std/cstring.hpp" +#include "std/exception.hpp" #include "std/function.hpp" #include "std/iomanip.hpp" #include "std/iostream.hpp" diff --git a/generator/osm_source.hpp b/generator/osm_source.hpp index 44022809fe..9bb881c88d 100644 --- a/generator/osm_source.hpp +++ b/generator/osm_source.hpp @@ -6,6 +6,7 @@ #include "std/function.hpp" #include "std/iostream.hpp" #include "std/string.hpp" +#include "std/sstream.hpp" #include "std/unique_ptr.hpp" #include "std/vector.hpp" diff --git a/generator/tag_admixer.hpp b/generator/tag_admixer.hpp index 0aa14a6353..659b73a83f 100644 --- a/generator/tag_admixer.hpp +++ b/generator/tag_admixer.hpp @@ -8,7 +8,9 @@ #include "std/fstream.hpp" #include "std/map.hpp" +#include "std/set.hpp" #include "std/string.hpp" +#include "std/utility.hpp" class WaysParserHelper diff --git a/generator/tesselator.cpp b/generator/tesselator.cpp index 9d3d860646..68b132d7b0 100644 --- a/generator/tesselator.cpp +++ b/generator/tesselator.cpp @@ -9,6 +9,7 @@ #include "base/assert.hpp" #include "base/logging.hpp" +#include "std/limits.hpp" #include "std/queue.hpp" #include "std/unique_ptr.hpp" diff --git a/generator/tesselator.hpp b/generator/tesselator.hpp index 753862d0ef..bb201f11c5 100644 --- a/generator/tesselator.hpp +++ b/generator/tesselator.hpp @@ -4,10 +4,11 @@ #include "geometry/point2d.hpp" #include "std/function.hpp" +#include "std/iterator.hpp" #include "std/list.hpp" #include "std/vector.hpp" #include "std/unordered_map.hpp" -#include "std/iterator.hpp" +#include "std/utility.hpp" namespace tesselator diff --git a/geometry/algorithm.hpp b/geometry/algorithm.hpp index 962f51ed20..b9abbe9337 100644 --- a/geometry/algorithm.hpp +++ b/geometry/algorithm.hpp @@ -6,6 +6,7 @@ #include "std/type_traits.hpp" #include "std/array.hpp" #include "std/vector.hpp" +#include "std/utility.hpp" namespace m2 { diff --git a/geometry/angles.hpp b/geometry/angles.hpp index cbaf8be499..0371fe0dbc 100644 --- a/geometry/angles.hpp +++ b/geometry/angles.hpp @@ -5,6 +5,7 @@ #include "base/matrix.hpp" #include "std/cmath.hpp" +#include "std/string.hpp" namespace ang diff --git a/geometry/avg_vector.hpp b/geometry/avg_vector.hpp index 39390ca62f..84ad9dc494 100644 --- a/geometry/avg_vector.hpp +++ b/geometry/avg_vector.hpp @@ -6,6 +6,8 @@ #include "std/deque.hpp" #include "std/array.hpp" #include "std/cstring.hpp" +#include "std/limits.hpp" +#include "std/type_traits.hpp" namespace math diff --git a/geometry/geometry_tests/angle_test.cpp b/geometry/geometry_tests/angle_test.cpp index deaaa026d2..22dc6a8e4f 100644 --- a/geometry/geometry_tests/angle_test.cpp +++ b/geometry/geometry_tests/angle_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "geometry/geometry_tests/equality.hpp" #include "base/macros.hpp" diff --git a/geometry/geometry_tests/cellid_test.cpp b/geometry/geometry_tests/cellid_test.cpp index 9910020b96..fb16b5e6fd 100644 --- a/geometry/geometry_tests/cellid_test.cpp +++ b/geometry/geometry_tests/cellid_test.cpp @@ -2,6 +2,7 @@ #include "geometry/cellid.hpp" #include "std/algorithm.hpp" #include "std/string.hpp" +#include "std/vector.hpp" UNIT_TEST(CellID_Parent) { diff --git a/geometry/geometry_tests/clipping_test.cpp b/geometry/geometry_tests/clipping_test.cpp index 39e456b40e..55592732ff 100644 --- a/geometry/geometry_tests/clipping_test.cpp +++ b/geometry/geometry_tests/clipping_test.cpp @@ -2,6 +2,8 @@ #include "geometry/clipping.hpp" +#include "std/utility.hpp" + namespace { diff --git a/geometry/geometry_tests/common_test.cpp b/geometry/geometry_tests/common_test.cpp index 7ffbbb2af0..f17932e3f5 100644 --- a/geometry/geometry_tests/common_test.cpp +++ b/geometry/geometry_tests/common_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "base/macros.hpp" #include "geometry/geometry_tests/equality.hpp" diff --git a/geometry/geometry_tests/intersect_test.cpp b/geometry/geometry_tests/intersect_test.cpp index 154e46009e..eb1eb8d880 100644 --- a/geometry/geometry_tests/intersect_test.cpp +++ b/geometry/geometry_tests/intersect_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "geometry/geometry_tests/equality.hpp" #include "testing/testing.hpp" diff --git a/geometry/geometry_tests/mercator_test.cpp b/geometry/geometry_tests/mercator_test.cpp index add1f33929..d867ac2e89 100644 --- a/geometry/geometry_tests/mercator_test.cpp +++ b/geometry/geometry_tests/mercator_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "testing/testing.hpp" #include "geometry/mercator.hpp" diff --git a/geometry/geometry_tests/packer_test.cpp b/geometry/geometry_tests/packer_test.cpp index 49c1c3daa0..804d694e67 100644 --- a/geometry/geometry_tests/packer_test.cpp +++ b/geometry/geometry_tests/packer_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "geometry/packer.hpp" diff --git a/geometry/geometry_tests/rect_test.cpp b/geometry/geometry_tests/rect_test.cpp index 7676fbb880..bdac6b07cd 100644 --- a/geometry/geometry_tests/rect_test.cpp +++ b/geometry/geometry_tests/rect_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "geometry/rect2d.hpp" diff --git a/geometry/geometry_tests/region2d_binary_op_test.cpp b/geometry/geometry_tests/region2d_binary_op_test.cpp index bf856ef908..19027bb50d 100644 --- a/geometry/geometry_tests/region2d_binary_op_test.cpp +++ b/geometry/geometry_tests/region2d_binary_op_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "geometry/geometry_tests/test_regions.hpp" #include "testing/testing.hpp" diff --git a/geometry/geometry_tests/robust_test.cpp b/geometry/geometry_tests/robust_test.cpp index fc54df02ac..c26433b198 100644 --- a/geometry/geometry_tests/robust_test.cpp +++ b/geometry/geometry_tests/robust_test.cpp @@ -4,6 +4,7 @@ #include "geometry/segment2d.hpp" #include "geometry/triangle2d.hpp" +#include "std/iterator.hpp" using namespace m2::robust; diff --git a/geometry/geometry_tests/spline_test.cpp b/geometry/geometry_tests/spline_test.cpp index f649302c5e..2dd88f1b46 100644 --- a/geometry/geometry_tests/spline_test.cpp +++ b/geometry/geometry_tests/spline_test.cpp @@ -1,4 +1,3 @@ -#include "base/SRC_FIRST.hpp" #include "testing/testing.hpp" #include "geometry/geometry_tests/equality.hpp" #include "geometry/spline.hpp" diff --git a/geometry/geometry_tests/transformations_test.cpp b/geometry/geometry_tests/transformations_test.cpp index a6d911e618..b6484a2344 100644 --- a/geometry/geometry_tests/transformations_test.cpp +++ b/geometry/geometry_tests/transformations_test.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "testing/testing.hpp" #include "base/matrix.hpp" #include "geometry/point2d.hpp" diff --git a/geometry/packer.hpp b/geometry/packer.hpp index cfeb6d2f5f..3efe051abf 100644 --- a/geometry/packer.hpp +++ b/geometry/packer.hpp @@ -6,6 +6,8 @@ #include "std/map.hpp" #include "std/function.hpp" #include "std/queue.hpp" +#include "std/utility.hpp" +#include "std/vector.hpp" namespace m2 diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp index a8d5823908..85927ced7d 100644 --- a/geometry/point2d.hpp +++ b/geometry/point2d.hpp @@ -147,11 +147,11 @@ namespace m2 return Point<T>(x / module, y / module); } - pair<Point<T>, Point<T> > Normals(T prolongationFactor = 1) const + std::pair<Point<T>, Point<T> > Normals(T prolongationFactor = 1) const { T const prolongatedX = prolongationFactor * x; T const prolongatedY = prolongationFactor * y; - return pair<Point<T>, Point<T> >(Point<T>(static_cast<T>(-prolongatedY), static_cast<T>(prolongatedX)), + return std::pair<Point<T>, Point<T> >(Point<T>(static_cast<T>(-prolongatedY), static_cast<T>(prolongatedX)), Point<T>(static_cast<T>(prolongatedY), static_cast<T>(-prolongatedX))); } // @} @@ -245,7 +245,7 @@ namespace m2 return res; } - template <typename T> string DebugPrint(m2::Point<T> const & p) + template <typename T> std::string DebugPrint(m2::Point<T> const & p) { ostringstream out; out.precision(20); @@ -276,7 +276,7 @@ namespace m2 PointT const beVec = e - b; PointT beNormalizedVec = beVec.Normalize(); - pair<PointT, PointT > beNormVecs = beNormalizedVec.Normals(w); + std::pair<PointT, PointT > beNormVecs = beNormalizedVec.Normals(w); arrPnts[0] = e + beNormVecs.first; arrPnts[1] = e + beNormalizedVec * l; diff --git a/geometry/polygon.hpp b/geometry/polygon.hpp index 57272b29b6..9ddca7427a 100644 --- a/geometry/polygon.hpp +++ b/geometry/polygon.hpp @@ -8,6 +8,7 @@ #include "base/stl_add.hpp" #include "std/iterator.hpp" +#include "std/limits.hpp" template <typename IsVisibleF> diff --git a/geometry/rect2d.hpp b/geometry/rect2d.hpp index 57f7b676b3..4eb42e75a4 100644 --- a/geometry/rect2d.hpp +++ b/geometry/rect2d.hpp @@ -7,6 +7,7 @@ #include "std/algorithm.hpp" #include "std/limits.hpp" +#include "std/string.hpp" namespace m2 diff --git a/geometry/robust_orientation.cpp b/geometry/robust_orientation.cpp index 38e1608799..abf07fc5fc 100644 --- a/geometry/robust_orientation.cpp +++ b/geometry/robust_orientation.cpp @@ -1,9 +1,9 @@ -#include "base/SRC_FIRST.hpp" - #include "geometry/robust_orientation.hpp" #include "base/macros.hpp" +#include "std/algorithm.hpp" + extern "C" { #if defined(__clang__) diff --git a/geometry/robust_orientation.hpp b/geometry/robust_orientation.hpp index e4f81b65db..5a9a6ee21e 100644 --- a/geometry/robust_orientation.hpp +++ b/geometry/robust_orientation.hpp @@ -4,6 +4,8 @@ #include "base/stl_add.hpp" +#include "std/algorithm.hpp" + namespace m2 { namespace robust { diff --git a/geometry/tree4d.hpp b/geometry/tree4d.hpp index 90dec33c09..69aaf55f6c 100644 --- a/geometry/tree4d.hpp +++ b/geometry/tree4d.hpp @@ -7,6 +7,7 @@ #include "base/logging.hpp" #include "std/sstream.hpp" +#include "std/vector.hpp" #include "3party/kdtree++/kdtree.hpp" diff --git a/indexer/banners.cpp b/indexer/banners.cpp index b0bc01f4f8..7f1561cecd 100644 --- a/indexer/banners.cpp +++ b/indexer/banners.cpp @@ -9,6 +9,8 @@ #include "base/stl_add.hpp" #include "base/string_utils.hpp" +#include "std/iomanip.hpp" + #include "defines.hpp" namespace diff --git a/indexer/categories_holder.hpp b/indexer/categories_holder.hpp index c331708359..0c12622d5e 100644 --- a/indexer/categories_holder.hpp +++ b/indexer/categories_holder.hpp @@ -8,6 +8,7 @@ #include "std/string.hpp" #include "std/unique_ptr.hpp" #include "std/unordered_map.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" diff --git a/indexer/data_header.hpp b/indexer/data_header.hpp index 3de441c0d9..e78d8e9ae0 100644 --- a/indexer/data_header.hpp +++ b/indexer/data_header.hpp @@ -8,6 +8,8 @@ #include "base/buffer_vector.hpp" +#include "std/utility.hpp" + class FilesContainerR; class FileWriter; diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp index 800e8bb41c..3c0c5d8992 100644 --- a/indexer/editable_map_object.cpp +++ b/indexer/editable_map_object.cpp @@ -9,6 +9,7 @@ #include "std/cctype.hpp" #include "std/cmath.hpp" +#include "std/regex.hpp" #include "std/sstream.hpp" namespace diff --git a/indexer/feature.hpp b/indexer/feature.hpp index 4ecbb79357..874d8bd57a 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -10,6 +10,7 @@ #include "editor/xml_feature.hpp" +#include "std/iterator.hpp" #include "std/string.hpp" #include "std/utility.hpp" diff --git a/indexer/feature_impl.cpp b/indexer/feature_impl.cpp index 27341e2f86..eda4428cde 100644 --- a/indexer/feature_impl.cpp +++ b/indexer/feature_impl.cpp @@ -4,6 +4,7 @@ #include "base/logging.hpp" #include "base/math.hpp" +#include "std/algorithm.hpp" namespace feature { diff --git a/indexer/feature_loader.cpp b/indexer/feature_loader.cpp index 37093182e8..f62faadafc 100644 --- a/indexer/feature_loader.cpp +++ b/indexer/feature_loader.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "indexer/classificator.hpp" #include "indexer/feature.hpp" #include "indexer/feature_loader.hpp" diff --git a/indexer/feature_loader_base.cpp b/indexer/feature_loader_base.cpp index 4c2b4d5caf..eb7fd69a91 100644 --- a/indexer/feature_loader_base.cpp +++ b/indexer/feature_loader_base.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "indexer/feature_loader_base.hpp" #include "indexer/feature_loader.hpp" #include "indexer/feature_impl.hpp" diff --git a/indexer/geometry_serialization.hpp b/indexer/geometry_serialization.hpp index aa0a6b7234..2f43b37214 100644 --- a/indexer/geometry_serialization.hpp +++ b/indexer/geometry_serialization.hpp @@ -11,12 +11,13 @@ #include "coding/writer.hpp" #include "coding/varint.hpp" -#include "std/algorithm.hpp" -#include "std/bind.hpp" - #include "base/buffer_vector.hpp" #include "base/stl_add.hpp" +#include "std/algorithm.hpp" +#include "std/bind.hpp" +#include "std/list.hpp" + namespace serial { diff --git a/indexer/indexer_tests/categories_test.cpp b/indexer/indexer_tests/categories_test.cpp index c8e071ff0d..bea439e730 100644 --- a/indexer/indexer_tests/categories_test.cpp +++ b/indexer/indexer_tests/categories_test.cpp @@ -14,6 +14,7 @@ #include "std/algorithm.hpp" #include "std/bind.hpp" #include "std/map.hpp" +#include "std/set.hpp" #include "std/sstream.hpp" #include "std/vector.hpp" #include "std/transform_iterator.hpp" diff --git a/indexer/indexer_tests/search_string_utils_test.cpp b/indexer/indexer_tests/search_string_utils_test.cpp index 04ef8701f1..b2bacc5ada 100644 --- a/indexer/indexer_tests/search_string_utils_test.cpp +++ b/indexer/indexer_tests/search_string_utils_test.cpp @@ -4,6 +4,8 @@ #include "base/string_utils.hpp" +#include "std/vector.hpp" + using namespace search; using namespace strings; diff --git a/indexer/indexer_tests/string_slice_tests.cpp b/indexer/indexer_tests/string_slice_tests.cpp index 0f3ba6bd02..8134305121 100644 --- a/indexer/indexer_tests/string_slice_tests.cpp +++ b/indexer/indexer_tests/string_slice_tests.cpp @@ -4,6 +4,8 @@ #include "base/string_utils.hpp" +#include "std/iterator.hpp" + using namespace search; using namespace strings; diff --git a/indexer/indexer_tests/test_type.cpp b/indexer/indexer_tests/test_type.cpp index 04b704de01..dfa6892ccf 100644 --- a/indexer/indexer_tests/test_type.cpp +++ b/indexer/indexer_tests/test_type.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "testing/testing.hpp" #include "indexer/classificator.hpp" diff --git a/indexer/indexer_tests/visibility_test.cpp b/indexer/indexer_tests/visibility_test.cpp index 4329341696..b4a618caec 100644 --- a/indexer/indexer_tests/visibility_test.cpp +++ b/indexer/indexer_tests/visibility_test.cpp @@ -8,6 +8,7 @@ #include "base/logging.hpp" +#include "std/set.hpp" namespace { diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp index a3e446dd55..6813dd783f 100644 --- a/indexer/mwm_set.cpp +++ b/indexer/mwm_set.cpp @@ -9,6 +9,7 @@ #include "base/stl_add.hpp" #include "std/algorithm.hpp" +#include "std/exception.hpp" #include "std/sstream.hpp" #include "defines.hpp" diff --git a/indexer/old/feature_loader_101.cpp b/indexer/old/feature_loader_101.cpp index 55855b221d..b7c58ff7c5 100644 --- a/indexer/old/feature_loader_101.cpp +++ b/indexer/old/feature_loader_101.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "indexer/old/feature_loader_101.hpp" #include "indexer/classificator.hpp" diff --git a/indexer/rank_table.cpp b/indexer/rank_table.cpp index 80c3e687cc..a81a9cd35a 100644 --- a/indexer/rank_table.cpp +++ b/indexer/rank_table.cpp @@ -23,6 +23,7 @@ #include "base/logging.hpp" #include "base/macros.hpp" +#include "std/exception.hpp" #include "std/utility.hpp" #include "defines.hpp" diff --git a/indexer/search_delimiters.hpp b/indexer/search_delimiters.hpp index 2633bb7d7e..7a68da1731 100644 --- a/indexer/search_delimiters.hpp +++ b/indexer/search_delimiters.hpp @@ -2,6 +2,8 @@ #include "base/string_utils.hpp" +#include "std/vector.hpp" + namespace search { class Delimiters diff --git a/indexer/search_string_utils.hpp b/indexer/search_string_utils.hpp index d8f8af579f..f5a905e29e 100644 --- a/indexer/search_string_utils.hpp +++ b/indexer/search_string_utils.hpp @@ -3,6 +3,9 @@ #include "base/string_utils.hpp" #include "std/algorithm.hpp" +#include "std/functional.hpp" +#include "std/string.hpp" +#include "std/utility.hpp" namespace search { diff --git a/indexer/trie.hpp b/indexer/trie.hpp index 40031360cb..0f5405066c 100644 --- a/indexer/trie.hpp +++ b/indexer/trie.hpp @@ -18,7 +18,6 @@ uint32_t constexpr kDefaultChar = 0; template <typename TValueList> class Iterator { - // dbg::ObjectTracker m_tracker; public: using TValue = typename TValueList::TValue; diff --git a/indexer/trie_builder.hpp b/indexer/trie_builder.hpp index 9c7ff5a839..bf728c50da 100644 --- a/indexer/trie_builder.hpp +++ b/indexer/trie_builder.hpp @@ -9,6 +9,7 @@ #include "std/algorithm.hpp" #include "std/vector.hpp" +#include "std/utility.hpp" // Trie format: // [1: header] diff --git a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationCommon.mm b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationCommon.mm index b4973eadde..913c09d59c 100644 --- a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationCommon.mm +++ b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationCommon.mm @@ -26,7 +26,7 @@ void SetOSMUserNameWithCredentials(osm::TKeySecret const & keySecret) [ud setObject:@(api.GetUserPreferences().m_displayName.c_str()) forKey:kOSMUserName]; [ud synchronize]; } - catch (exception const & ex) + catch (std::exception const & ex) { LOG(LWARNING, ("Can't load user preferences from OSM server:", ex.what())); } diff --git a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationOSMLoginViewController.mm b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationOSMLoginViewController.mm index 4d78fb956a..175fffa0e4 100644 --- a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationOSMLoginViewController.mm +++ b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationOSMLoginViewController.mm @@ -136,7 +136,7 @@ using namespace osm; { auth.AuthorizePassword(username, password); } - catch (exception const & ex) + catch (std::exception const & ex) { LOG(LWARNING, ("Error login", ex.what())); [Statistics logEvent:@"Editor_Auth_request_result" diff --git a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationWebViewLoginViewController.mm b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationWebViewLoginViewController.mm index 0a85918c67..b1f0e9ea1e 100644 --- a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationWebViewLoginViewController.mm +++ b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationWebViewLoginViewController.mm @@ -92,7 +92,7 @@ NSString * getVerifier(NSString * urlString) [self.webView loadRequest:request]; }); } - catch (exception const & ex) + catch (std::exception const & ex) { dispatch_async(dispatch_get_main_queue(), ^{ [self stopSpinner]; @@ -138,7 +138,7 @@ NSString * getVerifier(NSString * urlString) { ks = auth.FinishAuthorization(self->m_requestToken, verifier.UTF8String); } - catch (exception const & ex) + catch (std::exception const & ex) { LOG(LWARNING, ("checkAuthorization error", ex.what())); [Statistics logEvent:@"Editor_Auth_request_result" diff --git a/iphone/Maps/Common/Statistics/fabric_logging.hpp b/iphone/Maps/Common/Statistics/fabric_logging.hpp index 26d3701331..a6637aae9c 100644 --- a/iphone/Maps/Common/Statistics/fabric_logging.hpp +++ b/iphone/Maps/Common/Statistics/fabric_logging.hpp @@ -2,7 +2,9 @@ #include "base/logging.hpp" +#include <string> + namespace platform { - void LogMessageFabric(my::LogLevel level, my::SrcPoint const & srcPoint, string const & msg); + void LogMessageFabric(my::LogLevel level, my::SrcPoint const & srcPoint, std::string const & msg); } diff --git a/iphone/Maps/Common/Statistics/fabric_logging_ios.mm b/iphone/Maps/Common/Statistics/fabric_logging_ios.mm index ba7f3851fa..5994651dcc 100644 --- a/iphone/Maps/Common/Statistics/fabric_logging_ios.mm +++ b/iphone/Maps/Common/Statistics/fabric_logging_ios.mm @@ -4,9 +4,9 @@ namespace platform { -void LogMessageFabric(my::LogLevel level, my::SrcPoint const & srcPoint, string const & msg) + void LogMessageFabric(my::LogLevel level, my::SrcPoint const & srcPoint, std::string const & msg) { - string recordType; + std::string recordType; switch (level) { case LINFO: recordType.assign("INFO "); break; @@ -16,7 +16,7 @@ void LogMessageFabric(my::LogLevel level, my::SrcPoint const & srcPoint, string case LCRITICAL: recordType.assign("FATAL "); break; } - string const srcString = recordType + DebugPrint(srcPoint) + " " + msg + "\n"; + std::string const srcString = recordType + DebugPrint(srcPoint) + " " + msg + "\n"; CLSLog(@"%@", @(srcString.c_str())); diff --git a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm index 4497a9af87..0e2ac1ce1c 100644 --- a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm +++ b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm @@ -138,7 +138,7 @@ using namespace osmoh; { if (!self.isSimpleMode) return; - stringstream sstr; + std::stringstream sstr; sstr << MakeOpeningHours(timeTableSet).GetRule(); self.delegate.openingHours = @(sstr.str().c_str()); } diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp index fe4c69f04f..b6bbaa955b 100644 --- a/map/feature_vec_model.cpp +++ b/map/feature_vec_model.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "map/feature_vec_model.hpp" #include "platform/platform.hpp" diff --git a/map/gps_track.cpp b/map/gps_track.cpp index f87e456f41..2dd6bd5dc3 100644 --- a/map/gps_track.cpp +++ b/map/gps_track.cpp @@ -3,6 +3,8 @@ #include "base/assert.hpp" #include "base/logging.hpp" +#include "std/algorithm.hpp" + namespace { diff --git a/map/mwm_url.hpp b/map/mwm_url.hpp index e1a6365530..3192ed7727 100644 --- a/map/mwm_url.hpp +++ b/map/mwm_url.hpp @@ -3,6 +3,7 @@ #include "geometry/rect2d.hpp" #include "std/string.hpp" +#include "std/vector.hpp" class ApiMarkPoint; class BookmarkManager; diff --git a/mapshot/mapshot.cpp b/mapshot/mapshot.cpp index 96534c515a..90035447b2 100644 --- a/mapshot/mapshot.cpp +++ b/mapshot/mapshot.cpp @@ -4,7 +4,9 @@ #include "base/string_utils.hpp" +#include "std/exception.hpp" #include "std/fstream.hpp" +#include "std/iomanip.hpp" #include "std/iostream.hpp" #include "std/string.hpp" diff --git a/partners_api/uber_api.cpp b/partners_api/uber_api.cpp index 52c96d1629..94345c4ed1 100644 --- a/partners_api/uber_api.cpp +++ b/partners_api/uber_api.cpp @@ -8,6 +8,7 @@ #include "base/thread.hpp" #include "std/iomanip.hpp" +#include "std/sstream.hpp" #include "3party/jansson/myjansson.hpp" diff --git a/platform/file_logging.cpp b/platform/file_logging.cpp index 79adb91426..34b65c220e 100644 --- a/platform/file_logging.cpp +++ b/platform/file_logging.cpp @@ -6,6 +6,8 @@ #include "platform/platform.hpp" +#include "std/sstream.hpp" + namespace { tm * GetLocalTime() diff --git a/platform/file_logging.hpp b/platform/file_logging.hpp index 4c801b8905..df716ae16d 100644 --- a/platform/file_logging.hpp +++ b/platform/file_logging.hpp @@ -2,6 +2,8 @@ #include "base/logging.hpp" +#include "std/string.hpp" + // @todo this functionality is not located in logging.hpp since file_logging uses FileWriter which depends on coding lib. // At the same time loging is located in base and I do not want base depens on several more libs. diff --git a/platform/http_client.hpp b/platform/http_client.hpp index d49a07ddda..9e323c7d57 100644 --- a/platform/http_client.hpp +++ b/platform/http_client.hpp @@ -27,6 +27,7 @@ SOFTWARE. #include "std/string.hpp" #include "std/unordered_map.hpp" +#include "std/utility.hpp" namespace platform { diff --git a/platform/http_request.cpp b/platform/http_request.cpp index af39a41a8a..a8f49ff7c9 100644 --- a/platform/http_request.cpp +++ b/platform/http_request.cpp @@ -15,6 +15,7 @@ #include "base/logging.hpp" #include "base/string_utils.hpp" +#include "std/list.hpp" #include "std/unique_ptr.hpp" #include "3party/Alohalytics/src/alohalytics.h" diff --git a/platform/platform_tests/measurement_tests.cpp b/platform/platform_tests/measurement_tests.cpp index 8f5f793e87..67beeef40f 100644 --- a/platform/platform_tests/measurement_tests.cpp +++ b/platform/platform_tests/measurement_tests.cpp @@ -3,6 +3,8 @@ #include "platform/measurement_utils.hpp" #include "platform/settings.hpp" +#include "std/utility.hpp" + using namespace measurement_utils; using namespace settings; diff --git a/platform/platform_tests_support/test_socket.hpp b/platform/platform_tests_support/test_socket.hpp index 66613791dd..45034d8e65 100644 --- a/platform/platform_tests_support/test_socket.hpp +++ b/platform/platform_tests_support/test_socket.hpp @@ -5,6 +5,7 @@ #include "std/atomic.hpp" #include "std/condition_variable.hpp" #include "std/cstdint.hpp" +#include "std/iterator.hpp" #include "std/deque.hpp" #include "std/mutex.hpp" #include "std/vector.hpp" diff --git a/platform/preferred_languages.cpp b/platform/preferred_languages.cpp index 77712b8e9d..df3ec168ff 100644 --- a/platform/preferred_languages.cpp +++ b/platform/preferred_languages.cpp @@ -6,6 +6,7 @@ #include "std/target_os.hpp" #include "std/set.hpp" +#include "std/vector.hpp" #if defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE) #include <CoreFoundation/CFLocale.h> diff --git a/qt/main.cpp b/qt/main.cpp index 4ddc143999..96c82e12e4 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -9,7 +9,6 @@ #include "base/logging.hpp" #include "base/macros.hpp" -#include "base/object_tracker.hpp" #include "std/cstdio.hpp" #include "std/cstdlib.hpp" @@ -106,8 +105,6 @@ int main(int argc, char * argv[]) returnCode = a.exec(); } - dbg::ObjectTracker::PrintLeaks(); - LOG_SHORT(LINFO, ("MapsWithMe finished with code", returnCode)); return returnCode; } diff --git a/qt/osm_auth_dialog.cpp b/qt/osm_auth_dialog.cpp index 8141717eab..6525d5b035 100644 --- a/qt/osm_auth_dialog.cpp +++ b/qt/osm_auth_dialog.cpp @@ -119,7 +119,7 @@ void OsmAuthDialog::OnAction() return; } } - catch (exception const & ex) + catch (std::exception const & ex) { setWindowTitle((string("Auth failed: ") + ex.what()).c_str()); return; diff --git a/qt/proxystyle.cpp b/qt/proxystyle.cpp index f1dd9970b2..05e21dfba0 100644 --- a/qt/proxystyle.cpp +++ b/qt/proxystyle.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "qt/proxystyle.hpp" diff --git a/qt/qtoglcontext.cpp b/qt/qtoglcontext.cpp index 3d7ac83df4..3bb75d15e1 100644 --- a/qt/qtoglcontext.cpp +++ b/qt/qtoglcontext.cpp @@ -32,7 +32,7 @@ void QtRenderOGLContext::present() m_resizeLock = false; GLFunctions::glFinish(); - swap(m_frontFrame, m_backFrame); + std::swap(m_frontFrame, m_backFrame); unlockFrame(); } diff --git a/qt/slider_ctrl.cpp b/qt/slider_ctrl.cpp index bda73f4c0f..5605b37a33 100644 --- a/qt/slider_ctrl.cpp +++ b/qt/slider_ctrl.cpp @@ -1,5 +1,3 @@ -#include "base/SRC_FIRST.hpp" - #include "qt/slider_ctrl.hpp" #include "qt/proxystyle.hpp" diff --git a/routing/routing_serialization.cpp b/routing/routing_serialization.cpp index d1e5a3a366..a64aa441ad 100644 --- a/routing/routing_serialization.cpp +++ b/routing/routing_serialization.cpp @@ -1,5 +1,7 @@ #include "routing/routing_serialization.hpp" +#include "std/sstream.hpp" + namespace { char const kNo[] = "No"; diff --git a/routing/turns.cpp b/routing/turns.cpp index c002bb1aaf..b5149dff6d 100644 --- a/routing/turns.cpp +++ b/routing/turns.cpp @@ -5,6 +5,7 @@ #include "base/internal/message.hpp" #include "std/array.hpp" +#include "std/utility.hpp" namespace diff --git a/routing/turns_notification_manager.cpp b/routing/turns_notification_manager.cpp index 2377fcd5c1..cd70c12c3a 100644 --- a/routing/turns_notification_manager.cpp +++ b/routing/turns_notification_manager.cpp @@ -2,6 +2,8 @@ #include "platform/location.hpp" +#include "std/algorithm.hpp" + namespace { // If the distance between two sequential turns is less than kMaxTurnDistM diff --git a/routing/turns_sound_settings.hpp b/routing/turns_sound_settings.hpp index d533708563..e5c70358d9 100644 --- a/routing/turns_sound_settings.hpp +++ b/routing/turns_sound_settings.hpp @@ -4,6 +4,7 @@ #include "platform/measurement_utils.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" namespace routing diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp index 60175a8134..568182a4c8 100644 --- a/routing/turns_tts_text.cpp +++ b/routing/turns_tts_text.cpp @@ -4,6 +4,7 @@ #include "base/string_utils.hpp" #include "std/algorithm.hpp" +#include "std/iterator.hpp" #include "std/string.hpp" #include "std/utility.hpp" diff --git a/search/cancel_exception.hpp b/search/cancel_exception.hpp index c4c1950083..191f9f150d 100644 --- a/search/cancel_exception.hpp +++ b/search/cancel_exception.hpp @@ -3,6 +3,8 @@ #include "base/cancellable.hpp" #include "base/exception.hpp" +#include "std/string.hpp" + namespace search { // This exception can be thrown from the deep darkness of search and diff --git a/search/geocoder.cpp b/search/geocoder.cpp index d5171f448a..4286646c6a 100644 --- a/search/geocoder.cpp +++ b/search/geocoder.cpp @@ -43,6 +43,7 @@ #include "std/sstream.hpp" #include "std/target_os.hpp" #include "std/transform_iterator.hpp" +#include "std/unique_ptr.hpp" #include "defines.hpp" @@ -560,7 +561,7 @@ void Geocoder::GoImpl(vector<shared_ptr<MwmInfo>> & infos, bool inViewport) auto it = m_matchersCache.find(m_context->GetId()); if (it == m_matchersCache.end()) { - it = m_matchersCache.insert(make_pair(m_context->GetId(), make_unique<FeaturesLayerMatcher>( + it = m_matchersCache.insert(make_pair(m_context->GetId(), my::make_unique<FeaturesLayerMatcher>( m_index, m_cancellable))) .first; } diff --git a/search/house_detector.cpp b/search/house_detector.cpp index 8e7dcf95c0..ddf83f9eee 100644 --- a/search/house_detector.cpp +++ b/search/house_detector.cpp @@ -15,6 +15,7 @@ #include "base/stl_iterator.hpp" #include "std/bind.hpp" +#include "std/exception.hpp" #include "std/numeric.hpp" #include "std/set.hpp" #include "std/string.hpp" diff --git a/search/house_numbers_matcher.hpp b/search/house_numbers_matcher.hpp index 55ab8eaa38..1aa47d8d18 100644 --- a/search/house_numbers_matcher.hpp +++ b/search/house_numbers_matcher.hpp @@ -4,6 +4,7 @@ #include "std/string.hpp" #include "std/vector.hpp" +#include "std/utility.hpp" namespace search { diff --git a/search/intermediate_result.hpp b/search/intermediate_result.hpp index f0c3db181a..790d23ec4f 100644 --- a/search/intermediate_result.hpp +++ b/search/intermediate_result.hpp @@ -7,6 +7,8 @@ #include "indexer/feature_data.hpp" +#include "std/set.hpp" + class FeatureType; class CategoriesHolder; diff --git a/search/keyword_lang_matcher.cpp b/search/keyword_lang_matcher.cpp index 2742e9f035..dea70e4e6e 100644 --- a/search/keyword_lang_matcher.cpp +++ b/search/keyword_lang_matcher.cpp @@ -6,6 +6,8 @@ #include "base/stl_add.hpp" #include "std/algorithm.hpp" +#include "std/limits.hpp" +#include "std/sstream.hpp" namespace search diff --git a/search/keyword_lang_matcher.hpp b/search/keyword_lang_matcher.hpp index dac86d2ca3..eb11f9f424 100644 --- a/search/keyword_lang_matcher.hpp +++ b/search/keyword_lang_matcher.hpp @@ -1,6 +1,7 @@ #pragma once #include "search/keyword_matcher.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" namespace search diff --git a/search/keyword_matcher.cpp b/search/keyword_matcher.cpp index 107f99befb..3b7ddcee60 100644 --- a/search/keyword_matcher.cpp +++ b/search/keyword_matcher.cpp @@ -6,6 +6,7 @@ #include "base/stl_add.hpp" #include "std/algorithm.hpp" +#include "std/sstream.hpp" namespace search { diff --git a/search/string_intersection.hpp b/search/string_intersection.hpp index f1548bb29e..52b329dc3f 100644 --- a/search/string_intersection.hpp +++ b/search/string_intersection.hpp @@ -2,6 +2,8 @@ #include "indexer/search_delimiters.hpp" +#include "std/utility.hpp" + namespace search { template <typename LowTokensIterType, typename F> diff --git a/storage/country.hpp b/storage/country.hpp index 1dd8953a2c..b17d4dcb25 100644 --- a/storage/country.hpp +++ b/storage/country.hpp @@ -13,6 +13,7 @@ #include "geometry/rect2d.hpp" +#include "std/unordered_map.hpp" #include "std/string.hpp" #include "std/vector.hpp" diff --git a/storage/country_tree.hpp b/storage/country_tree.hpp index 9f53a3924b..b3faa71191 100644 --- a/storage/country_tree.hpp +++ b/storage/country_tree.hpp @@ -3,6 +3,7 @@ #include "base/assert.hpp" #include "std/algorithm.hpp" +#include "std/map.hpp" #include "std/unique_ptr.hpp" #include "std/vector.hpp" diff --git a/storage/storage_tests/storage_tests.cpp b/storage/storage_tests/storage_tests.cpp index 5c99283e74..316ee1a904 100644 --- a/storage/storage_tests/storage_tests.cpp +++ b/storage/storage_tests/storage_tests.cpp @@ -43,6 +43,7 @@ #include "std/bind.hpp" #include "std/condition_variable.hpp" +#include "std/exception.hpp" #include "std/map.hpp" #include "std/mutex.hpp" #include "std/shared_ptr.hpp" diff --git a/tracking/connection.cpp b/tracking/connection.cpp index 15e6750041..d9e13304c7 100644 --- a/tracking/connection.cpp +++ b/tracking/connection.cpp @@ -37,10 +37,10 @@ bool Connection::Reconnect() if (!m_socket->Write(packet.data(), static_cast<uint32_t>(packet.size()))) return false; - string check(begin(Protocol::kFail), end(Protocol::kFail)); + std::string check(std::begin(Protocol::kFail), std::end(Protocol::kFail)); bool const isSuccess = m_socket->Read(reinterpret_cast<uint8_t *>(&check[0]), static_cast<uint32_t>(check.size())); - if (!isSuccess || check != string(begin(Protocol::kOk), end(Protocol::kOk))) + if (!isSuccess || check != std::string(std::begin(Protocol::kOk), std::end(Protocol::kOk))) return false; return true; diff --git a/tracking/protocol.cpp b/tracking/protocol.cpp index c0cfab40c0..8a2fa90374 100644 --- a/tracking/protocol.cpp +++ b/tracking/protocol.cpp @@ -7,6 +7,7 @@ #include "std/cstdint.hpp" #include "std/sstream.hpp" +#include "std/utility.hpp" namespace { diff --git a/tracking/protocol.hpp b/tracking/protocol.hpp index ed386bfffe..f351dad98c 100644 --- a/tracking/protocol.hpp +++ b/tracking/protocol.hpp @@ -33,7 +33,7 @@ public: static vector<uint8_t> CreateDataPacket(DataElementsCirc const & points); static vector<uint8_t> CreateDataPacket(DataElementsVec const & points); - static pair<PacketType, size_t> DecodeHeader(vector<uint8_t> const & data); + static std::pair<PacketType, size_t> DecodeHeader(vector<uint8_t> const & data); static string DecodeAuthPacket(PacketType type, vector<uint8_t> const & data); static DataElementsVec DecodeDataPacket(PacketType type, vector<uint8_t> const & data); diff --git a/tracking/reporter.hpp b/tracking/reporter.hpp index 7eb1ce3f6d..18cac8a89a 100644 --- a/tracking/reporter.hpp +++ b/tracking/reporter.hpp @@ -4,8 +4,10 @@ #include "base/thread.hpp" +#include "std/atomic.hpp" #include "std/chrono.hpp" #include "std/condition_variable.hpp" +#include "std/function.hpp" #include "std/mutex.hpp" #include "std/string.hpp" #include "std/unique_ptr.hpp" diff --git a/xcode/base/base.xcodeproj/project.pbxproj b/xcode/base/base.xcodeproj/project.pbxproj index 4ceac4a860..98b89eb881 100644 --- a/xcode/base/base.xcodeproj/project.pbxproj +++ b/xcode/base/base.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ 39FD27221CC65AD000AFF551 /* cache_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26CC1CC65A0E00AFF551 /* cache_test.cpp */; }; 39FD27231CC65AD000AFF551 /* collection_cast_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26CD1CC65A0E00AFF551 /* collection_cast_test.cpp */; }; 39FD27241CC65AD000AFF551 /* condition_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26CE1CC65A0E00AFF551 /* condition_test.cpp */; }; - 39FD27251CC65AD000AFF551 /* const_helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26CF1CC65A0E00AFF551 /* const_helper.cpp */; }; 39FD27261CC65AD000AFF551 /* containers_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26D01CC65A0E00AFF551 /* containers_test.cpp */; }; 39FD27271CC65AD000AFF551 /* logging_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26D11CC65A0E00AFF551 /* logging_test.cpp */; }; 39FD27281CC65AD000AFF551 /* math_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26D21CC65A0E00AFF551 /* math_test.cpp */; }; @@ -44,12 +43,21 @@ 39FD27371CC65AD000AFF551 /* threads_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26E11CC65A0E00AFF551 /* threads_test.cpp */; }; 39FD27381CC65AD000AFF551 /* timegm_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26E21CC65A0E00AFF551 /* timegm_test.cpp */; }; 39FD27391CC65AD000AFF551 /* timer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26E31CC65A0E00AFF551 /* timer_test.cpp */; }; - 39FD273A1CC65AD000AFF551 /* worker_thread_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FD26E41CC65A0E00AFF551 /* worker_thread_test.cpp */; }; 39FD273B1CC65B1000AFF551 /* libbase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 675341771A3F57BF00A0A8C3 /* libbase.a */; }; 670E39441C46C76900E9C0A6 /* sunrise_sunset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670E39421C46C76900E9C0A6 /* sunrise_sunset.cpp */; }; 670E39451C46C76900E9C0A6 /* sunrise_sunset.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670E39431C46C76900E9C0A6 /* sunrise_sunset.hpp */; }; 671182F01C807C0A00CB8177 /* gmtime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 671182EE1C807C0A00CB8177 /* gmtime.cpp */; }; 671182F11C807C0A00CB8177 /* gmtime.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 671182EF1C807C0A00CB8177 /* gmtime.hpp */; }; + 672DD4BE1E0425600078E13C /* cancellable.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B01E04255F0078E13C /* cancellable.hpp */; }; + 672DD4BF1E0425600078E13C /* collection_cast.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B11E04255F0078E13C /* collection_cast.hpp */; }; + 672DD4C11E0425600078E13C /* condition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 672DD4B31E04255F0078E13C /* condition.cpp */; }; + 672DD4C21E0425600078E13C /* condition.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B41E04255F0078E13C /* condition.hpp */; }; + 672DD4C31E0425600078E13C /* mem_trie.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B51E04255F0078E13C /* mem_trie.hpp */; }; + 672DD4C41E0425600078E13C /* newtype.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B61E04255F0078E13C /* newtype.hpp */; }; + 672DD4C51E0425600078E13C /* observer_list.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B71E04255F0078E13C /* observer_list.hpp */; }; + 672DD4C61E0425600078E13C /* range_iterator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B81E0425600078E13C /* range_iterator.hpp */; }; + 672DD4C71E0425600078E13C /* ref_counted.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4B91E0425600078E13C /* ref_counted.hpp */; }; + 672DD4C81E0425600078E13C /* stl_helpers.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 672DD4BA1E0425600078E13C /* stl_helpers.hpp */; }; 674A7E2E1C0DB03D003D48E1 /* timegm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 674A7E2C1C0DB03D003D48E1 /* timegm.cpp */; }; 674A7E2F1C0DB03D003D48E1 /* timegm.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 674A7E2D1C0DB03D003D48E1 /* timegm.hpp */; }; 675341CB1A3F57E400A0A8C3 /* array_adapters.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341851A3F57E400A0A8C3 /* array_adapters.hpp */; }; @@ -59,11 +67,6 @@ 675341CF1A3F57E400A0A8C3 /* bits.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341891A3F57E400A0A8C3 /* bits.hpp */; }; 675341D01A3F57E400A0A8C3 /* buffer_vector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753418A1A3F57E400A0A8C3 /* buffer_vector.hpp */; }; 675341D11A3F57E400A0A8C3 /* cache.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753418B1A3F57E400A0A8C3 /* cache.hpp */; }; - 675341D41A3F57E400A0A8C3 /* condition_bada.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6753418E1A3F57E400A0A8C3 /* condition_bada.cpp */; }; - 675341D61A3F57E400A0A8C3 /* condition_windows_native.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341901A3F57E400A0A8C3 /* condition_windows_native.cpp */; }; - 675341D71A3F57E400A0A8C3 /* condition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341911A3F57E400A0A8C3 /* condition.cpp */; }; - 675341D81A3F57E400A0A8C3 /* condition.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341921A3F57E400A0A8C3 /* condition.hpp */; }; - 675341D91A3F57E400A0A8C3 /* const_helper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341931A3F57E400A0A8C3 /* const_helper.hpp */; }; 675341DA1A3F57E400A0A8C3 /* exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341941A3F57E400A0A8C3 /* exception.cpp */; }; 675341DB1A3F57E400A0A8C3 /* exception.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341951A3F57E400A0A8C3 /* exception.hpp */; }; 675341DE1A3F57E400A0A8C3 /* limited_priority_queue.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341991A3F57E400A0A8C3 /* limited_priority_queue.hpp */; }; @@ -75,14 +78,11 @@ 675341E41A3F57E400A0A8C3 /* matrix.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6753419F1A3F57E400A0A8C3 /* matrix.hpp */; }; 675341E61A3F57E400A0A8C3 /* mutex.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341A11A3F57E400A0A8C3 /* mutex.hpp */; }; 675341E71A3F57E400A0A8C3 /* normalize_unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341A21A3F57E400A0A8C3 /* normalize_unicode.cpp */; }; - 675341E81A3F57E400A0A8C3 /* object_tracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341A31A3F57E400A0A8C3 /* object_tracker.cpp */; }; - 675341E91A3F57E400A0A8C3 /* object_tracker.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341A41A3F57E400A0A8C3 /* object_tracker.hpp */; }; 675341EF1A3F57E400A0A8C3 /* rolling_hash.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341AA1A3F57E400A0A8C3 /* rolling_hash.hpp */; }; 675341F41A3F57E400A0A8C3 /* scope_guard.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341AF1A3F57E400A0A8C3 /* scope_guard.hpp */; }; 675341F51A3F57E400A0A8C3 /* set_operations.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341B01A3F57E400A0A8C3 /* set_operations.hpp */; }; 675341F61A3F57E400A0A8C3 /* shared_buffer_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341B11A3F57E400A0A8C3 /* shared_buffer_manager.cpp */; }; 675341F71A3F57E400A0A8C3 /* shared_buffer_manager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341B21A3F57E400A0A8C3 /* shared_buffer_manager.hpp */; }; - 675341F81A3F57E400A0A8C3 /* SRC_FIRST.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341B31A3F57E400A0A8C3 /* SRC_FIRST.hpp */; }; 675341F91A3F57E400A0A8C3 /* src_point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341B41A3F57E400A0A8C3 /* src_point.cpp */; }; 675341FA1A3F57E400A0A8C3 /* src_point.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341B51A3F57E400A0A8C3 /* src_point.hpp */; }; 675341FB1A3F57E400A0A8C3 /* stats.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341B61A3F57E400A0A8C3 /* stats.hpp */; }; @@ -95,7 +95,6 @@ 675342021A3F57E400A0A8C3 /* string_utils.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341BD1A3F57E400A0A8C3 /* string_utils.hpp */; }; 675342031A3F57E400A0A8C3 /* strings_bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341BE1A3F57E400A0A8C3 /* strings_bundle.cpp */; }; 675342041A3F57E400A0A8C3 /* strings_bundle.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341BF1A3F57E400A0A8C3 /* strings_bundle.hpp */; }; - 675342051A3F57E400A0A8C3 /* swap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341C01A3F57E400A0A8C3 /* swap.hpp */; }; 675342061A3F57E400A0A8C3 /* thread_pool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341C11A3F57E400A0A8C3 /* thread_pool.cpp */; }; 675342071A3F57E400A0A8C3 /* thread_pool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341C21A3F57E400A0A8C3 /* thread_pool.hpp */; }; 675342081A3F57E400A0A8C3 /* thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341C31A3F57E400A0A8C3 /* thread.cpp */; }; @@ -103,7 +102,6 @@ 6753420A1A3F57E400A0A8C3 /* threaded_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341C51A3F57E400A0A8C3 /* threaded_container.cpp */; }; 6753420B1A3F57E400A0A8C3 /* threaded_container.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341C61A3F57E400A0A8C3 /* threaded_container.hpp */; }; 6753420C1A3F57E400A0A8C3 /* threaded_list.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341C71A3F57E400A0A8C3 /* threaded_list.hpp */; }; - 6753420D1A3F57E400A0A8C3 /* threaded_priority_queue.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341C81A3F57E400A0A8C3 /* threaded_priority_queue.hpp */; }; 6753420E1A3F57E400A0A8C3 /* timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675341C91A3F57E400A0A8C3 /* timer.cpp */; }; 6753420F1A3F57E400A0A8C3 /* timer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675341CA1A3F57E400A0A8C3 /* timer.hpp */; }; 6753453D1A3F6F6A00A0A8C3 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6753453A1A3F6F6A00A0A8C3 /* message.cpp */; }; @@ -132,7 +130,6 @@ 39FD26CC1CC65A0E00AFF551 /* cache_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cache_test.cpp; sourceTree = "<group>"; }; 39FD26CD1CC65A0E00AFF551 /* collection_cast_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collection_cast_test.cpp; sourceTree = "<group>"; }; 39FD26CE1CC65A0E00AFF551 /* condition_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition_test.cpp; sourceTree = "<group>"; }; - 39FD26CF1CC65A0E00AFF551 /* const_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = const_helper.cpp; sourceTree = "<group>"; }; 39FD26D01CC65A0E00AFF551 /* containers_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = containers_test.cpp; sourceTree = "<group>"; }; 39FD26D11CC65A0E00AFF551 /* logging_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logging_test.cpp; sourceTree = "<group>"; }; 39FD26D21CC65A0E00AFF551 /* math_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = math_test.cpp; sourceTree = "<group>"; }; @@ -153,7 +150,6 @@ 39FD26E11CC65A0E00AFF551 /* threads_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = threads_test.cpp; sourceTree = "<group>"; }; 39FD26E21CC65A0E00AFF551 /* timegm_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timegm_test.cpp; sourceTree = "<group>"; }; 39FD26E31CC65A0E00AFF551 /* timer_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timer_test.cpp; sourceTree = "<group>"; }; - 39FD26E41CC65A0E00AFF551 /* worker_thread_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = worker_thread_test.cpp; sourceTree = "<group>"; }; 39FD27011CC65A2800AFF551 /* testingmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testingmain.cpp; path = ../../testing/testingmain.cpp; sourceTree = "<group>"; }; 39FD27071CC65A7100AFF551 /* base_tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = base_tests.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39FD273C1CC65B1000AFF551 /* libplatform_tests_support.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplatform_tests_support.a; path = "../../../omim-xcode-build/Debug/libplatform_tests_support.a"; sourceTree = "<group>"; }; @@ -164,6 +160,16 @@ 670E39431C46C76900E9C0A6 /* sunrise_sunset.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sunrise_sunset.hpp; sourceTree = "<group>"; }; 671182EE1C807C0A00CB8177 /* gmtime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gmtime.cpp; sourceTree = "<group>"; }; 671182EF1C807C0A00CB8177 /* gmtime.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gmtime.hpp; sourceTree = "<group>"; }; + 672DD4B01E04255F0078E13C /* cancellable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cancellable.hpp; sourceTree = "<group>"; }; + 672DD4B11E04255F0078E13C /* collection_cast.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = collection_cast.hpp; sourceTree = "<group>"; }; + 672DD4B31E04255F0078E13C /* condition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition.cpp; sourceTree = "<group>"; }; + 672DD4B41E04255F0078E13C /* condition.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = condition.hpp; sourceTree = "<group>"; }; + 672DD4B51E04255F0078E13C /* mem_trie.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_trie.hpp; sourceTree = "<group>"; }; + 672DD4B61E04255F0078E13C /* newtype.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = newtype.hpp; sourceTree = "<group>"; }; + 672DD4B71E04255F0078E13C /* observer_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = observer_list.hpp; sourceTree = "<group>"; }; + 672DD4B81E0425600078E13C /* range_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = range_iterator.hpp; sourceTree = "<group>"; }; + 672DD4B91E0425600078E13C /* ref_counted.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ref_counted.hpp; sourceTree = "<group>"; }; + 672DD4BA1E0425600078E13C /* stl_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stl_helpers.hpp; sourceTree = "<group>"; }; 674A7E2C1C0DB03D003D48E1 /* timegm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timegm.cpp; sourceTree = "<group>"; }; 674A7E2D1C0DB03D003D48E1 /* timegm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = timegm.hpp; sourceTree = "<group>"; }; 675341771A3F57BF00A0A8C3 /* libbase.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbase.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -174,11 +180,6 @@ 675341891A3F57E400A0A8C3 /* bits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bits.hpp; sourceTree = "<group>"; }; 6753418A1A3F57E400A0A8C3 /* buffer_vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = buffer_vector.hpp; sourceTree = "<group>"; }; 6753418B1A3F57E400A0A8C3 /* cache.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cache.hpp; sourceTree = "<group>"; }; - 6753418E1A3F57E400A0A8C3 /* condition_bada.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition_bada.cpp; sourceTree = "<group>"; }; - 675341901A3F57E400A0A8C3 /* condition_windows_native.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition_windows_native.cpp; sourceTree = "<group>"; }; - 675341911A3F57E400A0A8C3 /* condition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition.cpp; sourceTree = "<group>"; }; - 675341921A3F57E400A0A8C3 /* condition.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = condition.hpp; sourceTree = "<group>"; }; - 675341931A3F57E400A0A8C3 /* const_helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = const_helper.hpp; sourceTree = "<group>"; }; 675341941A3F57E400A0A8C3 /* exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exception.cpp; sourceTree = "<group>"; }; 675341951A3F57E400A0A8C3 /* exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = exception.hpp; sourceTree = "<group>"; }; 675341991A3F57E400A0A8C3 /* limited_priority_queue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = limited_priority_queue.hpp; sourceTree = "<group>"; }; @@ -190,14 +191,11 @@ 6753419F1A3F57E400A0A8C3 /* matrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = matrix.hpp; sourceTree = "<group>"; }; 675341A11A3F57E400A0A8C3 /* mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mutex.hpp; sourceTree = "<group>"; }; 675341A21A3F57E400A0A8C3 /* normalize_unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = normalize_unicode.cpp; sourceTree = "<group>"; }; - 675341A31A3F57E400A0A8C3 /* object_tracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_tracker.cpp; sourceTree = "<group>"; }; - 675341A41A3F57E400A0A8C3 /* object_tracker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = object_tracker.hpp; sourceTree = "<group>"; }; 675341AA1A3F57E400A0A8C3 /* rolling_hash.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rolling_hash.hpp; sourceTree = "<group>"; }; 675341AF1A3F57E400A0A8C3 /* scope_guard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scope_guard.hpp; sourceTree = "<group>"; }; 675341B01A3F57E400A0A8C3 /* set_operations.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_operations.hpp; sourceTree = "<group>"; }; 675341B11A3F57E400A0A8C3 /* shared_buffer_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared_buffer_manager.cpp; sourceTree = "<group>"; }; 675341B21A3F57E400A0A8C3 /* shared_buffer_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_buffer_manager.hpp; sourceTree = "<group>"; }; - 675341B31A3F57E400A0A8C3 /* SRC_FIRST.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SRC_FIRST.hpp; sourceTree = "<group>"; }; 675341B41A3F57E400A0A8C3 /* src_point.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = src_point.cpp; sourceTree = "<group>"; }; 675341B51A3F57E400A0A8C3 /* src_point.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = src_point.hpp; sourceTree = "<group>"; }; 675341B61A3F57E400A0A8C3 /* stats.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stats.hpp; sourceTree = "<group>"; }; @@ -210,7 +208,6 @@ 675341BD1A3F57E400A0A8C3 /* string_utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = string_utils.hpp; sourceTree = "<group>"; }; 675341BE1A3F57E400A0A8C3 /* strings_bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strings_bundle.cpp; sourceTree = "<group>"; }; 675341BF1A3F57E400A0A8C3 /* strings_bundle.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = strings_bundle.hpp; sourceTree = "<group>"; }; - 675341C01A3F57E400A0A8C3 /* swap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = swap.hpp; sourceTree = "<group>"; }; 675341C11A3F57E400A0A8C3 /* thread_pool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thread_pool.cpp; sourceTree = "<group>"; }; 675341C21A3F57E400A0A8C3 /* thread_pool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = thread_pool.hpp; sourceTree = "<group>"; }; 675341C31A3F57E400A0A8C3 /* thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thread.cpp; sourceTree = "<group>"; }; @@ -218,7 +215,6 @@ 675341C51A3F57E400A0A8C3 /* threaded_container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = threaded_container.cpp; sourceTree = "<group>"; }; 675341C61A3F57E400A0A8C3 /* threaded_container.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = threaded_container.hpp; sourceTree = "<group>"; }; 675341C71A3F57E400A0A8C3 /* threaded_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = threaded_list.hpp; sourceTree = "<group>"; }; - 675341C81A3F57E400A0A8C3 /* threaded_priority_queue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = threaded_priority_queue.hpp; sourceTree = "<group>"; }; 675341C91A3F57E400A0A8C3 /* timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timer.cpp; sourceTree = "<group>"; }; 675341CA1A3F57E400A0A8C3 /* timer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = timer.hpp; sourceTree = "<group>"; }; 6753453A1A3F6F6A00A0A8C3 /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = "<group>"; }; @@ -262,7 +258,6 @@ 39FD26CC1CC65A0E00AFF551 /* cache_test.cpp */, 39FD26CD1CC65A0E00AFF551 /* collection_cast_test.cpp */, 39FD26CE1CC65A0E00AFF551 /* condition_test.cpp */, - 39FD26CF1CC65A0E00AFF551 /* const_helper.cpp */, 39FD26D01CC65A0E00AFF551 /* containers_test.cpp */, 39FD26D11CC65A0E00AFF551 /* logging_test.cpp */, 39FD26D21CC65A0E00AFF551 /* math_test.cpp */, @@ -283,7 +278,6 @@ 39FD26E11CC65A0E00AFF551 /* threads_test.cpp */, 39FD26E21CC65A0E00AFF551 /* timegm_test.cpp */, 39FD26E31CC65A0E00AFF551 /* timer_test.cpp */, - 39FD26E41CC65A0E00AFF551 /* worker_thread_test.cpp */, ); name = base_tests; path = ../../base/base_tests; @@ -313,6 +307,16 @@ 675341791A3F57BF00A0A8C3 /* base */ = { isa = PBXGroup; children = ( + 672DD4B01E04255F0078E13C /* cancellable.hpp */, + 672DD4B11E04255F0078E13C /* collection_cast.hpp */, + 672DD4B31E04255F0078E13C /* condition.cpp */, + 672DD4B41E04255F0078E13C /* condition.hpp */, + 672DD4B51E04255F0078E13C /* mem_trie.hpp */, + 672DD4B61E04255F0078E13C /* newtype.hpp */, + 672DD4B71E04255F0078E13C /* observer_list.hpp */, + 672DD4B81E0425600078E13C /* range_iterator.hpp */, + 672DD4B91E0425600078E13C /* ref_counted.hpp */, + 672DD4BA1E0425600078E13C /* stl_helpers.hpp */, 3446C66C1DDCA96300146687 /* dfa_helpers.hpp */, 3446C66D1DDCA96300146687 /* levenshtein_dfa.cpp */, 3446C66E1DDCA96300146687 /* levenshtein_dfa.hpp */, @@ -334,11 +338,6 @@ 675341891A3F57E400A0A8C3 /* bits.hpp */, 6753418A1A3F57E400A0A8C3 /* buffer_vector.hpp */, 6753418B1A3F57E400A0A8C3 /* cache.hpp */, - 6753418E1A3F57E400A0A8C3 /* condition_bada.cpp */, - 675341901A3F57E400A0A8C3 /* condition_windows_native.cpp */, - 675341911A3F57E400A0A8C3 /* condition.cpp */, - 675341921A3F57E400A0A8C3 /* condition.hpp */, - 675341931A3F57E400A0A8C3 /* const_helper.hpp */, 675341941A3F57E400A0A8C3 /* exception.cpp */, 675341951A3F57E400A0A8C3 /* exception.hpp */, 675341991A3F57E400A0A8C3 /* limited_priority_queue.hpp */, @@ -350,14 +349,11 @@ 6753419F1A3F57E400A0A8C3 /* matrix.hpp */, 675341A11A3F57E400A0A8C3 /* mutex.hpp */, 675341A21A3F57E400A0A8C3 /* normalize_unicode.cpp */, - 675341A31A3F57E400A0A8C3 /* object_tracker.cpp */, - 675341A41A3F57E400A0A8C3 /* object_tracker.hpp */, 675341AA1A3F57E400A0A8C3 /* rolling_hash.hpp */, 675341AF1A3F57E400A0A8C3 /* scope_guard.hpp */, 675341B01A3F57E400A0A8C3 /* set_operations.hpp */, 675341B11A3F57E400A0A8C3 /* shared_buffer_manager.cpp */, 675341B21A3F57E400A0A8C3 /* shared_buffer_manager.hpp */, - 675341B31A3F57E400A0A8C3 /* SRC_FIRST.hpp */, 675341B41A3F57E400A0A8C3 /* src_point.cpp */, 675341B51A3F57E400A0A8C3 /* src_point.hpp */, 675341B61A3F57E400A0A8C3 /* stats.hpp */, @@ -370,7 +366,6 @@ 675341BD1A3F57E400A0A8C3 /* string_utils.hpp */, 675341BE1A3F57E400A0A8C3 /* strings_bundle.cpp */, 675341BF1A3F57E400A0A8C3 /* strings_bundle.hpp */, - 675341C01A3F57E400A0A8C3 /* swap.hpp */, 675341C11A3F57E400A0A8C3 /* thread_pool.cpp */, 675341C21A3F57E400A0A8C3 /* thread_pool.hpp */, 675341C31A3F57E400A0A8C3 /* thread.cpp */, @@ -378,7 +373,6 @@ 675341C51A3F57E400A0A8C3 /* threaded_container.cpp */, 675341C61A3F57E400A0A8C3 /* threaded_container.hpp */, 675341C71A3F57E400A0A8C3 /* threaded_list.hpp */, - 675341C81A3F57E400A0A8C3 /* threaded_priority_queue.hpp */, 675341C91A3F57E400A0A8C3 /* timer.cpp */, 675341CA1A3F57E400A0A8C3 /* timer.hpp */, 67A609AC1C88642E001E641A /* deferred_task.cpp */, @@ -416,25 +410,26 @@ buildActionMask = 2147483647; files = ( 675341CF1A3F57E400A0A8C3 /* bits.hpp in Headers */, + 672DD4C71E0425600078E13C /* ref_counted.hpp in Headers */, 675341E61A3F57E400A0A8C3 /* mutex.hpp in Headers */, 675341D11A3F57E400A0A8C3 /* cache.hpp in Headers */, 675341E31A3F57E400A0A8C3 /* math.hpp in Headers */, 3446C6731DDCA96300146687 /* levenshtein_dfa.hpp in Headers */, 675341E21A3F57E400A0A8C3 /* macros.hpp in Headers */, - 6753420D1A3F57E400A0A8C3 /* threaded_priority_queue.hpp in Headers */, + 672DD4C51E0425600078E13C /* observer_list.hpp in Headers */, 675341EF1A3F57E400A0A8C3 /* rolling_hash.hpp in Headers */, 671182F11C807C0A00CB8177 /* gmtime.hpp in Headers */, 67A609AF1C88642E001E641A /* deferred_task.hpp in Headers */, 675342021A3F57E400A0A8C3 /* string_utils.hpp in Headers */, 675341E41A3F57E400A0A8C3 /* matrix.hpp in Headers */, - 675341D81A3F57E400A0A8C3 /* condition.hpp in Headers */, 670E39451C46C76900E9C0A6 /* sunrise_sunset.hpp in Headers */, - 675341E91A3F57E400A0A8C3 /* object_tracker.hpp in Headers */, 675341F51A3F57E400A0A8C3 /* set_operations.hpp in Headers */, 675342041A3F57E400A0A8C3 /* strings_bundle.hpp in Headers */, + 672DD4C81E0425600078E13C /* stl_helpers.hpp in Headers */, 675341CE1A3F57E400A0A8C3 /* base.hpp in Headers */, 675342001A3F57E400A0A8C3 /* string_format.hpp in Headers */, 675341F41A3F57E400A0A8C3 /* scope_guard.hpp in Headers */, + 672DD4BF1E0425600078E13C /* collection_cast.hpp in Headers */, 675342071A3F57E400A0A8C3 /* thread_pool.hpp in Headers */, 3446C6711DDCA96300146687 /* dfa_helpers.hpp in Headers */, 6753420C1A3F57E400A0A8C3 /* threaded_list.hpp in Headers */, @@ -446,19 +441,21 @@ 675342091A3F57E400A0A8C3 /* thread.hpp in Headers */, 675341CC1A3F57E400A0A8C3 /* assert.hpp in Headers */, 675341E01A3F57E400A0A8C3 /* logging.hpp in Headers */, - 675341D91A3F57E400A0A8C3 /* const_helper.hpp in Headers */, 675341FB1A3F57E400A0A8C3 /* stats.hpp in Headers */, 675341DE1A3F57E400A0A8C3 /* limited_priority_queue.hpp in Headers */, 675341FE1A3F57E400A0A8C3 /* stl_iterator.hpp in Headers */, 675341FA1A3F57E400A0A8C3 /* src_point.hpp in Headers */, 674A7E2F1C0DB03D003D48E1 /* timegm.hpp in Headers */, - 675341F81A3F57E400A0A8C3 /* SRC_FIRST.hpp in Headers */, 675341F71A3F57E400A0A8C3 /* shared_buffer_manager.hpp in Headers */, 67B52B611AD3C84E00664C17 /* thread_checker.hpp in Headers */, + 672DD4BE1E0425600078E13C /* cancellable.hpp in Headers */, 675341CB1A3F57E400A0A8C3 /* array_adapters.hpp in Headers */, 3446C6751DDCA96300146687 /* uni_string_dfa.hpp in Headers */, 6753420B1A3F57E400A0A8C3 /* threaded_container.hpp in Headers */, - 675342051A3F57E400A0A8C3 /* swap.hpp in Headers */, + 672DD4C21E0425600078E13C /* condition.hpp in Headers */, + 672DD4C41E0425600078E13C /* newtype.hpp in Headers */, + 672DD4C31E0425600078E13C /* mem_trie.hpp in Headers */, + 672DD4C61E0425600078E13C /* range_iterator.hpp in Headers */, 675341FD1A3F57E400A0A8C3 /* stl_add.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -571,7 +568,6 @@ 39FD27361CC65AD000AFF551 /* threaded_list_test.cpp in Sources */, 39FD272B1CC65AD000AFF551 /* observer_list_test.cpp in Sources */, 39FD27371CC65AD000AFF551 /* threads_test.cpp in Sources */, - 39FD273A1CC65AD000AFF551 /* worker_thread_test.cpp in Sources */, 39FD27331CC65AD000AFF551 /* string_utils_test.cpp in Sources */, 39FD27311CC65AD000AFF551 /* stl_helpers_test.cpp in Sources */, 3446C6831DDCAA7800146687 /* ref_counted_tests.cpp in Sources */, @@ -583,7 +579,6 @@ 39FD27291CC65AD000AFF551 /* matrix_test.cpp in Sources */, 39FD272F1CC65AD000AFF551 /* scope_guard_test.cpp in Sources */, 39FD27281CC65AD000AFF551 /* math_test.cpp in Sources */, - 39FD27251CC65AD000AFF551 /* const_helper.cpp in Sources */, 39FD27271CC65AD000AFF551 /* logging_test.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -592,13 +587,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 675341D61A3F57E400A0A8C3 /* condition_windows_native.cpp in Sources */, 3446C6741DDCA96300146687 /* uni_string_dfa.cpp in Sources */, 3446C6721DDCA96300146687 /* levenshtein_dfa.cpp in Sources */, 6753453D1A3F6F6A00A0A8C3 /* message.cpp in Sources */, 675342081A3F57E400A0A8C3 /* thread.cpp in Sources */, 675342061A3F57E400A0A8C3 /* thread_pool.cpp in Sources */, - 675341D41A3F57E400A0A8C3 /* condition_bada.cpp in Sources */, 670E39441C46C76900E9C0A6 /* sunrise_sunset.cpp in Sources */, 6753420E1A3F57E400A0A8C3 /* timer.cpp in Sources */, 675341F61A3F57E400A0A8C3 /* shared_buffer_manager.cpp in Sources */, @@ -606,7 +599,6 @@ 675341F91A3F57E400A0A8C3 /* src_point.cpp in Sources */, 675342031A3F57E400A0A8C3 /* strings_bundle.cpp in Sources */, 675341CD1A3F57E400A0A8C3 /* base.cpp in Sources */, - 675341E81A3F57E400A0A8C3 /* object_tracker.cpp in Sources */, 675342011A3F57E400A0A8C3 /* string_utils.cpp in Sources */, 674A7E2E1C0DB03D003D48E1 /* timegm.cpp in Sources */, 6753420A1A3F57E400A0A8C3 /* threaded_container.cpp in Sources */, @@ -614,10 +606,10 @@ 67A609AE1C88642E001E641A /* deferred_task.cpp in Sources */, 675341DF1A3F57E400A0A8C3 /* logging.cpp in Sources */, 671182F01C807C0A00CB8177 /* gmtime.cpp in Sources */, - 675341D71A3F57E400A0A8C3 /* condition.cpp in Sources */, 67B52B601AD3C84E00664C17 /* thread_checker.cpp in Sources */, 675341E71A3F57E400A0A8C3 /* normalize_unicode.cpp in Sources */, 675341E11A3F57E400A0A8C3 /* lower_case.cpp in Sources */, + 672DD4C11E0425600078E13C /* condition.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; |