Qt 4.8
Public Functions | Properties | List of all members
QIncrementalSleepTimer Class Reference

#include <qwindowspipewriter_p.h>

Public Functions

bool hasTimedOut () const
 
int nextSleepTime ()
 
 QIncrementalSleepTimer (int msecs)
 
void resetIncrements ()
 
int timeLeft () const
 

Properties

int nextSleep
 
QTime timer
 
int totalTimeOut
 

Detailed Description

Definition at line 73 of file qwindowspipewriter_p.h.

Constructors and Destructors

◆ QIncrementalSleepTimer()

QIncrementalSleepTimer::QIncrementalSleepTimer ( int  msecs)
inline

Definition at line 77 of file qwindowspipewriter_p.h.

78  : totalTimeOut(msecs)
80  {
81  if (totalTimeOut == -1)
83  timer.start();
84  }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
void start()
Sets this time to the current time.
Definition: qdatetime.cpp:2070
#define SLEEPMIN

Functions

◆ hasTimedOut()

bool QIncrementalSleepTimer::hasTimedOut ( ) const
inline

Definition at line 100 of file qwindowspipewriter_p.h.

Referenced by QLocalSocketPrivate::_q_emitReadyRead(), and qt_terminateApp().

101  {
102  if (totalTimeOut == -1)
103  return false;
104  return timer.elapsed() >= totalTimeOut;
105  }
int elapsed() const
Returns the number of milliseconds that have elapsed since the last time start() or restart() was cal...
Definition: qdatetime.cpp:2123

◆ nextSleepTime()

int QIncrementalSleepTimer::nextSleepTime ( )
inline

Definition at line 86 of file qwindowspipewriter_p.h.

Referenced by QLocalSocketPrivate::_q_emitReadyRead(), and qt_terminateApp().

87  {
88  int tmp = nextSleep;
90  return tmp;
91  }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define SLEEPMAX

◆ resetIncrements()

void QIncrementalSleepTimer::resetIncrements ( )
inline

Definition at line 107 of file qwindowspipewriter_p.h.

Referenced by qt_terminateApp().

108  {
110  }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define SLEEPMIN

◆ timeLeft()

int QIncrementalSleepTimer::timeLeft ( ) const
inline

Definition at line 93 of file qwindowspipewriter_p.h.

Referenced by nextSleepTime(), and resetIncrements().

94  {
95  if (totalTimeOut == -1)
96  return SLEEPMAX;
97  return qMax(totalTimeOut - timer.elapsed(), 0);
98  }
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define SLEEPMAX
int elapsed() const
Returns the number of milliseconds that have elapsed since the last time start() or restart() was cal...
Definition: qdatetime.cpp:2123

Properties

◆ nextSleep

int QIncrementalSleepTimer::nextSleep
private

Definition at line 115 of file qwindowspipewriter_p.h.

Referenced by nextSleepTime(), QIncrementalSleepTimer(), and resetIncrements().

◆ timer

QTime QIncrementalSleepTimer::timer
private

Definition at line 113 of file qwindowspipewriter_p.h.

Referenced by hasTimedOut(), QIncrementalSleepTimer(), and timeLeft().

◆ totalTimeOut

int QIncrementalSleepTimer::totalTimeOut
private

Definition at line 114 of file qwindowspipewriter_p.h.

Referenced by hasTimedOut(), QIncrementalSleepTimer(), and timeLeft().


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