Celero
Experiment.h
1 #pragma once
2 
20 
21 #include <celero/ExperimentResult.h>
22 #include <celero/Factory.h>
23 #include <celero/Statistics.h>
24 
25 #include <string>
26 
27 namespace celero
28 {
29  class Benchmark;
30 
36  class CELERO_EXPORT Experiment
37  {
38  public:
42  explicit Experiment(std::weak_ptr<celero::Benchmark> benchmark);
43 
47  explicit Experiment(std::weak_ptr<celero::Benchmark> benchmark, const std::string& name, uint64_t samples, uint64_t iterations,
48  uint64_t threads, double baselineTarget);
49 
53  ~Experiment();
54 
55  Experiment(const Experiment&) = delete;
56  Experiment& operator=(Experiment const& other) = delete;
57 
61  std::shared_ptr<celero::Benchmark> getBenchmark();
62 
66  void setName(const std::string& x);
67 
71  std::string getName() const;
72 
76  void setSamples(uint64_t x);
77 
81  uint64_t getSamples() const;
82 
86  void setIterations(uint64_t x);
87 
91  uint64_t getIterations() const;
92 
96  void setThreads(uint64_t x);
97 
101  uint64_t getThreads() const;
102 
106  operator std::string() const;
107 
111  std::string getShort() const;
112 
116  void setBaselineTarget(double x);
117 
121  double getBaselineTarget() const;
122 
126  void incrementTotalRunTime(const uint64_t x);
127 
131  uint64_t getTotalRunTime() const;
132 
136  void setIsBaselineCase(bool x);
137 
141  bool getIsBaselineCase() const;
142 
146  void setFactory(std::shared_ptr<celero::Factory> x);
147 
151  std::shared_ptr<celero::Factory> getFactory() const;
152 
157  void addProblemSpace(std::shared_ptr<celero::TestFixture::ExperimentValue> x, double scale = 1.0);
158 
162  size_t getResultSize();
163 
167  std::shared_ptr<celero::ExperimentResult> getResult(size_t x);
168 
172  std::shared_ptr<celero::ExperimentResult> getResultByValue(int64_t x);
173 
174  private:
178  Experiment();
179 
184  class Impl;
185 
189  Pimpl<Impl> pimpl;
190  };
191 } // namespace celero
192 
Definition: Archive.h:25
Definition: Pimpl.h:36
Definition: Experiment.cpp:31
Definition: Experiment.h:36