From 9a179cb93faf76bbbff8410849ecb2eb3cf65024 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Tue, 28 Aug 2018 17:19:25 +0300 Subject: [PATCH] [NFC] Prefix "report(_)?mode" with Aggregation. (#656) This only specifically represents handling of reporting of aggregates. Not of anything else. Making it more specific makes the name less generic. This is an issue because i want to add "iteration report mode", so the naming would be conflicting. --- include/benchmark/benchmark.h | 10 +++++----- src/benchmark.cc | 4 ++-- src/benchmark_api_internal.h | 2 +- src/benchmark_register.cc | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h index 7434a8a5..87b10d1f 100644 --- a/include/benchmark/benchmark.h +++ b/include/benchmark/benchmark.h @@ -424,14 +424,14 @@ namespace internal { class ThreadTimer; class ThreadManager; -enum ReportMode +enum AggregationReportMode #if defined(BENCHMARK_HAS_CXX11) : unsigned #else #endif -{ RM_Unspecified, // The mode has not been manually specified - RM_Default, // The mode is user-specified as default. - RM_ReportAggregatesOnly }; +{ ARM_Unspecified, // The mode has not been manually specified + ARM_Default, // The mode is user-specified as default. + ARM_ReportAggregatesOnly }; } // namespace internal // State is passed to a running Benchmark and contains state for the @@ -912,7 +912,7 @@ class Benchmark { friend class BenchmarkFamilies; std::string name_; - ReportMode report_mode_; + AggregationReportMode aggregation_report_mode_; std::vector arg_names_; // Args for all benchmark runs std::vector > args_; // Args for all benchmark runs TimeUnit time_unit_; diff --git a/src/benchmark.cc b/src/benchmark.cc index 0f2e198a..f9c86865 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -206,9 +206,9 @@ std::vector RunBenchmark( b.repetitions != 0 ? b.repetitions : FLAGS_benchmark_repetitions; const bool report_aggregates_only = repeats != 1 && - (b.report_mode == internal::RM_Unspecified + (b.aggregation_report_mode == internal::ARM_Unspecified ? FLAGS_benchmark_report_aggregates_only - : b.report_mode == internal::RM_ReportAggregatesOnly); + : b.aggregation_report_mode == internal::ARM_ReportAggregatesOnly); for (int repetition_num = 0; repetition_num < repeats; repetition_num++) { for (;;) { // Try benchmark diff --git a/src/benchmark_api_internal.h b/src/benchmark_api_internal.h index dd7a3ffe..0bf0005e 100644 --- a/src/benchmark_api_internal.h +++ b/src/benchmark_api_internal.h @@ -16,7 +16,7 @@ namespace internal { struct Benchmark::Instance { std::string name; Benchmark* benchmark; - ReportMode report_mode; + AggregationReportMode aggregation_report_mode; std::vector arg; TimeUnit time_unit; int range_multiplier; diff --git a/src/benchmark_register.cc b/src/benchmark_register.cc index 26a89721..8ee30adf 100644 --- a/src/benchmark_register.cc +++ b/src/benchmark_register.cc @@ -155,7 +155,7 @@ bool BenchmarkFamilies::FindBenchmarks( Benchmark::Instance instance; instance.name = family->name_; instance.benchmark = family.get(); - instance.report_mode = family->report_mode_; + instance.aggregation_report_mode = family->aggregation_report_mode_; instance.arg = args; instance.time_unit = family->time_unit_; instance.range_multiplier = family->range_multiplier_; @@ -236,7 +236,7 @@ bool FindBenchmarksInternal(const std::string& re, Benchmark::Benchmark(const char* name) : name_(name), - report_mode_(RM_Unspecified), + aggregation_report_mode_(ARM_Unspecified), time_unit_(kNanosecond), range_multiplier_(kRangeMultiplier), min_time_(0), @@ -369,7 +369,7 @@ Benchmark* Benchmark::Repetitions(int n) { } Benchmark* Benchmark::ReportAggregatesOnly(bool value) { - report_mode_ = value ? RM_ReportAggregatesOnly : RM_Default; + aggregation_report_mode_ = value ? ARM_ReportAggregatesOnly : ARM_Default; return this; }