ContextSubscriber::QueuedInvoker Class Reference

A class that can invoke its own methods in a delayed way. More...

#include <queuedinvoker.h>

Inheritance diagram for ContextSubscriber::QueuedInvoker:

ContextSubscriber::Provider

List of all members.

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.


Detailed Description

A class that can invoke its own methods in a delayed way.

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.


Constructor & Destructor Documentation

ContextSubscriber::QueuedInvoker::QueuedInvoker (  ) 


Member Function Documentation

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.


Member Data Documentation

Protects the callQueue.

Methods to be invoked.


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

Generated on Thu Feb 21 18:31:19 2013 for libcontextsubscriber by  doxygen 1.5.6