4#ifndef FTXUI_COMPONENT_LOOP_HPP
5#define FTXUI_COMPONENT_LOOP_HPP
14using Component = std::shared_ptr<ComponentBase>;
15class ScreenInteractive;
bool HasQuitted()
迴圈是否已退出。
Loop(const ScreenInteractive &)=delete
void Run()
執行迴圈,阻塞當前執行緒,直到迴圈退出。
Loop(ScreenInteractive *screen, Component component)
迴圈是 Component 和 ScreenInteractive 的包裝器。 它用於在終端機中執行元件。
Loop & operator=(const Loop &)=delete
void RunOnce()
執行迴圈。讓 component 處理所有待處理的任務/事件。 如果前一個影格失效,可能會繪製一個新影格。 在迴圈完成之前返回 true。
Loop(const Loop &)=default
Loop & operator=(Loop &&)=delete
void RunOnceBlocking()
等待至少一個事件被處理並執行 Loop::RunOnce()。
ScreenInteractive 是一個可以處理事件、執行主迴圈並管理組件的 Screen。
std::shared_ptr< ComponentBase > Component