mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-22 12:48:09 +08:00
Add a Producer/Consumer system.
It allow you to create the two end of a pipe: A producer and consumer. The producer can be moved into another thread. Several producer can be created if necessary. This will ease merging: https://github.com/ArthurSonzogni/FTXUI/pull/11
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "ftxui/component/event.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include <ftxui/component/producer_consumer.hpp>
|
||||
|
||||
namespace ftxui {
|
||||
class Component;
|
||||
@@ -40,13 +41,13 @@ class ScreenInteractive : public Screen {
|
||||
Dimension dimension_ = Dimension::Fixed;
|
||||
ScreenInteractive(int dimx, int dimy, Dimension dimension);
|
||||
|
||||
std::condition_variable events_queue_cv;
|
||||
std::mutex events_queue_mutex;
|
||||
std::queue<Event> events_queue;
|
||||
std::atomic<bool> quit_ = false;
|
||||
Producer<Event> event_producer_;
|
||||
Consumer<Event> event_consumer_;
|
||||
|
||||
std::string set_cursor_position;
|
||||
std::string reset_cursor_position;
|
||||
|
||||
std::atomic<bool>quit_ = false;
|
||||
};
|
||||
|
||||
} // namespace ftxui
|
||||
|
Reference in New Issue
Block a user