FTXUI  4.1.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
loop.hpp
Go to the documentation of this file.
1#ifndef FTXUI_COMPONENT_LOOP_HPP
2#define FTXUI_COMPONENT_LOOP_HPP
3
4#include <memory> // for shared_ptr
5
6#include "ftxui/component/component_base.hpp" // for ComponentBase
7
8namespace ftxui {
9class ComponentBase;
10
11using Component = std::shared_ptr<ComponentBase>;
12class ScreenInteractive;
13
14class Loop {
15 public:
16 Loop(ScreenInteractive* screen, Component component);
17 ~Loop();
18
19 bool HasQuitted();
20 void RunOnce();
21 void RunOnceBlocking();
22 void Run();
23
24 private:
25 // This class is non copyable.
26 Loop(const ScreenInteractive&) = delete;
27 Loop& operator=(const Loop&) = delete;
28
29 ScreenInteractive* screen_;
30 Component component_;
31};
32
33} // namespace ftxui
34
35#endif // FTXUI_COMPONENT_LOOP_HPP
36
37// Copyright 2022 Arthur Sonzogni. All rights reserved.
38// Use of this source code is governed by the MIT license that can be found in
39// the LICENSE file.
bool HasQuitted()
Definition loop.cpp:19
void Run()
Definition loop.cpp:38
Loop(ScreenInteractive *screen, Component component)
Definition loop.cpp:10
void RunOnce()
Execute the loop. Make the component to process every pending tasks/events. A new frame might be draw...
Definition loop.cpp:26
void RunOnceBlocking()
Wait for at least one event to be handled and execute Loop::RunOnce().
Definition loop.cpp:32
std::shared_ptr< ComponentBase > Component