18 template<
typename Archive>
20 assert(Archive::IS_LOADER);
21 ar.serialize(
"time",
time,
25 EmuTime
time = EmuTime::zero();
66 template<
typename Archive>
67 void serialize(Archive& ar,
unsigned version);
69 template<
typename Archive>
71 assert(Archive::IS_LOADER);
72 ar.beginTag(
"Schedulable");
73 std::vector<SyncPointBW> result;
74 ar.serialize(
"syncPoints", result);
75 ar.endTag(
"Schedulable");
78 template<
typename Archive>
79 static void restoreOld(Archive& ar, std::vector<Schedulable*> schedulables) {
80 assert(Archive::IS_LOADER);
81 for (
auto* s : schedulables) {
82 s->removeSyncPoints();
85 unsigned i = old.userData;
86 if (i < schedulables.size()) {
87 schedulables[i]->setSyncPoint(old.time);
Every class that wants to get scheduled at some point must inherit from this class.
Schedulable & operator=(Schedulable &&)=delete
virtual void executeUntil(EmuTime::param time)=0
When the previously registered syncPoint is reached, this method gets called.
void setSyncPoint(EmuTime::param timestamp)
void serialize(Archive &ar, unsigned version)
Schedulable(const Schedulable &)=delete
Schedulable & operator=(const Schedulable &)=delete
virtual void schedulerDeleted()
Just before the the Scheduler is deleted, it calls this method of all the Schedulables that are still...
bool pendingSyncPoint() const
Scheduler & getScheduler() const
static void restoreOld(Archive &ar, std::vector< Schedulable * > schedulables)
EmuTime::param getCurrentTime() const
Convenience method: This is the same as getScheduler().getCurrentTime().
Schedulable(Schedulable &&)=delete
static std::vector< SyncPointBW > serializeBW(Archive &ar)
This file implemented 3 utility functions:
void serialize(Archive &ar, unsigned)