FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
loop.cpp
Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
2// このソースコードの使用は、LICENSE ファイルにあるMITライセンスに従います。
4
5#include <utility> // for move
6
7#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
8
9namespace ftxui {
10
11/// @brief LoopはComponentとScreenInteractiveのラッパーです。
12/// これはターミナルでコンポーネントを実行するために使用されます。
13/// @see Component, ScreenInteractive.
14/// @see ScreenInteractive::Loop().
15/// @see ScreenInteractive::ExitLoop().
16/// @param[in] screen 使用するスクリーン。
17/// @param[in] component 実行するコンポーネント。
18// NOLINTNEXTLINE
20 : screen_(screen), component_(std::move(component)) {
21 screen_->PreMain();
22}
23
25 screen_->PostMain();
26}
27
28/// @brief ループが終了したかどうか。
30 return screen_->HasQuitted();
31}
32
33/// @brief ループを実行します。`component`に保留中のすべてのタスク/イベントを処理させます。
34/// 前のフレームが無効になった場合、新しいフレームが描画される可能性があります。
35/// ループが完了するまでtrueを返します。
37 screen_->RunOnce(component_);
38}
39
40/// @brief 少なくとも1つのイベントが処理されるのを待ち、`Loop::RunOnce()`を実行します。
42 screen_->RunOnceBlocking(component_);
43}
44
45/// ループが終了するまで、現在のスレッドをブロックしてループを実行します。
46void Loop::Run() {
47 while (!HasQuitted()) {
49 }
50}
51
52} // namespace ftxui
bool HasQuitted()
ループが終了したかどうか。
Definition loop.cpp:29
void Run()
ループが終了するまで、現在のスレッドをブロックしてループを実行します。
Definition loop.cpp:46
Loop(ScreenInteractive *screen, Component component)
LoopはComponentとScreenInteractiveのラッパーです。 これはターミナルでコンポーネントを実行するために使用されます。
Definition loop.cpp:19
void RunOnce()
ループを実行します。componentに保留中のすべてのタスク/イベントを処理させます。 前のフレームが無効になった場合、新しいフレームが描画される可能性があります。 ループが完了するまでtrueを返し...
Definition loop.cpp:36
void RunOnceBlocking()
少なくとも1つのイベントが処理されるのを待ち、Loop::RunOnce()を実行します。
Definition loop.cpp:41
ScreenInteractive はイベントを処理し、メインループを実行し、コンポーネントを管理できる Screen です。
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
std::shared_ptr< ComponentBase > Component