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