25 #ifndef WDEFERREDCALLEVENT_H
26 #define WDEFERREDCALLEVENT_H
28 #include <boost/function.hpp>
30 #include <QtCore/QEvent>
32 #include "core/common/WConditionOneShot.h"
34 #include "WEventTypes.h"
66 static const QEvent::Type
CUSTOM_TYPE =
static_cast< QEvent::Type
>( WQT_DEFERREDCALL );
107 template<
typename Result >
std::shared_ptr< WCondition > SPtr
Shared pointer type for WCondition.
A Qt event to call a function from within the GUI thread.
void call()
Call the function.
WDeferredCallEventBase(WCondition::SPtr notify=WCondition::SPtr())
Constructor.
WConditionOneShot::SPtr getDoneCondition() const
Get the condition that notifies about the finished execution of the specified function.
WCondition::SPtr m_callCondition
Fired whenever the function was called.
virtual void callImpl()=0
Call the functor.
static const QEvent::Type CUSTOM_TYPE
Constant which saves the number used to distinguish this event from other custom events.
virtual ~WDeferredCallEventBase()
Destructor.
Derived WDeferredCallEvent allowing result values in calls.
virtual ~WDeferredCallResultEvent()
Destructor.
boost::function< void(void) > m_function
the title of the widget to create
virtual void callImpl()
Call the function.
WDeferredCallResultEvent(boost::function< void(void) > function, WCondition::SPtr notify=WCondition::SPtr())
Constructor.
Derived WDeferredCallEvent allowing result values in calls.
boost::function< Result(void) > m_function
the title of the widget to create
virtual ~WDeferredCallResultEvent()
Destructor.
virtual void callImpl()
Call the function.
WDeferredCallResultEvent(boost::function< Result(void) > function, Result *result, WCondition::SPtr notify=WCondition::SPtr())
Constructor.
Result * m_result
The result.