OpenWalnut  1.5.0dev
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
WDeferredCallEventBase Class Referenceabstract

A Qt event to call a function from within the GUI thread. More...

#include <WDeferredCallEvent.h>

+ Inheritance diagram for WDeferredCallEventBase:
+ Collaboration diagram for WDeferredCallEventBase:

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...
 

Detailed Description

A Qt event to call a function from within the GUI thread.

Definition at line 39 of file WDeferredCallEvent.h.

Constructor & Destructor Documentation

◆ WDeferredCallEventBase()

WDeferredCallEventBase::WDeferredCallEventBase ( WCondition::SPtr  notify = WCondition::SPtr())
inlineexplicit

Constructor.

Parameters
notifyspecify 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.

◆ ~WDeferredCallEventBase()

virtual WDeferredCallEventBase::~WDeferredCallEventBase ( )
inlinevirtual

Destructor.

Definition at line 58 of file WDeferredCallEvent.h.

Member Function Documentation

◆ call()

void WDeferredCallEventBase::call ( )
inline

Call the function.

Definition at line 71 of file WDeferredCallEvent.h.

References callImpl(), and m_callCondition.

+ Here is the call graph for this function:

◆ callImpl()

virtual void WDeferredCallEventBase::callImpl ( )
protectedpure virtual

Call the functor.

Implemented in WDeferredCallResultEvent< void >, and WDeferredCallResultEvent< Result >.

Referenced by call().

+ Here is the caller graph for this function:

◆ getDoneCondition()

WConditionOneShot::SPtr WDeferredCallEventBase::getDoneCondition ( ) const
inline

Get the condition that notifies about the finished execution of the specified function.

Returns
the condition. Might be NULL if none was specified.

Definition at line 85 of file WDeferredCallEvent.h.

References m_callCondition.

Member Data Documentation

◆ CUSTOM_TYPE

const QEvent::Type WDeferredCallEventBase::CUSTOM_TYPE = static_cast< QEvent::Type >( WQT_DEFERREDCALL )
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().

◆ m_callCondition

WCondition::SPtr WDeferredCallEventBase::m_callCondition
protected

Fired whenever the function was called.

Definition at line 93 of file WDeferredCallEvent.h.

Referenced by call(), and getDoneCondition().


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