QXRD  0.11.16
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
QxrdFileBrowserModelUpdaterThread Class Reference

#include <qxrdfilebrowsermodelupdaterthread.h>

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

Public Member Functions

 QxrdFileBrowserModelUpdaterThread ()
 
virtual ~QxrdFileBrowserModelUpdaterThread ()
 
void setModel (QxrdFileBrowserModelWPtr model)
 
QxrdFileBrowserModelUpdaterPtr updater () const
 
void shutdown ()
 
- Public Member Functions inherited from QxrdThread
 QxrdThread (QObject *parent=0)
 
- Public Member Functions inherited from QcepThread
 QcepThread (QObject *parent=0)
 

Protected Member Functions

void run ()
 

Private Attributes

QxrdFileBrowserModelWPtr m_Model
 
QxrdFileBrowserModelUpdaterPtr m_Updater
 

Additional Inherited Members

- Static Public Member Functions inherited from QcepThread
static void msleep (long unsigned int)
 
- Protected Attributes inherited from QcepThread
QMutex m_Mutex
 

Detailed Description

Definition at line 8 of file qxrdfilebrowsermodelupdaterthread.h.

Constructor & Destructor Documentation

QxrdFileBrowserModelUpdaterThread::QxrdFileBrowserModelUpdaterThread ( )
explicit

Definition at line 8 of file qxrdfilebrowsermodelupdaterthread.cpp.

References DEBUG_CONSTRUCTORS, and qcepDebug().

8  :
9  QxrdThread(),
10  m_Model(),
11  m_Updater()
12 {
14  printf("QxrdFileBrowserModelUpdaterThread::QxrdFileBrowserModelUpdaterThread(%p)\n", this);
15  }
16 
17  setObjectName("updater");
18 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdThread(QObject *parent=0)
Definition: qxrdthread.cpp:3

Here is the call graph for this function:

QxrdFileBrowserModelUpdaterThread::~QxrdFileBrowserModelUpdaterThread ( )
virtual

Definition at line 20 of file qxrdfilebrowsermodelupdaterthread.cpp.

References DEBUG_CONSTRUCTORS, qcepDebug(), and shutdown().

21 {
22  shutdown();
23 
25  printf("QxrdFileBrowserModelUpdaterThread::~QxrdFileBrowserModelUpdaterThread(%p)\n", this);
26  }
27 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

Member Function Documentation

void QxrdFileBrowserModelUpdaterThread::run ( )
protected

Definition at line 42 of file qxrdfilebrowsermodelupdaterthread.cpp.

References DEBUG_THREADS, m_Model, QcepThread::m_Mutex, m_Updater, and qcepDebug().

43 {
44  if (qcepDebug(DEBUG_THREADS)) {
45  printf("Browser Model Updater Thread Started\n");
46  }
47 
51 
52  int rc = -1;
53 
54  if (p) {
55  m_Mutex.lock();
56  m_Updater = p;
57  m_Mutex.unlock();
58 
59  rc = exec();
60  }
61 
62  {
63  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
64 
66  }
67 
68  if (qcepDebug(DEBUG_THREADS)) {
69  printf("Browser Model Updater Thread Terminated with rc %d\n", rc);
70  }
71 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdFileBrowserModelUpdater > QxrdFileBrowserModelUpdaterPtr
QMutex m_Mutex
Definition: qcepthread.h:17

Here is the call graph for this function:

void QxrdFileBrowserModelUpdaterThread::setModel ( QxrdFileBrowserModelWPtr  model)

Definition at line 29 of file qxrdfilebrowsermodelupdaterthread.cpp.

References m_Model.

30 {
31  m_Model = model;
32 }
void QxrdFileBrowserModelUpdaterThread::shutdown ( )
virtual

Implements QxrdThread.

Definition at line 34 of file qxrdfilebrowsermodelupdaterthread.cpp.

Referenced by ~QxrdFileBrowserModelUpdaterThread().

35 {
36 // INVOKE_CHECK(QMetaObject::invokeMethod(m_Updater.data(),"shutdown",Qt::QueuedConnection));
37  exit();
38 
39  wait();
40 }

Here is the caller graph for this function:

QxrdFileBrowserModelUpdaterPtr QxrdFileBrowserModelUpdaterThread::updater ( ) const

Definition at line 73 of file qxrdfilebrowsermodelupdaterthread.cpp.

References QcepThread::m_Mutex, and m_Updater.

Referenced by checkSortInterrupt().

74 {
75  while (isRunning()) {
76  {
77  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
78 
79  if (m_Updater) return m_Updater;
80  }
81 
82  QThread::msleep(50);
83  }
84 
86 }
QSharedPointer< QxrdFileBrowserModelUpdater > QxrdFileBrowserModelUpdaterPtr
QMutex m_Mutex
Definition: qcepthread.h:17

Here is the caller graph for this function:

Member Data Documentation

QxrdFileBrowserModelWPtr QxrdFileBrowserModelUpdaterThread::m_Model
private

Definition at line 24 of file qxrdfilebrowsermodelupdaterthread.h.

Referenced by run(), and setModel().

QxrdFileBrowserModelUpdaterPtr QxrdFileBrowserModelUpdaterThread::m_Updater
private

Definition at line 25 of file qxrdfilebrowsermodelupdaterthread.h.

Referenced by run(), and updater().


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