|
| | 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.
|
| |
| virtual const PhaseMetrics & | metrics () const noexcept=0 |
| | Get phase metrics.
|
| |
| 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.
|
| |
| 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.
|
| |
| virtual void | StopPhase ()=0 |
| | Stop measurement of the current phase.
|
| |
| 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.
|
| |
| 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.
|
| |
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.
Definition at line 25 of file phase.h.
| virtual std::shared_ptr< Phase > CppBenchmark::Phase::StartPhase |
( |
const std::string & |
phase | ) |
|
|
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!
- Parameters
-
- Returns
- Shared pointer to the required benchmark sub-phase
Implemented in CppBenchmark::Context, CppBenchmark::PhaseCore, and CppBenchmark::PhaseScope.