My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
DotRunnerQueue Class Reference

#include <dot.h>

Public Member Functions

void enqueue (DotRunner *runner)
 
DotRunnerdequeue ()
 
uint count () const
 

Private Attributes

QWaitCondition m_bufferNotEmpty
 
QQueue< DotRunnerm_queue
 
QMutex m_mutex
 

Detailed Description

Queue of dot jobs to run.

Definition at line 437 of file dot.h.

Member Function Documentation

uint DotRunnerQueue::count ( ) const

Definition at line 1137 of file dot.cpp.

References m_mutex, and m_queue.

Referenced by DotManager::run().

{
QMutexLocker locker(&m_mutex);
return m_queue.count();
}
DotRunner * DotRunnerQueue::dequeue ( )

Definition at line 1125 of file dot.cpp.

References m_bufferNotEmpty, m_mutex, and m_queue.

Referenced by DotWorkerThread::run().

{
QMutexLocker locker(&m_mutex);
while (m_queue.isEmpty())
{
// wait until something is added to the queue
}
DotRunner *result = m_queue.dequeue();
return result;
}
void DotRunnerQueue::enqueue ( DotRunner runner)

Definition at line 1118 of file dot.cpp.

References m_bufferNotEmpty, m_mutex, and m_queue.

Referenced by DotManager::run().

{
QMutexLocker locker(&m_mutex);
m_queue.enqueue(runner);
m_bufferNotEmpty.wakeAll();
}

Member Data Documentation

QWaitCondition DotRunnerQueue::m_bufferNotEmpty
private

Definition at line 444 of file dot.h.

Referenced by dequeue(), and enqueue().

QMutex DotRunnerQueue::m_mutex
mutableprivate

Definition at line 446 of file dot.h.

Referenced by count(), dequeue(), and enqueue().

QQueue<DotRunner> DotRunnerQueue::m_queue
private

Definition at line 445 of file dot.h.

Referenced by count(), dequeue(), and enqueue().


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