All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Slots | Signals | Public Member Functions
QGpCoreTools::ThreadTimer Class Reference

#include <ThreadTimer.h>

List of all members.

Public Slots

void synchronize ()
void threadStarted ()
void threadStopped ()

Signals

void synchroTimeout ()

Public Member Functions

int nRunningThreads ()
 ThreadTimer ()
 ~ThreadTimer ()

Constructor & Destructor Documentation

References synchronize(), and TRACE.

{
  TRACE;
  _nofRunningThreads=0;
  connect((QTimer*)this,SIGNAL(timeout()),this,SLOT(synchronize()));
  setSingleShot(true);
}
{}

Member Function Documentation

{return _nofRunningThreads;}

References synchroTimeout(), and TRACE.

Referenced by ThreadTimer().

{
  TRACE;
  QTime chrono;
  chrono.start();
  emit synchroTimeout();
  QCoreApplication::processEvents();
  int updateDelay=5*chrono.elapsed();
  if(updateDelay<1000) updateDelay=1000;
  start(updateDelay);
}

Referenced by synchronize(), and threadStopped().

References TRACE.

{
  TRACE;
  if(_nofRunningThreads==0) {
    start(200);
  }
  _nofRunningThreads++;
}

References synchroTimeout(), and TRACE.

{
  TRACE;
  _nofRunningThreads--;
  if(_nofRunningThreads<=0) {
    stop();
    QTimer::singleShot(500, this, SIGNAL(synchroTimeout()));
  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines