Qt 4.8
Public Types | Public Functions | Public Variables | Static Public Variables | Properties | List of all members
QBenchmarkGlobalData Class Reference

#include <qbenchmark_p.h>

Public Types

enum  Mode {
  WallTime, CallgrindParentProcess, CallgrindChildProcess, TickCounter,
  EventCounter
}
 

Public Functions

int adjustMedianIterationCount ()
 
QBenchmarkMeasurerBasecreateMeasurer ()
 
Mode mode () const
 
 QBenchmarkGlobalData ()
 
void setMode (Mode mode)
 
 ~QBenchmarkGlobalData ()
 

Public Variables

QString callgrindOutFileBase
 
QBenchmarkContext context
 
bool createChart
 
int iterationCount
 
QBenchmarkMeasurerBasemeasurer
 
int medianIterationCount
 
bool verboseOutput
 
int walltimeMinimum
 

Static Public Variables

static QBenchmarkGlobalDatacurrent
 

Properties

Mode mode_
 

Detailed Description

Definition at line 133 of file qbenchmark_p.h.

Enumerations

◆ Mode

Constructors and Destructors

◆ QBenchmarkGlobalData()

QBenchmarkGlobalData::QBenchmarkGlobalData ( )

Definition at line 59 of file qbenchmark.cpp.

60  : measurer(0)
61  , walltimeMinimum(-1)
62  , iterationCount(-1)
64  , createChart(false)
65  , verboseOutput(false)
66  , mode_(WallTime)
67 {
68  setMode(mode_);
69 }
QBenchmarkMeasurerBase * measurer
Definition: qbenchmark_p.h:146
void setMode(Mode mode)
Definition: qbenchmark.cpp:77

◆ ~QBenchmarkGlobalData()

QBenchmarkGlobalData::~QBenchmarkGlobalData ( )

Definition at line 71 of file qbenchmark.cpp.

72 {
73  delete measurer;
75 }
static QBenchmarkGlobalData * current
Definition: qbenchmark_p.h:136
QBenchmarkMeasurerBase * measurer
Definition: qbenchmark_p.h:146

Functions

◆ adjustMedianIterationCount()

int QBenchmarkGlobalData::adjustMedianIterationCount ( )

Definition at line 107 of file qbenchmark.cpp.

108 {
109  if (medianIterationCount != -1) {
110  return medianIterationCount;
111  } else {
112  return measurer->adjustMedianCount(1);
113  }
114 }
QBenchmarkMeasurerBase * measurer
Definition: qbenchmark_p.h:146
virtual int adjustMedianCount(int suggestion)=0

◆ createMeasurer()

QBenchmarkMeasurerBase * QBenchmarkGlobalData::createMeasurer ( )

Definition at line 86 of file qbenchmark.cpp.

Referenced by setMode().

87 {
89  if (0) {
90 #ifdef QTESTLIB_USE_VALGRIND
92  measurer = new QBenchmarkCallgrindMeasurer;
93 #endif
94 #ifdef HAVE_TICK_COUNTER
95  } else if (mode_ == TickCounter) {
96  measurer = new QBenchmarkTickMeasurer;
97 #endif
98  } else if (mode_ == EventCounter) {
99  measurer = new QBenchmarkEvent;
100  } else {
101  measurer = new QBenchmarkTimeMeasurer;
102  }
103  measurer->init();
104  return measurer;
105 }
QBenchmarkMeasurerBase * measurer
Definition: qbenchmark_p.h:146

◆ mode()

Mode QBenchmarkGlobalData::mode ( ) const
inline

Definition at line 142 of file qbenchmark_p.h.

Referenced by setMode().

142 { return mode_; }

◆ setMode()

void QBenchmarkGlobalData::setMode ( Mode  mode)

Definition at line 77 of file qbenchmark.cpp.

Referenced by QBenchmarkGlobalData(), and QTest::qtest_qParseArgs().

78 {
79  mode_ = mode;
80 
81  if (measurer)
82  delete measurer;
84 }
QBenchmarkMeasurerBase * measurer
Definition: qbenchmark_p.h:146
QBenchmarkMeasurerBase * createMeasurer()
Definition: qbenchmark.cpp:86

Properties

◆ callgrindOutFileBase

QString QBenchmarkGlobalData::callgrindOutFileBase

◆ context

QBenchmarkContext QBenchmarkGlobalData::context

Definition at line 147 of file qbenchmark_p.h.

Referenced by QTest::qInvokeTestMethod(), and QTest::qInvokeTestMethodDataEntry().

◆ createChart

bool QBenchmarkGlobalData::createChart

Definition at line 151 of file qbenchmark_p.h.

◆ current

QBenchmarkGlobalData * QBenchmarkGlobalData::current
static

◆ iterationCount

int QBenchmarkGlobalData::iterationCount

◆ measurer

QBenchmarkMeasurerBase* QBenchmarkGlobalData::measurer

◆ medianIterationCount

int QBenchmarkGlobalData::medianIterationCount

Definition at line 150 of file qbenchmark_p.h.

Referenced by adjustMedianIterationCount(), and QTest::qtest_qParseArgs().

◆ mode_

Mode QBenchmarkGlobalData::mode_
private

Definition at line 155 of file qbenchmark_p.h.

Referenced by createMeasurer(), QBenchmarkGlobalData(), and setMode().

◆ verboseOutput

bool QBenchmarkGlobalData::verboseOutput

Definition at line 152 of file qbenchmark_p.h.

Referenced by QTest::qtest_qParseArgs().

◆ walltimeMinimum

int QBenchmarkGlobalData::walltimeMinimum

Definition at line 148 of file qbenchmark_p.h.

Referenced by QTest::qtest_qParseArgs(), and QBenchmarkTestMethodData::setResult().


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