From 6cc78c358adeb78727a4b2cb60808d9ab1891851 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Mon, 23 Oct 2017 12:19:27 -0700 Subject: [PATCH] move Iterator, Enumerate, EvictingCacheMap, Foreach, Merge, and Summary: this is all non-hphp includes that are going in container/ Reviewed By: mzlee, yfeldblum Differential Revision: D6121745 fbshipit-source-id: b024bde8835fc7f332686793d75eb8e71591c912 --- CMakeLists.txt | 12 +++++++----- folly/AtomicHashMap.h | 2 +- folly/Benchmark.cpp | 2 +- folly/Makefile.am | 12 ++++++------ folly/concurrency/CoreCachedSharedPtr.h | 2 +- folly/{ => container}/Enumerate.h | 0 folly/{ => container}/EvictingCacheMap.h | 0 folly/{ => container}/Foreach-inl.h | 0 folly/{ => container}/Foreach.h | 2 +- folly/{ => container}/Iterator.h | 0 folly/{algorithm => container}/Merge.h | 0 folly/{ => container}/SparseByteSet.h | 0 folly/{ => container}/test/EnumerateTest.cpp | 2 +- folly/{ => container}/test/EvictingCacheMapTest.cpp | 2 +- folly/{ => container}/test/ForeachBenchmark.cpp | 2 +- folly/{ => container}/test/ForeachTest.cpp | 2 +- folly/{ => container}/test/IteratorTest.cpp | 2 +- folly/{algorithm => container}/test/MergeTest.cpp | 2 +- .../test/SparseByteSetBenchmark.cpp} | 2 +- folly/{ => container}/test/SparseByteSetTest.cpp | 2 +- folly/detail/RangeCommon.cpp | 2 +- folly/detail/ThreadLocalDetail.h | 2 +- folly/docs/Benchmark.md | 6 +++--- folly/gen/test/StringBenchmark.cpp | 2 +- folly/stats/test/HistogramBenchmark.cpp | 2 +- folly/stats/test/TimeSeriesTest.cpp | 2 +- folly/test/BenchmarkTest.cpp | 2 +- folly/test/ConcurrentSkipListTest.cpp | 2 +- folly/test/ConvBenchmark.cpp | 2 +- folly/test/ConvTest.cpp | 2 +- folly/test/FBStringBenchmark.cpp | 2 +- folly/test/FBStringTest.cpp | 2 +- folly/test/FBVectorBenchmark.cpp | 2 +- folly/test/FBVectorTest.cpp | 2 +- folly/test/Makefile.am | 4 ++-- folly/test/RandomBenchmark.cpp | 2 +- folly/test/RangeFindBenchmark.cpp | 2 +- folly/test/SynchronizedTestLib-inl.h | 2 +- 38 files changed, 46 insertions(+), 44 deletions(-) rename folly/{ => container}/Enumerate.h (100%) rename folly/{ => container}/EvictingCacheMap.h (100%) rename folly/{ => container}/Foreach-inl.h (100%) rename folly/{ => container}/Foreach.h (99%) rename folly/{ => container}/Iterator.h (100%) rename folly/{algorithm => container}/Merge.h (100%) rename folly/{ => container}/SparseByteSet.h (100%) rename folly/{ => container}/test/EnumerateTest.cpp (99%) rename folly/{ => container}/test/EvictingCacheMapTest.cpp (99%) rename folly/{ => container}/test/ForeachBenchmark.cpp (99%) rename folly/{ => container}/test/ForeachTest.cpp (99%) rename folly/{ => container}/test/IteratorTest.cpp (99%) rename folly/{algorithm => container}/test/MergeTest.cpp (98%) rename folly/{test/SparseByteSetBench.cpp => container/test/SparseByteSetBenchmark.cpp} (98%) rename folly/{ => container}/test/SparseByteSetTest.cpp (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 530d6a2a..dae65719 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,13 @@ if (BUILD_TESTS) TEST threaded_executor_test SOURCES ThreadedExecutorTest.cpp TEST unbounded_blocking_queue_test SOURCES UnboundedBlockingQueueTest.cpp + DIRECTORY container/test/ + TEST enumerate_test SOURCES EnumerateTest.cpp + TEST evicting_cache_map_test SOURCES EvictingCacheMapTest.cpp + TEST foreach_test SOURCES ForeachTest.cpp + TEST merge_test SOURCES MergeTest.cpp + TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp + DIRECTORY experimental/test/ TEST autotimer_test SOURCES AutoTimerTest.cpp TEST bits_test_2 SOURCES BitsTest.cpp @@ -520,8 +527,6 @@ if (BUILD_TESTS) TEST dynamic_converter_test SOURCES DynamicConverterTest.cpp TEST dynamic_other_test SOURCES DynamicOtherTest.cpp TEST endian_test SOURCES EndianTest.cpp - TEST enumerate_test SOURCES EnumerateTest.cpp - TEST evicting_cache_map_test SOURCES EvictingCacheMapTest.cpp TEST exception_test SOURCES ExceptionTest.cpp TEST exception_wrapper_test SOURCES ExceptionWrapperTest.cpp TEST expected_test SOURCES ExpectedTest.cpp @@ -531,7 +536,6 @@ if (BUILD_TESTS) TEST file_util_test HANGING SOURCES FileUtilTest.cpp TEST fingerprint_test SOURCES FingerprintTest.cpp - TEST foreach_test SOURCES ForeachTest.cpp TEST format_other_test SOURCES FormatOtherTest.cpp TEST format_test SOURCES FormatTest.cpp TEST function_scheduler_test SOURCES FunctionSchedulerTest.cpp @@ -563,7 +567,6 @@ if (BUILD_TESTS) TEST memcpy_test SOURCES MemcpyTest.cpp TEST memory_idler_test SOURCES MemoryIdlerTest.cpp TEST memory_test SOURCES MemoryTest.cpp - TEST merge SOURCES MergeTest.cpp TEST move_wrapper_test SOURCES MoveWrapperTest.cpp TEST mpmc_pipeline_test SOURCES MPMCPipelineTest.cpp TEST mpmc_queue_test SLOW @@ -594,7 +597,6 @@ if (BUILD_TESTS) TEST singletonvault_c_test SOURCES SingletonVaultCTest.cpp TEST small_vector_test SOURCES small_vector_test.cpp TEST sorted_vector_types_test SOURCES sorted_vector_test.cpp - TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp TEST string_test SOURCES StringTest.cpp TEST synchronized_test SOURCES SynchronizedTest.cpp TEST thread_cached_int_test SOURCES ThreadCachedIntTest.cpp diff --git a/folly/AtomicHashMap.h b/folly/AtomicHashMap.h index af8aa633..280b0dd9 100644 --- a/folly/AtomicHashMap.h +++ b/folly/AtomicHashMap.h @@ -91,10 +91,10 @@ #include #include -#include #include #include #include +#include namespace folly { diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp index b80eb6b3..2e9a7ef4 100644 --- a/folly/Benchmark.cpp +++ b/folly/Benchmark.cpp @@ -30,9 +30,9 @@ #include -#include #include #include +#include #include using namespace std; diff --git a/folly/Makefile.am b/folly/Makefile.am index b6ac6821..7d28d8c0 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -58,6 +58,12 @@ nobase_follyinclude_HEADERS = \ concurrency/ConcurrentHashMap.h \ concurrency/CoreCachedSharedPtr.h \ concurrency/detail/ConcurrentHashMap-detail.h \ + container/Iterator.h \ + container/Enumerate.h \ + container/EvictingCacheMap.h \ + container/Foreach.h \ + container/Foreach-inl.h \ + container/SparseByteSet.h \ ConstexprMath.h \ detail/AtomicHashUtils.h \ detail/AtomicUnorderedMapUtils.h \ @@ -111,8 +117,6 @@ nobase_follyinclude_HEADERS = \ DynamicConverter.h \ dynamic.h \ dynamic-inl.h \ - Enumerate.h \ - EvictingCacheMap.h \ Exception.h \ ExceptionString.h \ ExceptionWrapper.h \ @@ -199,8 +203,6 @@ nobase_follyinclude_HEADERS = \ Fingerprint.h \ FixedString.h \ folly-config.h \ - Foreach.h \ - Foreach-inl.h \ FormatArg.h \ FormatTraits.h \ Format.h \ @@ -309,7 +311,6 @@ nobase_follyinclude_HEADERS = \ io/async/test/TimeUtil.h \ io/async/test/UndelayedDestruction.h \ io/async/test/Util.h \ - Iterator.h \ json.h \ Launder.h \ Lazy.h \ @@ -396,7 +397,6 @@ nobase_follyinclude_HEADERS = \ small_vector.h \ SocketAddress.h \ sorted_vector_types.h \ - SparseByteSet.h \ SpinLock.h \ ssl/Init.h \ ssl/OpenSSLCertUtils.h \ diff --git a/folly/concurrency/CoreCachedSharedPtr.h b/folly/concurrency/CoreCachedSharedPtr.h index d294e75c..df7e325e 100644 --- a/folly/concurrency/CoreCachedSharedPtr.h +++ b/folly/concurrency/CoreCachedSharedPtr.h @@ -19,9 +19,9 @@ #include #include -#include #include #include +#include #include namespace folly { diff --git a/folly/Enumerate.h b/folly/container/Enumerate.h similarity index 100% rename from folly/Enumerate.h rename to folly/container/Enumerate.h diff --git a/folly/EvictingCacheMap.h b/folly/container/EvictingCacheMap.h similarity index 100% rename from folly/EvictingCacheMap.h rename to folly/container/EvictingCacheMap.h diff --git a/folly/Foreach-inl.h b/folly/container/Foreach-inl.h similarity index 100% rename from folly/Foreach-inl.h rename to folly/container/Foreach-inl.h diff --git a/folly/Foreach.h b/folly/container/Foreach.h similarity index 99% rename from folly/Foreach.h rename to folly/container/Foreach.h index ae0e865d..f24854de 100644 --- a/folly/Foreach.h +++ b/folly/container/Foreach.h @@ -320,4 +320,4 @@ downTo(T& iter, const U& begin) { #define FOR_EACH_RANGE_R(i, begin, end) \ for (auto i = (false ? (begin) : (end)); ::folly::detail::downTo(i, (begin));) -#include +#include diff --git a/folly/Iterator.h b/folly/container/Iterator.h similarity index 100% rename from folly/Iterator.h rename to folly/container/Iterator.h diff --git a/folly/algorithm/Merge.h b/folly/container/Merge.h similarity index 100% rename from folly/algorithm/Merge.h rename to folly/container/Merge.h diff --git a/folly/SparseByteSet.h b/folly/container/SparseByteSet.h similarity index 100% rename from folly/SparseByteSet.h rename to folly/container/SparseByteSet.h diff --git a/folly/test/EnumerateTest.cpp b/folly/container/test/EnumerateTest.cpp similarity index 99% rename from folly/test/EnumerateTest.cpp rename to folly/container/test/EnumerateTest.cpp index 67ffe31a..c96abca0 100644 --- a/folly/test/EnumerateTest.cpp +++ b/folly/container/test/EnumerateTest.cpp @@ -18,8 +18,8 @@ #include #include -#include #include +#include #include TEST(Enumerate, Basic) { diff --git a/folly/test/EvictingCacheMapTest.cpp b/folly/container/test/EvictingCacheMapTest.cpp similarity index 99% rename from folly/test/EvictingCacheMapTest.cpp rename to folly/container/test/EvictingCacheMapTest.cpp index 85a4a5ed..2a81d09d 100644 --- a/folly/test/EvictingCacheMapTest.cpp +++ b/folly/container/test/EvictingCacheMapTest.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include using namespace folly; diff --git a/folly/test/ForeachBenchmark.cpp b/folly/container/test/ForeachBenchmark.cpp similarity index 99% rename from folly/test/ForeachBenchmark.cpp rename to folly/container/test/ForeachBenchmark.cpp index 63988c7b..5b741afb 100644 --- a/folly/test/ForeachBenchmark.cpp +++ b/folly/container/test/ForeachBenchmark.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/folly/test/ForeachTest.cpp b/folly/container/test/ForeachTest.cpp similarity index 99% rename from folly/test/ForeachTest.cpp rename to folly/container/test/ForeachTest.cpp index 48331668..fd7c0dd0 100644 --- a/folly/test/ForeachTest.cpp +++ b/folly/container/test/ForeachTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/folly/test/IteratorTest.cpp b/folly/container/test/IteratorTest.cpp similarity index 99% rename from folly/test/IteratorTest.cpp rename to folly/container/test/IteratorTest.cpp index 0be32bf9..15822e6f 100644 --- a/folly/test/IteratorTest.cpp +++ b/folly/container/test/IteratorTest.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include namespace { diff --git a/folly/algorithm/test/MergeTest.cpp b/folly/container/test/MergeTest.cpp similarity index 98% rename from folly/algorithm/test/MergeTest.cpp rename to folly/container/test/MergeTest.cpp index a9637680..da05afe7 100644 --- a/folly/algorithm/test/MergeTest.cpp +++ b/folly/container/test/MergeTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/folly/test/SparseByteSetBench.cpp b/folly/container/test/SparseByteSetBenchmark.cpp similarity index 98% rename from folly/test/SparseByteSetBench.cpp rename to folly/container/test/SparseByteSetBenchmark.cpp index 05b8dd77..b5e80900 100644 --- a/folly/test/SparseByteSetBench.cpp +++ b/folly/container/test/SparseByteSetBenchmark.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/folly/test/SparseByteSetTest.cpp b/folly/container/test/SparseByteSetTest.cpp similarity index 97% rename from folly/test/SparseByteSetTest.cpp rename to folly/container/test/SparseByteSetTest.cpp index 76f48967..b0227946 100644 --- a/folly/test/SparseByteSetTest.cpp +++ b/folly/container/test/SparseByteSetTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/folly/detail/RangeCommon.cpp b/folly/detail/RangeCommon.cpp index badf9bde..e8949d3f 100644 --- a/folly/detail/RangeCommon.cpp +++ b/folly/detail/RangeCommon.cpp @@ -18,7 +18,7 @@ #include -#include +#include namespace folly { diff --git a/folly/detail/ThreadLocalDetail.h b/folly/detail/ThreadLocalDetail.h index b0a2ae9f..3d5a2aa8 100644 --- a/folly/detail/ThreadLocalDetail.h +++ b/folly/detail/ThreadLocalDetail.h @@ -27,12 +27,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/folly/docs/Benchmark.md b/folly/docs/Benchmark.md index 6ac92df0..425704c4 100644 --- a/folly/docs/Benchmark.md +++ b/folly/docs/Benchmark.md @@ -17,7 +17,7 @@ Using `folly/Benchmark.h` is very simple. Here's an example: ``` Cpp #include - #include + #include #include using namespace std; using namespace folly; @@ -71,7 +71,7 @@ implicitly `unsigned`. Consider a slightly reworked example: ``` Cpp #include - #include + #include #include using namespace std; using namespace folly; @@ -127,7 +127,7 @@ compares with it: ``` Cpp #include - #include + #include #include using namespace std; using namespace folly; diff --git a/folly/gen/test/StringBenchmark.cpp b/folly/gen/test/StringBenchmark.cpp index df7dcec7..1300335f 100644 --- a/folly/gen/test/StringBenchmark.cpp +++ b/folly/gen/test/StringBenchmark.cpp @@ -19,8 +19,8 @@ #include #include -#include #include +#include #include #include diff --git a/folly/stats/test/HistogramBenchmark.cpp b/folly/stats/test/HistogramBenchmark.cpp index 3ccd81ec..d59fa771 100644 --- a/folly/stats/test/HistogramBenchmark.cpp +++ b/folly/stats/test/HistogramBenchmark.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include using folly::Histogram; diff --git a/folly/stats/test/TimeSeriesTest.cpp b/folly/stats/test/TimeSeriesTest.cpp index 6f30341e..e30ec6c6 100644 --- a/folly/stats/test/TimeSeriesTest.cpp +++ b/folly/stats/test/TimeSeriesTest.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include using std::chrono::seconds; diff --git a/folly/test/BenchmarkTest.cpp b/folly/test/BenchmarkTest.cpp index 462849fb..a9a4fee7 100644 --- a/folly/test/BenchmarkTest.cpp +++ b/folly/test/BenchmarkTest.cpp @@ -15,8 +15,8 @@ */ #include -#include #include +#include #include #include #include diff --git a/folly/test/ConcurrentSkipListTest.cpp b/folly/test/ConcurrentSkipListTest.cpp index 4447463e..301a7054 100644 --- a/folly/test/ConcurrentSkipListTest.cpp +++ b/folly/test/ConcurrentSkipListTest.cpp @@ -27,9 +27,9 @@ #include -#include #include #include +#include #include #include #include diff --git a/folly/test/ConvBenchmark.cpp b/folly/test/ConvBenchmark.cpp index f73f3f06..fb00363d 100644 --- a/folly/test/ConvBenchmark.cpp +++ b/folly/test/ConvBenchmark.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/folly/test/ConvTest.cpp b/folly/test/ConvTest.cpp index 0f189590..5fbbeed3 100644 --- a/folly/test/ConvTest.cpp +++ b/folly/test/ConvTest.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/folly/test/FBStringBenchmark.cpp b/folly/test/FBStringBenchmark.cpp index 342ede96..003eee88 100644 --- a/folly/test/FBStringBenchmark.cpp +++ b/folly/test/FBStringBenchmark.cpp @@ -27,8 +27,8 @@ #include #include -#include #include +#include #include using namespace std; diff --git a/folly/test/FBStringTest.cpp b/folly/test/FBStringTest.cpp index 6ded8b4c..629111db 100644 --- a/folly/test/FBStringTest.cpp +++ b/folly/test/FBStringTest.cpp @@ -29,9 +29,9 @@ #include #include -#include #include #include +#include #include using namespace std; diff --git a/folly/test/FBVectorBenchmark.cpp b/folly/test/FBVectorBenchmark.cpp index 504c1c51..c46c94e0 100644 --- a/folly/test/FBVectorBenchmark.cpp +++ b/folly/test/FBVectorBenchmark.cpp @@ -25,9 +25,9 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/folly/test/FBVectorTest.cpp b/folly/test/FBVectorTest.cpp index 3194ee74..2920a4f9 100644 --- a/folly/test/FBVectorTest.cpp +++ b/folly/test/FBVectorTest.cpp @@ -26,9 +26,9 @@ #include #include -#include #include #include +#include #include using namespace std; diff --git a/folly/test/Makefile.am b/folly/test/Makefile.am index e140d61f..2199f890 100644 --- a/folly/test/Makefile.am +++ b/folly/test/Makefile.am @@ -82,10 +82,10 @@ sorted_vector_types_test_SOURCES = sorted_vector_test.cpp sorted_vector_types_test_LDADD = libfollytestmain.la -foreach_test_SOURCES = ForeachTest.cpp +foreach_test_SOURCES = ../container/test/ForeachTest.cpp foreach_test_LDADD = libfollytestmain.la -foreach_benchmark_SOURCES = ForeachBenchmark.cpp +foreach_benchmark_SOURCES = ../container/test/ForeachBenchmark.cpp foreach_benchmark_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la check_PROGRAMS += foreach_benchmark diff --git a/folly/test/RandomBenchmark.cpp b/folly/test/RandomBenchmark.cpp index bd793aed..d1ba1867 100644 --- a/folly/test/RandomBenchmark.cpp +++ b/folly/test/RandomBenchmark.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #if FOLLY_HAVE_EXTRANDOM_SFMT19937 #include diff --git a/folly/test/RangeFindBenchmark.cpp b/folly/test/RangeFindBenchmark.cpp index 786553b2..7b2bda41 100644 --- a/folly/test/RangeFindBenchmark.cpp +++ b/folly/test/RangeFindBenchmark.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include using namespace folly; using namespace std; diff --git a/folly/test/SynchronizedTestLib-inl.h b/folly/test/SynchronizedTestLib-inl.h index 48951a62..0d34da31 100644 --- a/folly/test/SynchronizedTestLib-inl.h +++ b/folly/test/SynchronizedTestLib-inl.h @@ -16,9 +16,9 @@ #pragma once -#include #include #include +#include #include #include #include -- 2.34.1