Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
UiDispatcher Class Reference

#include "stage/ctrl/ui-dispatcher.hpp"

Description

Helper to dispatch code blocks into the UI event thread for execution.

Implementation of the actual dispatch is based on Glib::Dispatcher

Warning
any UiDispatcher instance must be created such as to ensure it outlives the GTK event loop

Definition at line 102 of file ui-dispatcher.hpp.

Public Member Functions

template<class FUN >
 UiDispatcher (FUN notification)
 
void event (Operation &&op)
 move the given operation into our private dispatcher queue and then schedule dequeuing and invocation into the UI event thread.
 

Private Types

using Operation = lib::CallQueue::Operation
 

Private Attributes

lib::CallQueue queue_
 
Glib::Dispatcher dispatcher_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ UiDispatcher()

template<class FUN >
UiDispatcher ( FUN  notification)
inline

Definition at line 112 of file ui-dispatcher.hpp.

References UiDispatcher::dispatcher_, CallQueue::invoke(), and UiDispatcher::queue_.

+ Here is the call graph for this function:

Member Typedef Documentation

◆ Operation

Definition at line 108 of file ui-dispatcher.hpp.

Member Function Documentation

◆ event()

void event ( Operation &&  op)
inline

move the given operation into our private dispatcher queue and then schedule dequeuing and invocation into the UI event thread.

Parameters
opa completely closed lambda or functor
Warning
closure need to be by value or equivalent, since the operation will be executed in another call stack

Definition at line 139 of file ui-dispatcher.hpp.

References UiDispatcher::dispatcher_, CallQueue::feed(), and UiDispatcher::queue_.

+ Here is the call graph for this function:

Member Data Documentation

◆ queue_

lib::CallQueue queue_
private

Definition at line 105 of file ui-dispatcher.hpp.

Referenced by UiDispatcher::UiDispatcher(), and UiDispatcher::event().

◆ dispatcher_

Glib::Dispatcher dispatcher_
private

Definition at line 106 of file ui-dispatcher.hpp.

Referenced by UiDispatcher::UiDispatcher(), and UiDispatcher::event().

+ Inheritance diagram for UiDispatcher:
+ Collaboration diagram for UiDispatcher:

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