9 #ifndef CPPBENCHMARK_EXECUTOR_H
10 #define CPPBENCHMARK_EXECUTOR_H
40 static std::shared_ptr<Phase>
StartBenchmark(
const std::string& benchmark);
58 static std::shared_ptr<PhaseScope>
ScopeBenchmark(
const std::string& benchmark)
59 {
return std::make_shared<PhaseScope>(
StartBenchmark(benchmark)); }
78 void ReportPhase(
Reporter& reporter,
const PhaseCore& phase,
const std::string& name)
const;
82 {
static Executor instance;
return instance; }
Dynamic benchmarks executor class.
std::mutex _mutex
Synchronization mutex.
Executor(const Executor &)=delete
static void StopBenchmark(const std::string &benchmark)
Stop dynamic benchmark with a given name.
static std::shared_ptr< Phase > StartBenchmark(const std::string &benchmark)
Start a new dynamic benchmark with a given name.
static void Report(Reporter &reporter)
Report benchmarks results using the given reporter.
std::vector< std::shared_ptr< PhaseCore > > _benchmarks
Registered benchmarks collection.
Executor(Executor &&)=delete
Executor & operator=(const Executor &)=delete
Executor & operator=(Executor &&)=delete
static std::shared_ptr< PhaseScope > ScopeBenchmark(const std::string &benchmark)
Start a new dynamic benchmark with a given name and wrap it in a PhaseScope.
C++ Benchmark project definitions.
Benchmark phase core definition.
Reporter base definition.