CppBenchmark  1.0.4.0
C++ Benchmark Library
launcher_console.h
Go to the documentation of this file.
1 
9 #ifndef CPPBENCHMARK_LAUNCHER_CONSOLE_H
10 #define CPPBENCHMARK_LAUNCHER_CONSOLE_H
11 
12 #include "benchmark/launcher.h"
13 
14 namespace CppBenchmark {
15 
17 
21 class LauncherConsole : public Launcher
22 {
23 public:
24  LauncherConsole(const LauncherConsole&) = delete;
26  virtual ~LauncherConsole() = default;
27 
30 
33  { static LauncherConsole instance; return instance; }
34 
36 
45  void Initialize(const int argc, char const* const* const argv);
47  void Execute();
49  void Report() const;
50 
51 protected:
52  // Implementation of LauncherHanlder
53  void onLaunching(int current, int total, const BenchmarkBase& benchmark, const Context& context, int attempt) override;
54  void onLaunched(int current, int total, const BenchmarkBase& benchmark, const Context& context, int attempt) override;
55 
56 private:
57  bool _init;
58  bool _list;
59  bool _quiet;
60  int32_t _histograms;
61  std::string _filter;
62  std::string _output;
63 
64  LauncherConsole() : _init(false), _list(false), _quiet(false), _histograms(0), _filter(""), _output("console") {}
65 };
66 
67 } // namespace CppBenchmark
68 
69 #endif // CPPBENCHMARK_LAUNCHER_CONSOLE_H
Benchmark base class.
Benchmark running context.
Definition: context.h:27
LauncherConsole & operator=(LauncherConsole &&)=delete
static LauncherConsole & GetInstance()
Get singleton instance.
LauncherConsole(LauncherConsole &&)=delete
void onLaunched(int current, int total, const BenchmarkBase &benchmark, const Context &context, int attempt) override
Handle benchmark launched notification.
LauncherConsole & operator=(const LauncherConsole &)=delete
void Execute()
Execute benchmarks and show progress in console.
void Initialize(const int argc, char const *const *const argv)
Initialized console launcher.
LauncherConsole(const LauncherConsole &)=delete
void onLaunching(int current, int total, const BenchmarkBase &benchmark, const Context &context, int attempt) override
Handle benchmark launching notification.
virtual ~LauncherConsole()=default
void Report() const
Report benchmarks results in console.
Launcher base class.
Definition: launcher.h:25
Launcher base definition.
C++ Benchmark project definitions.
Definition: barrier.h:15