TermOx
user_input_event_loop.hpp
1 #ifndef TERMOX_SYSTEM_DETAIL_USER_INPUT_EVENT_LOOP_HPP
2 #define TERMOX_SYSTEM_DETAIL_USER_INPUT_EVENT_LOOP_HPP
3 #include <termox/system/event_loop.hpp>
4 #include <termox/system/event_queue.hpp>
5 
6 namespace ox::detail {
7 
10  public:
12  auto run() -> int;
13 
15  void exit(int exit_code);
16 
18 
19  auto event_queue() -> Event_queue&;
20 
21  private:
22  Event_loop loop_;
23 };
24 
25 } // namespace ox::detail
26 #endif // TERMOX_SYSTEM_DETAIL_USER_INPUT_EVENT_LOOP_HPP
Calls on loop_function(), and then processes the Event_queue.
Definition: event_loop.hpp:17
Definition: event_queue.hpp:63
Event loop that blocks for user input on each iteration.
Definition: user_input_event_loop.hpp:9
auto event_queue() -> Event_queue &
Return reference to the internal Event_queue.
Definition: user_input_event_loop.cpp:18
auto run() -> int
Starts listening for user input events in the thread called from.
Definition: user_input_event_loop.cpp:10
void exit(int exit_code)
Sets exit flag.
Definition: user_input_event_loop.cpp:16