RADLib
RADical C++ application framework
RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args > Class Template Reference

Bridge object that forwards RADCore events to a Slint component callback. More...

#include <RADSlintBackend.h>

+ Inheritance diagram for RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args >:
+ Collaboration diagram for RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args >:

Public Member Functions

 EventComponentBridge (RADCore::Event< void(Args...)> &event, const slint::ComponentHandle< Component > &component, Callback callback)
 Connects event and stores a weak component reference. More...
 
void handle (Args... args)
 Handles the RAD event and posts callback invocation to the UI thread. More...
 
- Public Member Functions inherited from RADCore::RADObject
 RADObject ()
 Creates a RADObject bound to the current thread. More...
 
virtual ~RADObject ()
 Disconnects tracked event links and releases lifetime token. More...
 
void registerLink (const ConnectionRecord &record)
 Registers a connection for cleanup when this object is destroyed. More...
 
std::thread::id threadId () const
 Returns the thread id this object is currently associated with. More...
 
EventLoopassociatedEventLoop () const
 Returns the associated event loop, if any. More...
 
ThreadAffinity threadAffinity () const
 Returns both thread id and associated loop atomically. More...
 
std::weak_ptr< void > lifetimeToken () const
 Returns a weak token used to drop queued callbacks after destruction. More...
 
void moveToThread (std::thread::id tId, EventLoop *loop=nullptr)
 Moves the object's affinity to tId and optional loop. More...
 

Detailed Description

template<typename Component, typename Callback, typename... Args>
class RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args >

Bridge object that forwards RADCore events to a Slint component callback.

Constructor & Destructor Documentation

◆ EventComponentBridge()

template<typename Component , typename Callback , typename... Args>
RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args >::EventComponentBridge ( RADCore::Event< void(Args...)> &  event,
const slint::ComponentHandle< Component > &  component,
Callback  callback 
)
inline

Connects event and stores a weak component reference.

Member Function Documentation

◆ handle()

template<typename Component , typename Callback , typename... Args>
void RADUi::Slint::Detail::EventComponentBridge< Component, Callback, Args >::handle ( Args...  args)
inline

Handles the RAD event and posts callback invocation to the UI thread.


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