CppBenchmark  1.0.4.0
C++ Benchmark Library
Public Types | Public Member Functions | Protected Member Functions | List of all members
CppBenchmark::BenchmarkThreads Class Referenceabstract

Threads benchmark base class. More...

#include <benchmark_threads.h>

Inheritance diagram for CppBenchmark::BenchmarkThreads:
CppBenchmark::BenchmarkBase CppBenchmark::FixtureThreads

Public Types

typedef SettingsThreads TSettings
 BenchmarkThreads settings type. More...
 

Public Member Functions

template<typename... Types>
 BenchmarkThreads (const std::string &name, Types... settings)
 Default class constructor. More...
 
 BenchmarkThreads (const std::string &name, const TSettings &settings)
 Alternative class constructor. More...
 
 BenchmarkThreads (const BenchmarkThreads &)=delete
 
 BenchmarkThreads (BenchmarkThreads &&)=delete
 
virtual ~BenchmarkThreads ()=default
 
BenchmarkThreadsoperator= (const BenchmarkThreads &)=delete
 
BenchmarkThreadsoperator= (BenchmarkThreads &&)=delete
 
- Public Member Functions inherited from CppBenchmark::BenchmarkBase
template<typename... Types>
 BenchmarkBase (const std::string &name, Types... settings)
 Default class constructor. More...
 
 BenchmarkBase (const std::string &name, const Settings &settings)
 Alternative class constructor. More...
 
 BenchmarkBase (const BenchmarkBase &)=delete
 
 BenchmarkBase (BenchmarkBase &&)=delete
 
virtual ~BenchmarkBase ()=default
 
BenchmarkBaseoperator= (const BenchmarkBase &)=delete
 
BenchmarkBaseoperator= (BenchmarkBase &&)=delete
 
const std::string & name () const
 Get benchmark name. More...
 
const Settingssettings () const
 Get benchmark settings. More...
 
- Public Member Functions inherited from CppBenchmark::FixtureThreads
 FixtureThreads () noexcept=default
 
 FixtureThreads (const FixtureThreads &) noexcept=default
 
 FixtureThreads (FixtureThreads &&) noexcept=default
 
virtual ~FixtureThreads () noexcept=default
 
FixtureThreadsoperator= (const FixtureThreads &) noexcept=default
 
FixtureThreadsoperator= (FixtureThreads &&) noexcept=default
 

Protected Member Functions

virtual void RunThread (ContextThreads &context)=0
 Thread run method. More...
 
- Protected Member Functions inherited from CppBenchmark::BenchmarkBase
void InitBenchmarkContext (Context &context)
 Initialize benchmark context. More...
 
- Protected Member Functions inherited from CppBenchmark::FixtureThreads
virtual void Initialize (ContextThreads &context)
 Initialize benchmark. More...
 
virtual void Cleanup (ContextThreads &context)
 Cleanup benchmark. More...
 
virtual void InitializeThread (ContextThreads &context)
 Initialize thread. More...
 
virtual void CleanupThread (ContextThreads &context)
 Cleanup thread. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from CppBenchmark::BenchmarkBase
static void UpdateBenchmarkMetrics (std::vector< std::shared_ptr< PhaseCore >> &phases)
 Update benchmark metrics for the given benchmark phases collection. More...
 
static void UpdateBenchmarkMetrics (PhaseCore &phase)
 Update benchmark metrics for the given benchmark phase. More...
 
static void UpdateBenchmarkThreads (std::vector< std::shared_ptr< PhaseCore >> &phases)
 Update benchmark threads metrics for the given benchmark phases collection. More...
 
static void UpdateBenchmarkNames (std::vector< std::shared_ptr< PhaseCore >> &phases)
 Update benchmark names for the given benchmark phases collection. More...
 
static void UpdateBenchmarkNames (PhaseCore &phase, const std::string &name)
 Update benchmark names for the given benchmark phase. More...
 
static void UpdateBenchmarkOperations (std::vector< std::shared_ptr< PhaseCore >> &phases)
 Update benchmark operations for the given benchmark phases collection. More...
 
static void UpdateBenchmarkOperations (PhaseCore &phase)
 Update benchmark operations for the given benchmark phase. More...
 
- Protected Attributes inherited from CppBenchmark::BenchmarkBase
bool _launched
 Benchmark launched flag. More...
 
std::string _name
 Benchmark name. More...
 
Settings _settings
 Benchmark settings. More...
 
std::vector< std::shared_ptr< PhaseCore > > _phases
 Benchmark phases. More...
 

Detailed Description

Threads benchmark base class.

Provides interface to perform benchmark in multi-thread environment.

Definition at line 25 of file benchmark_threads.h.

Member Typedef Documentation

◆ TSettings

BenchmarkThreads settings type.

Definition at line 29 of file benchmark_threads.h.

Constructor & Destructor Documentation

◆ BenchmarkThreads() [1/4]

template<typename... Types>
CppBenchmark::BenchmarkThreads::BenchmarkThreads ( const std::string &  name,
Types...  settings 
)
inlineexplicit

Default class constructor.

Parameters
name- Benchmark name
settings- Benchmark settings

Definition at line 37 of file benchmark_threads.h.

◆ BenchmarkThreads() [2/4]

CppBenchmark::BenchmarkThreads::BenchmarkThreads ( const std::string &  name,
const TSettings settings 
)
inlineexplicit

Alternative class constructor.

Parameters
name- Benchmark name
settings- Benchmark settings

Definition at line 43 of file benchmark_threads.h.

◆ BenchmarkThreads() [3/4]

CppBenchmark::BenchmarkThreads::BenchmarkThreads ( const BenchmarkThreads )
delete

◆ BenchmarkThreads() [4/4]

CppBenchmark::BenchmarkThreads::BenchmarkThreads ( BenchmarkThreads &&  )
delete

◆ ~BenchmarkThreads()

virtual CppBenchmark::BenchmarkThreads::~BenchmarkThreads ( )
virtualdefault

Member Function Documentation

◆ operator=() [1/2]

BenchmarkThreads& CppBenchmark::BenchmarkThreads::operator= ( BenchmarkThreads &&  )
delete

◆ operator=() [2/2]

BenchmarkThreads& CppBenchmark::BenchmarkThreads::operator= ( const BenchmarkThreads )
delete

◆ RunThread()

virtual void CppBenchmark::BenchmarkThreads::RunThread ( ContextThreads context)
protectedpure virtual

Thread run method.

Should be implemented to provide code which will be executed in separate thread!

Parameters
context- Threads running context

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