OpenWalnut
1.5.0dev
|
A Qt event to call a function from within the GUI thread. More...
#include <WDeferredCallEvent.h>
Public Member Functions | |
WDeferredCallEventBase (WCondition::SPtr notify=WCondition::SPtr()) | |
Constructor. More... | |
virtual | ~WDeferredCallEventBase () |
Destructor. More... | |
void | call () |
Call the function. More... | |
WConditionOneShot::SPtr | getDoneCondition () const |
Get the condition that notifies about the finished execution of the specified function. More... | |
Static Public Attributes | |
static const QEvent::Type | CUSTOM_TYPE = static_cast< QEvent::Type >( WQT_DEFERREDCALL ) |
Constant which saves the number used to distinguish this event from other custom events. More... | |
Protected Member Functions | |
virtual void | callImpl ()=0 |
Call the functor. More... | |
Protected Attributes | |
WCondition::SPtr | m_callCondition |
Fired whenever the function was called. More... | |
A Qt event to call a function from within the GUI thread.
Definition at line 39 of file WDeferredCallEvent.h.
|
inlineexplicit |
Constructor.
notify | specify your own condition to wait for. This is needed since the QApplication doc tells us that ownership of an event is handed over to QT and that it is not save to use the event after posting it. This means we cannot utilize an internal condition in the event as it might be deleted already when calling wait() on it. Do not specify this variable to get a fire-and-forget call. |
Definition at line 49 of file WDeferredCallEvent.h.
|
inlinevirtual |
Destructor.
Definition at line 58 of file WDeferredCallEvent.h.
|
inline |
Call the function.
Definition at line 71 of file WDeferredCallEvent.h.
References callImpl(), and m_callCondition.
|
protectedpure virtual |
Call the functor.
Implemented in WDeferredCallResultEvent< void >, and WDeferredCallResultEvent< Result >.
Referenced by call().
|
inline |
Get the condition that notifies about the finished execution of the specified function.
Definition at line 85 of file WDeferredCallEvent.h.
References m_callCondition.
|
static |
Constant which saves the number used to distinguish this event from other custom events.
Definition at line 66 of file WDeferredCallEvent.h.
Referenced by WMainWindow::customEvent().
|
protected |
Fired whenever the function was called.
Definition at line 93 of file WDeferredCallEvent.h.
Referenced by call(), and getDoneCondition().