CppBenchmark  1.0.4.0
C++ Benchmark Library
reporter_json.h
Go to the documentation of this file.
1 
9 #ifndef CPPBENCHMARK_REPORTER_JSON_H
10 #define CPPBENCHMARK_REPORTER_JSON_H
11 
12 #include "benchmark/reporter.h"
13 
14 #include <iostream>
15 
16 namespace CppBenchmark {
17 
19 
24 class ReporterJSON : public Reporter
25 {
26 public:
28 
33  ReporterJSON(std::ostream& stream = std::cout) : _stream(stream), _benchmark_comma(false), _phase_comma(false) {}
34  ReporterJSON(const ReporterJSON&) = delete;
36  virtual ~ReporterJSON() = default;
37 
38  ReporterJSON& operator=(const ReporterJSON&) = delete;
40 
41  // Implementation of Reporter
42  void ReportHeader() override;
43  void ReportSystem() override;
44  void ReportEnvironment() override;
45  void ReportBenchmarksHeader() override;
46  void ReportBenchmarksFooter() override;
47  void ReportBenchmarkHeader() override;
48  void ReportBenchmarkFooter() override;
49  void ReportBenchmark(const BenchmarkBase& benchmark, const Settings& settings) override;
50  void ReportPhasesHeader() override;
51  void ReportPhasesFooter() override;
52  void ReportPhaseHeader() override;
53  void ReportPhaseFooter() override;
54  void ReportPhase(const PhaseCore& phase, const PhaseMetrics& metrics) override;
55  void ReportFooter() override;
56 
57 private:
58  std::ostream& _stream;
59  bool _benchmark_comma;
60  bool _phase_comma;
61 };
62 
63 } // namespace CppBenchmark
64 
65 #endif // CPPBENCHMARK_REPORTER_JSON_H
Benchmark base class.
Benchmark phase core.
Definition: phase_core.h:27
Benchmark phase metrics.
Definition: phase_metrics.h:37
Reporter base class.
Definition: reporter.h:21
void ReportBenchmarkHeader() override
Report current benchmark header.
ReporterJSON(ReporterJSON &&)=delete
ReporterJSON(const ReporterJSON &)=delete
void ReportBenchmark(const BenchmarkBase &benchmark, const Settings &settings) override
Report current benchmark information.
ReporterJSON & operator=(ReporterJSON &&)=delete
void ReportPhasesHeader() override
Report all phases header.
void ReportPhaseFooter() override
Report current phase footer.
ReporterJSON(std::ostream &stream=std::cout)
Default class constructor.
Definition: reporter_json.h:33
void ReportBenchmarkFooter() override
Report current benchmark footer.
void ReportPhaseHeader() override
Report current phase header.
void ReportPhase(const PhaseCore &phase, const PhaseMetrics &metrics) override
Report current phase information.
void ReportHeader() override
Report header.
void ReportBenchmarksFooter() override
Report all benchmarks footer.
void ReportFooter() override
Report footer.
void ReportEnvironment() override
Report environment information.
ReporterJSON & operator=(const ReporterJSON &)=delete
void ReportSystem() override
Report system information.
void ReportPhasesFooter() override
Report all phases footer.
virtual ~ReporterJSON()=default
void ReportBenchmarksHeader() override
Report all benchmarks header.
Benchmark settings.
Definition: settings.h:32
C++ Benchmark project definitions.
Definition: barrier.h:15
Reporter base definition.