SPH
|
Posting events to be executed on main thread. More...
Go to the source code of this file.
Classes | |
class | MainLoopEvent |
Custom event holding a callback. More... | |
Namespaces | |
Sph | |
Macros | |
#define | MainLoopEventHandler(func) wxEVENT_HANDLER_CAST(MainLoopEventFunction, func) |
Typedefs | |
typedef void(wxEvtHandler::* | MainLoopEventFunction) (Sph::MainLoopEvent &) |
Functions | |
wxDECLARE_EVENT (MAIN_LOOP_TYPE, Sph::MainLoopEvent) | |
void | executeOnMainThread (const Function< void()> &function) |
Posts a callback to be executed on main thread. More... | |
template<typename Type , typename TFunctor > | |
void | executeOnMainThread (const SharedPtr< Type > &ptr, TFunctor functor) |
Executes a callback in main thread, passing a shared pointer to given object as its argument. More... | |
#define MainLoopEventHandler | ( | func | ) | wxEVENT_HANDLER_CAST(MainLoopEventFunction, func) |
Definition at line 18 of file MainLoop.h.
typedef void(wxEvtHandler::* MainLoopEventFunction) (Sph::MainLoopEvent &) |
Definition at line 17 of file MainLoop.h.
void executeOnMainThread | ( | const Function< void()> & | function | ) |
Posts a callback to be executed on main thread.
The function does not wait for the callback to be executed. The callback is executed by wxWidget framework; that means the event loop must be running and there must be an event handler executing the callback.
Definition at line 8 of file MainLoop.cpp.
void executeOnMainThread | ( | const SharedPtr< Type > & | ptr, |
TFunctor | functor | ||
) |
Executes a callback in main thread, passing a shared pointer to given object as its argument.
The callback is only executed if the object referenced by the shared pointer is not expired, otherwise it is ignored.
Definition at line 60 of file MainLoop.h.
wxDECLARE_EVENT | ( | MAIN_LOOP_TYPE | , |
Sph::MainLoopEvent | |||
) |