| 1 |
#ifndef RTSCHEDULABLE_HH |
| 2 |
#define RTSCHEDULABLE_HH |
| 3 |
|
| 4 |
#include <cstdint> |
| 5 |
|
| 6 |
namespace openmsx { |
| 7 |
|
| 8 |
class RTScheduler; |
| 9 |
|
| 10 |
class RTSchedulable |
| 11 |
{ |
| 12 |
public: |
| 13 |
RTSchedulable(const RTSchedulable&) = delete; |
| 14 |
RTSchedulable(RTSchedulable&&) = delete; |
| 15 |
RTSchedulable& operator=(const RTSchedulable&) = delete; |
| 16 |
RTSchedulable& operator=(RTSchedulable&&) = delete; |
| 17 |
|
| 18 |
virtual void executeRT() = 0; |
| 19 |
|
| 20 |
void scheduleRT(uint64_t delta); |
| 21 |
bool cancelRT(); |
| 22 |
[[nodiscard]] bool isPendingRT() const; |
| 23 |
|
| 24 |
protected: |
| 25 |
explicit RTSchedulable(RTScheduler& scheduler); |
| 26 |
~RTSchedulable(); |
| 27 |
|
| 28 |
private: |
| 29 |
RTScheduler& scheduler; |
| 30 |
}; |
| 31 |
|
| 32 |
} |
| 33 |
|
| 34 |
#endif |