1 #ifndef LIBFILEZILLA_EVENT_LOOP_HEADER
2 #define LIBFILEZILLA_EVENT_LOOP_HEADER
36 typedef std::deque<std::pair<event_handler*, event_base*>> Events;
67 void filter_events(std::function<
bool (Events::value_type&)>
const& filter);
75 void stop(
bool join =
false);
84 void FZ_PRIVATE_SYMBOL remove_handler(
event_handler* handler);
87 void FZ_PRIVATE_SYMBOL stop_timer(timer_id
id);
98 void FZ_PRIVATE_SYMBOL entry();
100 struct FZ_PRIVATE_SYMBOL timer_data final
110 typedef std::vector<timer_data> Timers;
112 Events pending_events_;
122 timer_id next_timer_id_{};
124 thread::id thread_id_{};
126 std::unique_ptr<thread> thread_;
127 std::unique_ptr<async_task> task_;
Thread synchronization primitives: mutex, scoped_lock and condition.
A simple scoped lock.
Definition: mutex.hpp:92
simple_event< process_event_type, process *, process_event_flag > process_event
Definition: process.hpp:37
Simple handler for asynchronous event processing.
Definition: event_handler.hpp:54
Waitable condition variable.
Definition: mutex.hpp:195
Assorted classes dealing with time.
A threaded event loop that supports sending events and timers.
Definition: event_loop.hpp:33
A monotonic clock (aka steady clock) is independent from walltime.
Definition: time.hpp:402
The namespace used by libfilezilla.
Definition: apply.hpp:17
The duration class represents a time interval in milliseconds.
Definition: time.hpp:290
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:51
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:63
Common base class for all events.
Definition: event.hpp:22