CppBenchmark
1.0.4.0
C++ Benchmark Library
|
Benchmark phase base class. More...
#include <phase.h>
Public Member Functions | |
Phase () noexcept=default | |
Phase (const Phase &)=default | |
Phase (Phase &&) noexcept=default | |
virtual | ~Phase ()=default |
Phase & | operator= (const Phase &)=default |
Phase & | operator= (Phase &&) noexcept=default |
virtual const std::string & | name () const noexcept=0 |
Get phase name. More... | |
virtual const PhaseMetrics & | metrics () const noexcept=0 |
Get phase metrics. More... | |
virtual std::shared_ptr< Phase > | StartPhase (const std::string &phase)=0 |
Start a new sub-phase with a given name in a single-thread environment. More... | |
virtual std::shared_ptr< Phase > | StartPhaseThreadSafe (const std::string &phase)=0 |
Start a new sub-phase with a given name in a multi-thread environment. More... | |
virtual void | StopPhase ()=0 |
Stop measurement of the current phase. More... | |
virtual std::shared_ptr< PhaseScope > | ScopePhase (const std::string &phase)=0 |
Start a new sub-phase with a given name in a single-thread environment and wrap it in a PhaseScope. More... | |
virtual std::shared_ptr< PhaseScope > | ScopePhaseThreadSafe (const std::string &phase)=0 |
Start a new sub-phase with a given name in a multi-thread environment and wrap it in a PhaseScope. More... | |
Benchmark phase base class.
Provides interface to start a new sub-phase, stop the current phase, create PhaseScope and access to the current phase name and metrics.
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
|
virtualdefault |
|
pure virtualnoexcept |
Get phase metrics.
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtualnoexcept |
Get phase name.
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtual |
Start a new sub-phase with a given name in a single-thread environment and wrap it in a PhaseScope.
Please note the method is not thread-safe and should not be called in multi-thread environment!
phase | - Sub-phase name |
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtual |
Start a new sub-phase with a given name in a multi-thread environment and wrap it in a PhaseScope.
Please note the method is thread-safe and might be called in multi-thread environment!
phase | - Sub-phase name |
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtual |
Start a new sub-phase with a given name in a single-thread environment.
This method will create or get existent sub-phase with a given name, start benchmark measurement and return it as a shared pointer. Please note the method is not thread-safe and should not be called in multi-thread environment!
phase | - Sub-phase name |
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtual |
Start a new sub-phase with a given name in a multi-thread environment.
This method will create or get existent sub-phase 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!
phase | - Sub-phase name |
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.
|
pure virtual |
Stop measurement of the current phase.
Implemented in CppBenchmark::PhaseScope, CppBenchmark::PhaseCore, and CppBenchmark::Context.