Qt 4.8
Public Types | Public Functions | Public Variables | List of all members
QTest::QBenchmarkIterationController Class Reference

The QBenchmarkIterationController class is used by the QBENCHMARK macro to drive the benchmarking loop. More...

#include <qbenchmark.h>

Public Types

enum  RunMode { RepeatUntilValidMeasurement, RunOnce }
 

Public Functions

bool isDone ()
 
void next ()
 
 QBenchmarkIterationController ()
 
 QBenchmarkIterationController (RunMode runMode)
 
 ~QBenchmarkIterationController ()
 

Public Variables

int i
 

Detailed Description

The QBenchmarkIterationController class is used by the QBENCHMARK macro to drive the benchmarking loop.

Warning
This function is not part of the public interface.

It is repsonsible for starting and stopping the timing measurements as well as calling the result reporting functions.

Definition at line 65 of file qbenchmark.h.

Enumerations

◆ RunMode

Constructors and Destructors

◆ QBenchmarkIterationController() [1/2]

QTest::QBenchmarkIterationController::QBenchmarkIterationController ( )

Definition at line 206 of file qbenchmark.cpp.

207 {
208  i = 0;
210 }
Q_TESTLIB_EXPORT void beginBenchmarkMeasurement()
Definition: qbenchmark.cpp:260

◆ QBenchmarkIterationController() [2/2]

QTest::QBenchmarkIterationController::QBenchmarkIterationController ( RunMode  runMode)
Warning
This function is not part of the public interface.

Definition at line 198 of file qbenchmark.cpp.

199 {
200  i = 0;
201  if (runMode == RunOnce)
204 }
static QBenchmarkTestMethodData * current
Definition: qbenchmark_p.h:167
Q_TESTLIB_EXPORT void beginBenchmarkMeasurement()
Definition: qbenchmark.cpp:260

◆ ~QBenchmarkIterationController()

QTest::QBenchmarkIterationController::~QBenchmarkIterationController ( )
Warning
This function is not part of the public interface.

Definition at line 214 of file qbenchmark.cpp.

215 {
216  const qreal result = QTest::endBenchmarkMeasurement();
218 }
static QBenchmarkGlobalData * current
Definition: qbenchmark_p.h:136
double qreal
Definition: qglobal.h:1193
Q_TESTLIB_EXPORT quint64 endBenchmarkMeasurement()
Definition: qbenchmark.cpp:268
void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro=true)
Definition: qbenchmark.cpp:152
static QBenchmarkTestMethodData * current
Definition: qbenchmark_p.h:167

Functions

◆ isDone()

bool QTest::QBenchmarkIterationController::isDone ( )
Warning
This function is not part of the public interface.

Definition at line 222 of file qbenchmark.cpp.

223 {
225  return i > 0;
226  return i >= QTest::iterationCount();
227 }
int iterationCount()
Definition: qbenchmark.cpp:238
static QBenchmarkTestMethodData * current
Definition: qbenchmark_p.h:167

◆ next()

void QTest::QBenchmarkIterationController::next ( )
Warning
This function is not part of the public interface.

Definition at line 231 of file qbenchmark.cpp.

232 {
233  ++i;
234 }

Properties

◆ i

int QTest::QBenchmarkIterationController::i

Definition at line 74 of file qbenchmark.h.


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