#pragma once #include #include #include #include "PlotWindow.hpp" typedef std::vector WList; class PlotManager { public: inline static const char* const QUIT_COMMANDS[2] = { "q", "quit" }; public: static void NewPlot(std::string title); static WList::iterator Remove(WList::iterator it); static void Loop(); static void Close(); public: inline static bool isOpen = true; private: inline static WList OpenWindows; inline static int currentID = 0; inline static std::promise inputPromise; inline static std::future inputFuture = inputPromise.get_future(); inline static std::mutex PlotMgrMutex; private: static void InputThreadFunction(); private: inline static std::thread inputThread = std::thread(&PlotManager::InputThreadFunction); };