PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Runnable.h 435B

3 yıl önce
1234567891011121314151617181920212223
  1. #ifndef RUNNABLE_H
  2. #define RUNNABLE_H
  3. /*
  4. * File Purpose
  5. * This is an abstract class that is reusable to allow for easy defintion of a runnable function for std::thread
  6. */
  7. class Runnable{
  8. private:
  9. protected:
  10. virtual void runTarget(void *arg) = 0;
  11. public:
  12. virtual ~Runnable(){}
  13. static void runThread(void *arg)
  14. {
  15. Runnable *_runnable = static_cast<Runnable*> (arg);
  16. _runnable->runTarget(arg);
  17. }
  18. };
  19. #endif // RUNNABLE_H