CppBenchmark
1.0.4.0
C++ Benchmark Library
|
Benchmark producer/consumer running context. More...
#include <context_pc.h>
Public Member Functions | |
ContextPC ()=delete | |
ContextPC (const ContextPC &) noexcept=default | |
ContextPC (ContextPC &&) noexcept=default | |
virtual | ~ContextPC () noexcept=default |
ContextPC & | operator= (const ContextPC &) noexcept=default |
ContextPC & | operator= (ContextPC &&) noexcept=default |
int | producers () const noexcept |
Benchmark producers count. More... | |
int | consumers () const noexcept |
Benchmark consumers count. More... | |
bool | produce_stopped () const noexcept |
Is benchmark produce stopped? More... | |
bool | consume_stopped () const noexcept |
Is benchmark consume stopped? More... | |
void | StopProduce () noexcept |
Stop benchmark production. More... | |
void | StopConsume () noexcept |
Stop benchmark consumption. More... | |
std::string | description () const override |
Get description of the current benchmark running context. More... | |
Public Member Functions inherited from CppBenchmark::Context | |
Context ()=delete | |
Context (const Context &) noexcept=default | |
Context (Context &&) noexcept=default | |
virtual | ~Context () noexcept=default |
Context & | operator= (const Context &) noexcept=default |
Context & | operator= (Context &&) noexcept=default |
int | x () const noexcept |
Benchmark first parameter. Valid only if not negative! More... | |
int | y () const noexcept |
Benchmark second parameter. Valid only if not negative! More... | |
int | z () const noexcept |
Benchmark third parameter. Valid only if not negative! More... | |
PhaseMetrics & | metrics () noexcept |
Benchmark mutable metrics. More... | |
bool | canceled () const noexcept |
Is benchmark execution canceled? More... | |
void | Cancel () noexcept |
Cancel benchmark execution. More... | |
const std::string & | name () const noexcept override |
Get phase name. More... | |
const PhaseMetrics & | metrics () const noexcept override |
Get phase metrics. More... | |
std::shared_ptr< Phase > | StartPhase (const std::string &phase) override |
Start a new sub-phase with a given name in a single-thread environment. More... | |
std::shared_ptr< Phase > | StartPhaseThreadSafe (const std::string &phase) override |
Start a new sub-phase with a given name in a multi-thread environment. More... | |
void | StopPhase () override |
Stop measurement of the current phase. More... | |
std::shared_ptr< PhaseScope > | ScopePhase (const std::string &phase) override |
Start a new sub-phase with a given name in a single-thread environment and wrap it in a PhaseScope. More... | |
std::shared_ptr< PhaseScope > | ScopePhaseThreadSafe (const std::string &phase) override |
Start a new sub-phase with a given name in a multi-thread environment and wrap it in a PhaseScope. More... | |
Public Member Functions inherited from CppBenchmark::Phase | |
Phase () noexcept=default | |
Phase (const Phase &)=default | |
Phase (Phase &&) noexcept=default | |
virtual | ~Phase ()=default |
Phase & | operator= (const Phase &)=default |
Phase & | operator= (Phase &&) noexcept=default |
Protected Member Functions | |
ContextPC (int producers, int consumers, int x, int y, int z) noexcept | |
Create benchmark running context. More... | |
Protected Member Functions inherited from CppBenchmark::Context | |
Context (int x, int y, int z) noexcept | |
Create benchmark running context. More... | |
Protected Attributes | |
int | _producers |
Benchmark producers count. More... | |
int | _consumers |
Benchmark consumers count. More... | |
std::shared_ptr< std::atomic< bool > > | _produce_stopped |
Benchmark produce stopped flag. More... | |
std::shared_ptr< std::atomic< bool > > | _consume_stopped |
Benchmark consume stopped flag. More... | |
Protected Attributes inherited from CppBenchmark::Context | |
int | _x |
Benchmark first parameter. Valid only if not negative! More... | |
int | _y |
Benchmark second parameter. Valid only if not negative! More... | |
int | _z |
Benchmark third parameter. Valid only if not negative! More... | |
PhaseCore * | _current |
Current benchmark phase. More... | |
PhaseMetrics * | _metrics |
Current benchmark metrics. More... | |
std::shared_ptr< std::atomic< bool > > | _canceled |
Benchmark canceled flag. More... | |
Friends | |
class | BenchmarkPC |
Benchmark producer/consumer running context.
Provides access to the current producer/consumer benchmark context information:
Definition at line 26 of file context_pc.h.
|
delete |
|
defaultnoexcept |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
|
inlineprotectednoexcept |
|
inlinenoexcept |
Is benchmark consume stopped?
Definition at line 47 of file context_pc.h.
|
inlinenoexcept |
Benchmark consumers count.
Definition at line 42 of file context_pc.h.
|
overridevirtual |
Get description of the current benchmark running context.
Reimplemented from CppBenchmark::Context.
Definition at line 13 of file context_pc.cpp.
|
inlinenoexcept |
Is benchmark produce stopped?
Definition at line 45 of file context_pc.h.
|
inlinenoexcept |
Benchmark producers count.
Definition at line 40 of file context_pc.h.
|
inlinenoexcept |
Stop benchmark consumption.
Definition at line 51 of file context_pc.h.
|
inlinenoexcept |
Stop benchmark production.
Definition at line 49 of file context_pc.h.
|
friend |
Definition at line 28 of file context_pc.h.
|
protected |
Benchmark consume stopped flag.
Definition at line 64 of file context_pc.h.
|
protected |
Benchmark consumers count.
Definition at line 60 of file context_pc.h.
|
protected |
Benchmark produce stopped flag.
Definition at line 62 of file context_pc.h.
|
protected |
Benchmark producers count.
Definition at line 58 of file context_pc.h.