ActionThread.cpp 333 B

123456789101112131415161718192021
  1. #include "ActionThread.h"
  2. // Inhalt der ActionThread Klasse
  3. // Konstruktor
  4. ActionThread::ActionThread( std::function<void()> ak )
  5. {
  6. action = ak;
  7. start();
  8. }
  9. // Führt die Threadaktion aus
  10. void ActionThread::thread()
  11. {
  12. action();
  13. }
  14. // Wird am ende des Threads ausgeführt
  15. void ActionThread::threadEnd()
  16. {
  17. delete this;
  18. }