Benchmark running context.
More...
#include <context.h>
Benchmark running context.
Provides access to the current benchmark context information:
- Examples
- containers.cpp, and sort.cpp.
Definition at line 26 of file context.h.
◆ Context() [1/4]
CppBenchmark::Context::Context |
( |
| ) |
|
|
delete |
◆ Context() [2/4]
CppBenchmark::Context::Context |
( |
const Context & |
| ) |
|
|
defaultnoexcept |
◆ Context() [3/4]
CppBenchmark::Context::Context |
( |
Context && |
| ) |
|
|
defaultnoexcept |
◆ ~Context()
virtual CppBenchmark::Context::~Context |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ Context() [4/4]
CppBenchmark::Context::Context |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
|
inlineprotectednoexcept |
Create benchmark running context.
- Parameters
-
Definition at line 92 of file context.h.
◆ Cancel()
void CppBenchmark::Context::Cancel |
( |
| ) |
|
|
inlinenoexcept |
Cancel benchmark execution.
Definition at line 58 of file context.h.
◆ canceled()
bool CppBenchmark::Context::canceled |
( |
| ) |
const |
|
inlinenoexcept |
Is benchmark execution canceled?
Definition at line 56 of file context.h.
◆ description()
std::string CppBenchmark::Context::description |
( |
| ) |
const |
|
virtual |
◆ metrics() [1/2]
const PhaseMetrics& CppBenchmark::Context::metrics |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
◆ metrics() [2/2]
◆ name()
const std::string& CppBenchmark::Context::name |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ScopePhase()
std::shared_ptr<PhaseScope> CppBenchmark::Context::ScopePhase |
( |
const std::string & |
phase | ) |
|
|
inlineoverridevirtual |
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!
- Parameters
-
- Returns
- Shared pointer to the required benchmark sub-phase scope wrapper
Implements CppBenchmark::Phase.
Definition at line 69 of file context.h.
◆ ScopePhaseThreadSafe()
std::shared_ptr<PhaseScope> CppBenchmark::Context::ScopePhaseThreadSafe |
( |
const std::string & |
phase | ) |
|
|
inlineoverridevirtual |
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!
- Parameters
-
- Returns
- Shared pointer to the required thread-safe benchmark sub-phase scope wrapper
Implements CppBenchmark::Phase.
Definition at line 70 of file context.h.
◆ StartPhase()
std::shared_ptr<Phase> CppBenchmark::Context::StartPhase |
( |
const std::string & |
phase | ) |
|
|
inlineoverridevirtual |
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
Implements CppBenchmark::Phase.
Definition at line 66 of file context.h.
◆ StartPhaseThreadSafe()
std::shared_ptr<Phase> CppBenchmark::Context::StartPhaseThreadSafe |
( |
const std::string & |
phase | ) |
|
|
inlineoverridevirtual |
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!
- Parameters
-
- Returns
- Shared pointer to the thread safe benchmark sub-phase
Implements CppBenchmark::Phase.
Definition at line 67 of file context.h.
◆ StopPhase()
void CppBenchmark::Context::StopPhase |
( |
| ) |
|
|
inlineoverridevirtual |
◆ x()
int CppBenchmark::Context::x |
( |
| ) |
const |
|
inlinenoexcept |
◆ y()
int CppBenchmark::Context::y |
( |
| ) |
const |
|
inlinenoexcept |
◆ z()
int CppBenchmark::Context::z |
( |
| ) |
const |
|
inlinenoexcept |
◆ Benchmark
◆ BenchmarkBase
◆ _canceled
std::shared_ptr<std::atomic<bool> > CppBenchmark::Context::_canceled |
|
protected |
◆ _current
Current benchmark phase.
Definition at line 80 of file context.h.
◆ _metrics
Current benchmark metrics.
Definition at line 82 of file context.h.
◆ _x
int CppBenchmark::Context::_x |
|
protected |
◆ _y
int CppBenchmark::Context::_y |
|
protected |
◆ _z
int CppBenchmark::Context::_z |
|
protected |
The documentation for this class was generated from the following files: