QXRD  0.11.16
Public Slots | Public Member Functions | Private Attributes | List of all members
QxrdResponseTimer Class Reference

#include <qxrdresponsetimer.h>

Inheritance diagram for QxrdResponseTimer:
Inheritance graph
[legend]
Collaboration diagram for QxrdResponseTimer:
Collaboration graph
[legend]

Public Slots

void onTimeout ()
 

Public Member Functions

 QxrdResponseTimer (int interval, int allowance, QcepObject *parent)
 

Private Attributes

int m_ResponseInterval
 
int m_ResponseAllowance
 
QTimer m_ResponseTimer
 
QTime m_ResponseTime
 

Detailed Description

Definition at line 8 of file qxrdresponsetimer.h.

Constructor & Destructor Documentation

QxrdResponseTimer::QxrdResponseTimer ( int  interval,
int  allowance,
QcepObject parent 
)
explicit

Definition at line 5 of file qxrdresponsetimer.cpp.

References m_ResponseInterval, m_ResponseTime, m_ResponseTimer, and onTimeout().

5  :
6  QObject(parent),
7  m_ResponseInterval(interval),
8  m_ResponseAllowance(allowance)
9 {
10  connect(&m_ResponseTimer, &QTimer::timeout, this, &QxrdResponseTimer::onTimeout);
11 
12  m_ResponseTime.start();
14 }

Here is the call graph for this function:

Member Function Documentation

void QxrdResponseTimer::onTimeout ( )
slot

Definition at line 16 of file qxrdresponsetimer.cpp.

References g_Application, m_ResponseAllowance, m_ResponseInterval, m_ResponseTime, and QcepApplication::printMessage().

Referenced by QxrdResponseTimer().

17 {
18  int elapsedTime = m_ResponseTime.restart();
19 
20  if (g_Application && abs(elapsedTime-m_ResponseInterval) > m_ResponseAllowance) {
21  g_Application->printMessage(tr("Excessive response time %1").arg(elapsedTime-m_ResponseInterval));
22  }
23 }
virtual void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())=0
QcepApplication * g_Application

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int QxrdResponseTimer::m_ResponseAllowance
private

Definition at line 19 of file qxrdresponsetimer.h.

Referenced by onTimeout().

int QxrdResponseTimer::m_ResponseInterval
private

Definition at line 18 of file qxrdresponsetimer.h.

Referenced by onTimeout(), and QxrdResponseTimer().

QTime QxrdResponseTimer::m_ResponseTime
private

Definition at line 21 of file qxrdresponsetimer.h.

Referenced by onTimeout(), and QxrdResponseTimer().

QTimer QxrdResponseTimer::m_ResponseTimer
private

Definition at line 20 of file qxrdresponsetimer.h.

Referenced by QxrdResponseTimer().


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