18 template<
typename Archive>
20 assert(Archive::IS_LOADER);
21 ar.serialize(
"time",
time,
25 EmuTime
time = EmuTime::zero();
64 template<
typename Archive>
65 void serialize(Archive& ar,
unsigned version);
67 template<
typename Archive>
69 assert(Archive::IS_LOADER);
70 ar.beginTag(
"Schedulable");
71 std::vector<SyncPointBW> result;
72 ar.serialize(
"syncPoints", result);
73 ar.endTag(
"Schedulable");
76 template<
typename Archive>
77 static void restoreOld(Archive& ar, std::vector<Schedulable*> schedulables) {
78 assert(Archive::IS_LOADER);
79 for (
auto* s : schedulables) {
80 s->removeSyncPoints();
83 unsigned i = old.userData;
84 if (i < schedulables.size()) {
85 schedulables[i]->setSyncPoint(old.time);
Every class that wants to get scheduled at some point must inherit from this class.
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().
static std::vector< SyncPointBW > serializeBW(Archive &ar)
This file implemented 3 utility functions:
REGISTER_BASE_CLASS(Connector, "Connector")
void serialize(Archive &ar, unsigned)