mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-27 21:58:29 +08:00
8a2a9b0799
Fix all the diagnostics reported. Bug: https://github.com/ArthurSonzogni/FTXUI/issues/828
42 lines
961 B
C++
42 lines
961 B
C++
// Copyright 2022 Arthur Sonzogni. All rights reserved.
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
// the LICENSE file.
|
|
#ifndef FTXUI_COMPONENT_LOOP_HPP
|
|
#define FTXUI_COMPONENT_LOOP_HPP
|
|
|
|
#include <memory> // for shared_ptr
|
|
|
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
|
|
|
namespace ftxui {
|
|
class ComponentBase;
|
|
|
|
using Component = std::shared_ptr<ComponentBase>;
|
|
class ScreenInteractive;
|
|
|
|
class Loop {
|
|
public:
|
|
Loop(ScreenInteractive* screen, Component component);
|
|
~Loop();
|
|
|
|
bool HasQuitted();
|
|
void RunOnce();
|
|
void RunOnceBlocking();
|
|
void Run();
|
|
|
|
// This class is non copyable/movable.
|
|
Loop(const Loop&) = default;
|
|
Loop(Loop&&) = delete;
|
|
Loop& operator=(Loop&&) = delete;
|
|
Loop(const ScreenInteractive&) = delete;
|
|
Loop& operator=(const Loop&) = delete;
|
|
|
|
private:
|
|
ScreenInteractive* screen_;
|
|
Component component_;
|
|
};
|
|
|
|
} // namespace ftxui
|
|
|
|
#endif // FTXUI_COMPONENT_LOOP_HPP
|