1 #ifndef LIBFILEZILLA_EVENT_LOOP_HEADER 2 #define LIBFILEZILLA_EVENT_LOOP_HEADER 33 typedef std::deque<std::pair<event_handler*, event_base*>> Events;
55 void filter_events(std::function<
bool (Events::value_type&)>
const& filter);
66 void FZ_PRIVATE_SYMBOL remove_handler(
event_handler* handler);
68 timer_id FZ_PRIVATE_SYMBOL add_timer(
event_handler* handler,
duration const& interval,
bool one_shot);
69 void FZ_PRIVATE_SYMBOL stop_timer(timer_id
id);
74 bool FZ_PRIVATE_SYMBOL process_event(
scoped_lock & l);
79 virtual void FZ_PRIVATE_SYMBOL entry();
81 struct timer_data final
89 typedef std::vector<timer_data> Timers;
91 Events pending_events_;
104 timer_id next_timer_id_{};
Spawns and represents a new thread of execution.
Definition: thread.hpp:25
Thread synchronization primitives: mutex, scoped_lock and condition.
A simple scoped lock.
Definition: mutex.hpp:61
Simple handler for asynchronous event processing.
Definition: event_handler.hpp:54
Waitable condition variable.
Definition: mutex.hpp:132
Assorted classes dealing with time.
A threaded event loop that supports sending events and timers.
Definition: event_loop.hpp:30
A monotonic clock (aka steady clock) is independent from walltime.
Definition: time.hpp:353
The namespace used by libfilezilla.
Definition: apply.hpp:16
The duration class represents a time interval in milliseconds.
Definition: time.hpp:271
Declares event_base and simple_event<>
Template helper to call a function with its arguments extracted from a tuple.
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:27
Common base class for all events.
Definition: event.hpp:21