CppBenchmark
1.0.4.0
C++ Benchmark Library
include
benchmark
benchmark_pc.h
Go to the documentation of this file.
1
9
#ifndef CPPBENCHMARK_BENCHMARK_PC_H
10
#define CPPBENCHMARK_BENCHMARK_PC_H
11
12
#include "
benchmark/benchmark_base.h
"
13
#include "
benchmark/context_pc.h
"
14
#include "
benchmark/fixture_pc.h
"
15
#include "
benchmark/settings_pc.h
"
16
17
#include <thread>
18
19
namespace
CppBenchmark
{
20
22
25
class
BenchmarkPC
:
public
BenchmarkBase
,
public
virtual
FixturePC
26
{
27
public
:
29
typedef
SettingsPC
TSettings
;
30
32
36
template
<
typename
... Types>
37
explicit
BenchmarkPC
(
const
std::string&
name
, Types...
settings
) :
BenchmarkPC
(
name
,
TSettings
(
settings
...)) {}
39
43
explicit
BenchmarkPC
(
const
std::string&
name
,
const
TSettings
&
settings
) :
BenchmarkBase
(
name
,
settings
) {}
44
BenchmarkPC
(
const
BenchmarkPC
&) =
delete
;
45
BenchmarkPC
(
BenchmarkPC
&&) =
delete
;
46
virtual
~BenchmarkPC
() =
default
;
47
48
BenchmarkPC
&
operator=
(
const
BenchmarkPC
&) =
delete
;
49
BenchmarkPC
&
operator=
(
BenchmarkPC
&&) =
delete
;
50
51
protected
:
53
59
virtual
void
RunProducer
(
ContextPC
& context) = 0;
61
67
virtual
void
RunConsumer
(
ContextPC
& context) = 0;
68
69
private
:
70
std::vector<std::thread> _threads;
71
72
int
CountLaunches()
const override
;
73
void
Launch(
int
& current,
int
total,
LauncherHandler
& handler)
override
;
74
};
75
80
}
// namespace CppBenchmark
81
82
#endif
// CPPBENCHMARK_BENCHMARK_PC_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::BenchmarkPC
Producers/Consumers benchmark base class.
Definition:
benchmark_pc.h:26
CppBenchmark::BenchmarkPC::BenchmarkPC
BenchmarkPC(const std::string &name, const TSettings &settings)
Alternative class constructor.
Definition:
benchmark_pc.h:43
CppBenchmark::BenchmarkPC::~BenchmarkPC
virtual ~BenchmarkPC()=default
CppBenchmark::BenchmarkPC::BenchmarkPC
BenchmarkPC(const BenchmarkPC &)=delete
CppBenchmark::BenchmarkPC::BenchmarkPC
BenchmarkPC(const std::string &name, Types... settings)
Default class constructor.
Definition:
benchmark_pc.h:37
CppBenchmark::BenchmarkPC::operator=
BenchmarkPC & operator=(const BenchmarkPC &)=delete
CppBenchmark::BenchmarkPC::RunConsumer
virtual void RunConsumer(ContextPC &context)=0
Consumer run method.
CppBenchmark::BenchmarkPC::BenchmarkPC
BenchmarkPC(BenchmarkPC &&)=delete
CppBenchmark::BenchmarkPC::RunProducer
virtual void RunProducer(ContextPC &context)=0
Producer run method.
CppBenchmark::BenchmarkPC::operator=
BenchmarkPC & operator=(BenchmarkPC &&)=delete
CppBenchmark::BenchmarkPC::TSettings
SettingsPC TSettings
BenchmarkPC settings type.
Definition:
benchmark_pc.h:29
CppBenchmark::ContextPC
Benchmark producer/consumer running context.
Definition:
context_pc.h:27
CppBenchmark::FixturePC
Producers/Consumers benchmark fixture.
Definition:
fixture_pc.h:21
CppBenchmark::LauncherHandler
Launcher handler.
Definition:
launcher_handler.h:22
CppBenchmark::SettingsPC
Producers/Consumers benchmark settings.
Definition:
settings_pc.h:21
context_pc.h
Benchmark producer/consumer running context definition.
fixture_pc.h
Producers/Consumers benchmark fixture definition.
CppBenchmark
C++ Benchmark project definitions.
Definition:
barrier.h:15
settings_pc.h
Producers/Consumers benchmark settings definition.
Generated by
1.9.1