uicore::RunLoop Class Reference

Main thread message pump processing. More...

#include <run_loop.h>

Static Public Member Functions

static void exit ()
 Signal that message processing should end immediately. More...
 
static void main_thread_async (std::function< void()> func)
 Executes a function on the main thread during message processing. More...
 
template<typename T >
static std::future< T > main_thread_task (std::function< T()> func)
 Executes a task on the main thread with a future result. More...
 
static std::future< void > main_thread_task (std::function< void()> func)
 
static bool process (int timeout_ms=0)
 Process messages for specified amount of time. More...
 
static void run ()
 Continously process messages until RunLoop::exit() is called. More...
 

Detailed Description

Main thread message pump processing.

Member Function Documentation

static void uicore::RunLoop::exit ( )
static

Signal that message processing should end immediately.

static void uicore::RunLoop::main_thread_async ( std::function< void()>  func)
static

Executes a function on the main thread during message processing.

This provides a thread-safe way to execute some code on the main thread as part of the message processing step.

Referenced by main_thread_task().

template<typename T >
static std::future<T> uicore::RunLoop::main_thread_task ( std::function< T()>  func)
inlinestatic

Executes a task on the main thread with a future result.

This provides a thread-safe way to execute some code on the main thread as part of the message processing step. The caller can then wait and access the result of the operation through the returned future.

References main_thread_async().

static std::future<void> uicore::RunLoop::main_thread_task ( std::function< void()>  func)
inlinestatic

References main_thread_async().

static bool uicore::RunLoop::process ( int  timeout_ms = 0)
static

Process messages for specified amount of time.

Return values
Returnsfalse if RunLoop::exit() has been called or the OS signalled the app needs to shut down
static void uicore::RunLoop::run ( )
static

Continously process messages until RunLoop::exit() is called.


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