CppBenchmark
1.0.4.0
C++ Benchmark Library
include
benchmark
benchmark_threads.h
Go to the documentation of this file.
1
9
#ifndef CPPBENCHMARK_BENCHMARK_THREADS_H
10
#define CPPBENCHMARK_BENCHMARK_THREADS_H
11
12
#include "
benchmark/benchmark_base.h
"
13
#include "
benchmark/context_threads.h
"
14
#include "
benchmark/fixture_threads.h
"
15
#include "
benchmark/settings_threads.h
"
16
17
#include <thread>
18
19
namespace
CppBenchmark
{
20
22
25
class
BenchmarkThreads
:
public
BenchmarkBase
,
public
virtual
FixtureThreads
26
{
27
public
:
29
typedef
SettingsThreads
TSettings
;
30
32
36
template
<
typename
... Types>
37
explicit
BenchmarkThreads
(
const
std::string&
name
, Types...
settings
) :
BenchmarkThreads
(
name
,
TSettings
(
settings
...)) {}
39
43
explicit
BenchmarkThreads
(
const
std::string&
name
,
const
TSettings
&
settings
) :
BenchmarkBase
(
name
,
settings
) {}
44
BenchmarkThreads
(
const
BenchmarkThreads
&) =
delete
;
45
BenchmarkThreads
(
BenchmarkThreads
&&) =
delete
;
46
virtual
~BenchmarkThreads
() =
default
;
47
48
BenchmarkThreads
&
operator=
(
const
BenchmarkThreads
&) =
delete
;
49
BenchmarkThreads
&
operator=
(
BenchmarkThreads
&&) =
delete
;
50
51
protected
:
53
58
virtual
void
RunThread
(
ContextThreads
& context) = 0;
59
60
private
:
61
std::vector<std::thread> _threads;
62
63
int
CountLaunches()
const override
;
64
void
Launch(
int
& current,
int
total,
LauncherHandler
& handler)
override
;
65
};
66
69
}
// namespace CppBenchmark
70
71
#endif
// CPPBENCHMARK_BENCHMARK_THREADS_H
benchmark_base.h
Benchmark base definition.
CppBenchmark::BenchmarkBase
Benchmark base class.
Definition:
benchmark_base.h:25
CppBenchmark::BenchmarkBase::settings
const Settings & settings() const
Get benchmark settings.
Definition:
benchmark_base.h:57
CppBenchmark::BenchmarkBase::name
const std::string & name() const
Get benchmark name.
Definition:
benchmark_base.h:55
CppBenchmark::BenchmarkThreads
Threads benchmark base class.
Definition:
benchmark_threads.h:26
CppBenchmark::BenchmarkThreads::operator=
BenchmarkThreads & operator=(const BenchmarkThreads &)=delete
CppBenchmark::BenchmarkThreads::~BenchmarkThreads
virtual ~BenchmarkThreads()=default
CppBenchmark::BenchmarkThreads::TSettings
SettingsThreads TSettings
BenchmarkThreads settings type.
Definition:
benchmark_threads.h:29
CppBenchmark::BenchmarkThreads::BenchmarkThreads
BenchmarkThreads(const std::string &name, const TSettings &settings)
Alternative class constructor.
Definition:
benchmark_threads.h:43
CppBenchmark::BenchmarkThreads::operator=
BenchmarkThreads & operator=(BenchmarkThreads &&)=delete
CppBenchmark::BenchmarkThreads::BenchmarkThreads
BenchmarkThreads(BenchmarkThreads &&)=delete
CppBenchmark::BenchmarkThreads::RunThread
virtual void RunThread(ContextThreads &context)=0
Thread run method.
CppBenchmark::BenchmarkThreads::BenchmarkThreads
BenchmarkThreads(const BenchmarkThreads &)=delete
CppBenchmark::BenchmarkThreads::BenchmarkThreads
BenchmarkThreads(const std::string &name, Types... settings)
Default class constructor.
Definition:
benchmark_threads.h:37
CppBenchmark::ContextThreads
Benchmark thread running context.
Definition:
context_threads.h:26
CppBenchmark::FixtureThreads
Threads benchmark fixture.
Definition:
fixture_threads.h:21
CppBenchmark::LauncherHandler
Launcher handler.
Definition:
launcher_handler.h:22
CppBenchmark::SettingsThreads
Threads benchmark settings.
Definition:
settings_threads.h:21
context_threads.h
Benchmark thread running context definition.
fixture_threads.h
Threads benchmark fixture definition.
CppBenchmark
C++ Benchmark project definitions.
Definition:
barrier.h:15
settings_threads.h
Threads benchmark settings definition.
Generated by
1.9.1