loop.cpp
ftxui/component/loop.hpp
utility
ftxui/component/screen_interactive.hpp
ftxui/component/animation.hpp
ftxui/component/captured_mouse.hpp
ftxui/component/component_base.hpp
ftxui/component/event.hpp
ftxui/component/loop.hpp
ftxui/component/mouse.hpp
ftxui/component/receiver.hpp
ftxui/component/screen_interactive.hpp
ftxui/component/task.hpp
ftxui/dom/canvas.hpp
ftxui/dom/deprecated.hpp
ftxui/dom/direction.hpp
ftxui/dom/elements.hpp
ftxui/dom/flexbox_config.hpp
ftxui/dom/linear_gradient.hpp
ftxui/dom/node.hpp
ftxui/dom/requirement.hpp
ftxui/dom/selection.hpp
ftxui/screen/box.hpp
ftxui/screen/color.hpp
ftxui/screen/image.hpp
ftxui/screen/pixel.hpp
ftxui/screen/screen.hpp
ftxui/screen/string.hpp
ftxui/screen/terminal.hpp
ftxui/util/autoreset.hpp
ftxui/util/ref.hpp
src/ftxui/component/loop.cpp
algorithm
atomic
chrono
condition_variable
cstddef
cstdint
ftxui/dom/take_any_args.hpp
functional
memory
mutex
optional
queue
sstream
string
thread
unordered_map
utility
variant
vector
ftxui

    //Copyright2022ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include"ftxui/component/loop.hpp"

    #include<utility>//formove

    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive,Component

    namespaceftxui{

    ///@briefALoopisawrapperaroundaComponentandaScreenInteractive.
    ///ItisusedtorunaComponentinaterminal.
    ///@ingroupcomponent
    ///@seeComponent,ScreenInteractive.
    ///@seeScreenInteractive::Loop().
    ///@seeScreenInteractive::ExitLoop().
    ///@param[in]screenThescreentouse.
    ///@param[in]componentThecomponenttorun.
    //NOLINTNEXTLINE
    Loop::Loop(ScreenInteractive*screen,Componentcomponent)
    :screen_(screen),component_(std::move(component)){
    screen_->PreMain();
    }

    Loop::~Loop(){
    screen_->PostMain();
    }

    ///@briefWhethertheloophasquitted.
    ///@ingroupcomponent
    boolLoop::HasQuitted(){
    returnscreen_->HasQuitted();
    }

    ///@briefExecutetheloop.Makethe`component`toprocesseverypending
    ///tasks/events.Anewframemightbedrawnifthepreviouswasinvalidated.
    ///Returntrueuntiltheloophasn'tcompleted.
    voidLoop::RunOnce(){
    screen_->RunOnce(component_);
    }

    ///@briefWaitforatleastoneeventtobehandledandexecute
    ///`Loop::RunOnce()`.
    voidLoop::RunOnceBlocking(){
    screen_->RunOnceBlocking(component_);
    }

    ///Executetheloop,blockingthecurrentthread,upuntiltheloophas
    ///quitted.
    voidLoop::Run(){
    while(!HasQuitted()){
    RunOnceBlocking();
    }
    }

    }//namespaceftxui