CppBenchmark: CppBenchmark::Executor Class Reference (original) (raw)

Dynamic benchmarks executor class. More...

#include <[executor.h](executor%5F8h%5Fsource.html)>

Public Member Functions
Executor (const Executor &)=delete
Executor (Executor &&)=delete
~Executor ()=default
Executor & operator= (const Executor &)=delete
Executor & operator= (Executor &&)=delete
Static Public Member Functions
static std::shared_ptr< Phase > StartBenchmark (const std::string &benchmark)
Start a new dynamic benchmark with a given name.
static void StopBenchmark (const std::string &benchmark)
Stop dynamic benchmark with a given name.
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.
static void Report (Reporter &reporter)
Report benchmarks results using the given reporter.
Protected Attributes
std::mutex _mutex
Synchronization mutex.
std::vector< std::shared_ptr< PhaseCore > > _benchmarks
Registered benchmarks collection.

Dynamic benchmarks executor class.

Provides interface to register dynamic benchmarks and report results with external reporters.

Definition at line 21 of file executor.h.

Executor() [1/2]

CppBenchmark::Executor::Executor ( const Executor & ) delete

Executor() [2/2]

CppBenchmark::Executor::Executor ( Executor && ) delete
CppBenchmark::Executor::~Executor ( ) default

operator=() [1/2]

operator=() [2/2]

Report()

void CppBenchmark::Executor::Report ( Reporter & reporter) static

Report benchmarks results using the given reporter.

Please note the method is thread-safe and might be called in multi-thread environment!

Parameters

Definition at line 98 of file executor.cpp.

ScopeBenchmark()

static std::shared_ptr< PhaseScope > CppBenchmark::Executor::ScopeBenchmark ( const std::string & benchmark) inlinestatic

Start a new dynamic benchmark with a given name and wrap it in a PhaseScope.

Please note the method is thread-safe and might be called in multi-thread environment!

Parameters

benchmark - Dynamic benchmark name

Returns

Shared pointer to the required dynamic benchmark scope wrapper

Definition at line 58 of file executor.h.

StartBenchmark()

std::shared_ptr< Phase > CppBenchmark::Executor::StartBenchmark ( const std::string & benchmark) static

Start a new dynamic benchmark with a given name.

This method will create or get existent dynamic benchmark with a given name, start benchmark measurement and return it as a shared pointer. Please note the method is thread-safe and might be called in multi-thread environment!

Parameters

benchmark - Dynamic benchmark name

Returns

Shared pointer to the required dynamic benchmark

Definition at line 47 of file executor.cpp.

StopBenchmark()

void CppBenchmark::Executor::StopBenchmark ( const std::string & benchmark) static

Stop dynamic benchmark with a given name.

This method will try to find existent dynamic benchmark with a given name and stop benchmark measurement for it. Please note the method is thread-safe and might be called in multi-thread environment!

Parameters

benchmark - Dynamic benchmark name

Definition at line 80 of file executor.cpp.

_benchmarks

std::vector<std::shared_ptr<PhaseCore> > CppBenchmark::Executor::_benchmarks protected

Registered benchmarks collection.

Definition at line 73 of file executor.h.

_mutex

std::mutex CppBenchmark::Executor::_mutex protected

Synchronization mutex.

Definition at line 71 of file executor.h.


The documentation for this class was generated from the following files: