CppBenchmark  1.0.4.0
C++ Benchmark Library
context_threads.h
Go to the documentation of this file.
1 
9 #ifndef CPPBENCHMARK_CONTEXT_THREADS_H
10 #define CPPBENCHMARK_CONTEXT_THREADS_H
11 
12 #include "benchmark/context.h"
13 
14 namespace CppBenchmark {
15 
17 
25 class ContextThreads : public Context
26 {
27  friend class BenchmarkThreads;
28 
29 public:
30  ContextThreads() = delete;
31  ContextThreads(const ContextThreads&) noexcept = default;
32  ContextThreads(ContextThreads&&) noexcept = default;
33  virtual ~ContextThreads() noexcept = default;
34 
35  ContextThreads& operator=(const ContextThreads&) noexcept = default;
36  ContextThreads& operator=(ContextThreads&&) noexcept = default;
37 
39  int threads() const noexcept { return _threads; }
40 
42  std::string description() const override;
43 
44 protected:
46  int _threads;
47 
49 
55  ContextThreads(int threads, int x, int y, int z) noexcept
56  : Context(x, y, z),
58  {}
59 };
60 
61 } // namespace CppBenchmark
62 
63 #endif // CPPBENCHMARK_CONTEXT_THREADS_H
Threads benchmark base class.
Benchmark running context.
Definition: context.h:27
int x() const noexcept
Benchmark first parameter. Valid only if not negative!
Definition: context.h:41
int y() const noexcept
Benchmark second parameter. Valid only if not negative!
Definition: context.h:43
int z() const noexcept
Benchmark third parameter. Valid only if not negative!
Definition: context.h:45
Benchmark thread running context.
int _threads
Benchmark threads count.
ContextThreads(const ContextThreads &) noexcept=default
std::string description() const override
Get description of the current benchmark running context.
ContextThreads(ContextThreads &&) noexcept=default
ContextThreads(int threads, int x, int y, int z) noexcept
Create benchmark running context.
int threads() const noexcept
Benchmark threads count.
Benchmark running context definition.
C++ Benchmark project definitions.
Definition: barrier.h:15