TAMSVIZ
Visualization and annotation tool for ROS
renderthread.h
1 // TAMSVIZ
2 // (c) 2020 Philipp Ruppel
3 
4 #pragma once
5 
6 #include <condition_variable>
7 #include <memory>
8 #include <mutex>
9 #include <thread>
10 
11 class RenderThread {
12  bool _redraw_flag = false;
13  bool _stop_flag = false;
14  bool _running = false;
15  std::mutex _mutex;
16  std::condition_variable _condition;
17  std::thread _thread;
18 
19 private:
20  void run();
21 
22 public:
23  RenderThread();
24  ~RenderThread();
25  void stop();
26  static RenderThread *instance();
27  void invalidate();
28 };