MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Vruta::EventSource Class Reference

Awaitable event stream for window events. More...

#include <EventSource.hpp>

+ Collaboration diagram for MayaFlux::Vruta::EventSource:

Public Member Functions

 EventSource ()=default
 
 ~EventSource ()=default
 
 EventSource (const EventSource &)=delete
 
EventSourceoperator= (const EventSource &)=delete
 
 EventSource (EventSource &&) noexcept=default
 
EventSourceoperator= (EventSource &&) noexcept=default
 
void signal (Core::WindowEvent event)
 Signals that an event occurred.
 
Kriya::EventAwaiter next_event ()
 Creates awaiter for next event (any type)
 
Kriya::EventAwaiter await_event (Core::WindowEventType type)
 Creates awaiter for specific event type.
 
bool has_pending () const
 Checks if events are pending.
 
size_t pending_count () const
 Gets number of pending events.
 
void clear ()
 Clears all pending events.
 

Private Member Functions

std::optional< Core::WindowEventpop_event (std::optional< Core::WindowEventType > filter)
 
void register_waiter (Kriya::EventAwaiter *awaiter)
 
void unregister_waiter (Kriya::EventAwaiter *awaiter)
 

Private Attributes

std::queue< Core::WindowEventm_pending_events
 
std::vector< Kriya::EventAwaiter * > m_waiters
 

Friends

class Kriya::EventAwaiter
 

Detailed Description

Awaitable event stream for window events.

Unlike clocks (SampleClock, FrameClock) which tick periodically, EventSource is signaled when discrete window events occur. Coroutines can suspend until events arrive.

Definition at line 20 of file EventSource.hpp.


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