#include <queuedinvoker.h>
Signals | |
void | queuedCall (const char *method) |
Public Member Functions | |
QueuedInvoker () | |
Protected Member Functions | |
void | queueOnce (const char *method) |
Sets the method method to be invoked when the event loop of this object runs next time. | |
Private Slots | |
void | onQueuedCall (const char *method) |
Slot which is executed when the event loop of this object runs. | |
Private Attributes | |
QMutex | callQueueLock |
Protects the callQueue. | |
QSet< QString > | callQueue |
Methods to be invoked. |
Via the method QueuedInvoker::queueOnce, the given method is set to be invoked when the event loop of the object is entered. Each method is queued at most once. QueuedInvoker sends a signal to itself, and when the signal is processed, the method is invoked.
QueuedInvoker is normally used by subclassing it.
ContextSubscriber::QueuedInvoker::QueuedInvoker | ( | ) |
void ContextSubscriber::QueuedInvoker::onQueuedCall | ( | const char * | method | ) | [private, slot] |
Slot which is executed when the event loop of this object runs.
Calls all the methods in the queue.
void ContextSubscriber::QueuedInvoker::queuedCall | ( | const char * | method | ) | [signal] |
void ContextSubscriber::QueuedInvoker::queueOnce | ( | const char * | method | ) | [protected] |
Sets the method method to be invoked when the event loop of this object runs next time.
If the method was already in the queue, it won't be inserted again.
QMutex ContextSubscriber::QueuedInvoker::callQueueLock [private] |
Protects the callQueue.
QSet<QString> ContextSubscriber::QueuedInvoker::callQueue [private] |
Methods to be invoked.