C++ API Library Reference  4.3.2-74-ge1d4cca
Classes | Public Static Functions | List of all members
UiDispatcher Class Reference

UiDispatcher is used to marshal functions onto a single thread, designated the "UI" thread.

Public Static Functions

static AsyncResult BeginInvoke (Function< void(void)> func)
 
template<typename Param0 >
static AsyncResult BeginInvoke (Function< void(Param0)> func, Param0 p0)
 
template<typename Param0 , typename Param1 >
static AsyncResult BeginInvoke (Function< void(Param0, Param1)> func, Param0 p0, Param1 p1)
 
template<typename Param0 , typename Param1 , typename Param2 >
static AsyncResult BeginInvoke (Function< void(Param0, Param1, Param2)> func, Param0 p0, Param1 p1, Param2 p2)
 
template<typename Param0 , typename Param1 , typename Param2 , typename Param3 >
static AsyncResult BeginInvoke (Function< void(Param0, Param1, Param2, Param3)> func, Param0 p0, Param1 p1, Param2 p2, Param3 p3)
 
template<typename Param0 , typename Param1 , typename Param2 , typename Param3 , typename Param4 >
static AsyncResult BeginInvoke (Function< void(Param0, Param1, Param2, Param3, Param4)> func, Param0 p0, Param1 p1, Param2 p2, Param3 p3, Param4 p4)
 
static void EndInvoke (AsyncResult const &result)
 
static void EndInvoke (AsyncResult const &result, ExceptionPtr &pException)
 
static bool HasMessageThread ()
 
static void InitMessageThread ()
 
static void Invoke (Function< void(void)> func)
 
template<typename Param0 >
static void Invoke (Function< void(Param0)> func, Param0 p0)
 
template<typename Param0 , typename Param1 >
static void Invoke (Function< void(Param0, Param1)> func, Param0 p0, Param1 p1)
 
template<typename Param0 , typename Param1 , typename Param2 >
static void Invoke (Function< void(Param0, Param1, Param2)> func, Param0 p0, Param1 p1, Param2 p2)
 
template<typename Param0 , typename Param1 , typename Param2 , typename Param3 >
static void Invoke (Function< void(Param0, Param1, Param2, Param3)> func, Param0 p0, Param1 p1, Param2 p2, Param3 p3)
 
template<typename Param0 , typename Param1 , typename Param2 , typename Param3 , typename Param4 >
static void Invoke (Function< void(Param0, Param1, Param2, Param3, Param4)> func, Param0 p0, Param1 p1, Param2 p2, Param3 p3, Param4 p4)
 
static bool IsMessageThread ()
 
static bool PumpMessages (TimeSpan timeout=TimeSpan::Zero())
 
static AsyncResult QueueMessage (Function< void(void)> message, QueuedMessageCallback callback=QueuedMessageCallback(), void *pUserState=NULL)
 
static bool RequiresInvoke ()
 
static void VerifyAccess ()
 

Usage Description

static AsyncResult BeginInvoke ( Function< void(void)>  func)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static AsyncResult BeginInvoke ( Function< void(Param0)>  func,
Param0  p0 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static AsyncResult BeginInvoke ( Function< void(Param0, Param1)>  func,
Param0  p0,
Param1  p1 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static AsyncResult BeginInvoke ( Function< void(Param0, Param1, Param2)>  func,
Param0  p0,
Param1  p1,
Param2  p2 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static AsyncResult BeginInvoke ( Function< void(Param0, Param1, Param2, Param3)>  func,
Param0  p0,
Param1  p1,
Param2  p2,
Param3  p3 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static AsyncResult BeginInvoke ( Function< void(Param0, Param1, Param2, Param3, Param4)>  func,
Param0  p0,
Param1  p1,
Param2  p2,
Param3  p3,
Param4  p4 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread.

static void EndInvoke ( AsyncResult const &  result)
static

Waits for result of call to BeginInvoke to complete. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static void EndInvoke ( AsyncResult const &  result,
ExceptionPtr &  pException 
)
static

Waits for result of call to BeginInvoke to complete. On return pException will contain any exceptions that occurred while invoking the function on the UI thread.

static bool HasMessageThread ( )
static

Call to check if a UI thread has been designated via InitMessageThread.

static void InitMessageThread ( )
static

Initialize message dispatcher.

static void Invoke ( Function< void(void)>  func)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously.

static void Invoke ( Function< void(Param0)>  func,
Param0  p0 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static void Invoke ( Function< void(Param0, Param1)>  func,
Param0  p0,
Param1  p1 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static void Invoke ( Function< void(Param0, Param1, Param2)>  func,
Param0  p0,
Param1  p1,
Param2  p2 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static void Invoke ( Function< void(Param0, Param1, Param2, Param3)>  func,
Param0  p0,
Param1  p1,
Param2  p2,
Param3  p3 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static void Invoke ( Function< void(Param0, Param1, Param2, Param3, Param4)>  func,
Param0  p0,
Param1  p1,
Param2  p2,
Param3  p3,
Param4  p4 
)
inlinestatic

Queues the specified function to be invoked on the UI (message) thread, and waits for it to complete. If called on the UI thread, or there is no UI thread, then the function is called synchronously. Will re-throw any exceptions that occurred while invoking the function on the UI thread.

static bool IsMessageThread ( )
static

Call to check if the current thread is the message thread.

static bool PumpMessages ( TimeSpan  timeout = TimeSpan::Zero())
static

Called to pump any queued messages. Will wait up to the specified timeout for messages to be placed in the queue. Returns true if any messages were in the queue and were succesfully dispatched; false otherwise;

static AsyncResult QueueMessage ( Function< void(void)>  message,
QueuedMessageCallback  callback = QueuedMessageCallback(),
void *  pUserState = NULL 
)
static

Called to queue a "message" that will be dispatched by "PumpMessages".

static bool RequiresInvoke ( )
static

Returns true if a message thead exists and is not the same as the current thread, in which case a function that needs to be invoked on the UI (message) thread should not be called synchronously, but via one of the Invoke or BeginInvoke APIs.

static void VerifyAccess ( )
static

Will throw if calling RequiresInvoke on the current thread would return true.