using namespace std;
-int Serializable::maxCount = 0;
-int Serializable::count = 0;
+int Serializable::ckptMaxCount = 0;
+int Serializable::ckptCount = 0;
+int Serializable::ckptPrevCount = -1;
void
Serializable::nameOut(ostream &os)
globals.serialize(outstream);
SimObject::serializeAll(outstream);
- if (maxCount && ++count >= maxCount)
+ assert(Serializable::ckptPrevCount + 1 == Serializable::ckptCount);
+ Serializable::ckptPrevCount++;
+ if (ckptMaxCount && ++ckptCount >= ckptMaxCount)
SimExit(curTick + 1, "Maximum number of checkpoints dropped");
+
}
if (serialize_cycle > 0)
Checkpoint::setup(serialize_cycle, serialize_period);
- Serializable::maxCount = serialize_count;
+ Serializable::ckptMaxCount = serialize_count;
}
void
static Serializable *create(Checkpoint *cp,
const std::string §ion);
- static int count;
- static int maxCount;
+ static int ckptCount;
+ static int ckptMaxCount;
+ static int ckptPrevCount;
static void serializeAll();
static void unserializeGlobals(Checkpoint *cp);
};