CppBenchmark  1.0.4.0
C++ Benchmark Library
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CppBenchmark::ContextThreads Class Reference

Benchmark thread running context. More...

#include <context_threads.h>

Inheritance diagram for CppBenchmark::ContextThreads:
CppBenchmark::Context CppBenchmark::Phase

Public Member Functions

 ContextThreads ()=delete
 
 ContextThreads (const ContextThreads &) noexcept=default
 
 ContextThreads (ContextThreads &&) noexcept=default
 
virtual ~ContextThreads () noexcept=default
 
ContextThreadsoperator= (const ContextThreads &) noexcept=default
 
ContextThreadsoperator= (ContextThreads &&) noexcept=default
 
int threads () const noexcept
 Benchmark threads count. 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
 
Contextoperator= (const Context &) noexcept=default
 
Contextoperator= (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...
 
PhaseMetricsmetrics () 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 PhaseMetricsmetrics () const noexcept override
 Get phase metrics. More...
 
std::shared_ptr< PhaseStartPhase (const std::string &phase) override
 Start a new sub-phase with a given name in a single-thread environment. More...
 
std::shared_ptr< PhaseStartPhaseThreadSafe (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< PhaseScopeScopePhase (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< PhaseScopeScopePhaseThreadSafe (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
 
Phaseoperator= (const Phase &)=default
 
Phaseoperator= (Phase &&) noexcept=default
 

Protected Member Functions

 ContextThreads (int threads, 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 _threads
 Benchmark threads count. 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 BenchmarkThreads
 

Detailed Description

Benchmark thread running context.

Provides access to the current threads benchmark context information:

Definition at line 25 of file context_threads.h.

Constructor & Destructor Documentation

◆ ContextThreads() [1/4]

CppBenchmark::ContextThreads::ContextThreads ( )
delete

◆ ContextThreads() [2/4]

CppBenchmark::ContextThreads::ContextThreads ( const ContextThreads )
defaultnoexcept

◆ ContextThreads() [3/4]

CppBenchmark::ContextThreads::ContextThreads ( ContextThreads &&  )
defaultnoexcept

◆ ~ContextThreads()

virtual CppBenchmark::ContextThreads::~ContextThreads ( )
virtualdefaultnoexcept

◆ ContextThreads() [4/4]

CppBenchmark::ContextThreads::ContextThreads ( int  threads,
int  x,
int  y,
int  z 
)
inlineprotectednoexcept

Create benchmark running context.

Parameters
threads- Benchmark threads count
x- Benchmark first parameter
y- Benchmark second parameter
z- Benchmark third parameter

Definition at line 55 of file context_threads.h.

Member Function Documentation

◆ description()

std::string CppBenchmark::ContextThreads::description ( ) const
overridevirtual

Get description of the current benchmark running context.

Reimplemented from CppBenchmark::Context.

Definition at line 13 of file context_threads.cpp.

◆ operator=() [1/2]

ContextThreads& CppBenchmark::ContextThreads::operator= ( const ContextThreads )
defaultnoexcept

◆ operator=() [2/2]

ContextThreads& CppBenchmark::ContextThreads::operator= ( ContextThreads &&  )
defaultnoexcept

◆ threads()

int CppBenchmark::ContextThreads::threads ( ) const
inlinenoexcept

Benchmark threads count.

Definition at line 39 of file context_threads.h.

Friends And Related Function Documentation

◆ BenchmarkThreads

friend class BenchmarkThreads
friend

Definition at line 27 of file context_threads.h.

Member Data Documentation

◆ _threads

int CppBenchmark::ContextThreads::_threads
protected

Benchmark threads count.

Definition at line 46 of file context_threads.h.


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