* Nathan Binkert
*/
-#include <cassert>
+#include "sim/sim_object.hh"
-#include "base/callback.hh"
-#include "base/inifile.hh"
#include "base/match.hh"
#include "base/misc.hh"
#include "base/trace.hh"
-#include "base/types.hh"
#include "debug/Checkpoint.hh"
#include "sim/probe/probe.hh"
-#include "sim/sim_object.hh"
-#include "sim/stats.hh"
using namespace std;
}
void
-SimObject::loadState(Checkpoint *cp)
+SimObject::loadState(CheckpointIn &cp)
{
- if (cp->sectionExists(name())) {
+ if (cp.sectionExists(name())) {
DPRINTF(Checkpoint, "unserializing\n");
- unserialize(cp, name());
+ // This works despite name() returning a fully qualified name
+ // since we are at the top level.
+ unserializeSection(cp, name());
} else {
DPRINTF(Checkpoint, "no checkpoint section found\n");
}
// static function: serialize all SimObjects.
//
void
-SimObject::serializeAll(std::ostream &os)
+SimObject::serializeAll(CheckpointOut &cp)
{
SimObjectList::reverse_iterator ri = simObjectList.rbegin();
SimObjectList::reverse_iterator rend = simObjectList.rend();
for (; ri != rend; ++ri) {
SimObject *obj = *ri;
- obj->nameOut(os);
- obj->serialize(os);
+ // This works despite name() returning a fully qualified name
+ // since we are at the top level.
+ obj->serializeSection(cp, obj->name());
}
}
}
#endif
-unsigned int
-SimObject::drain(DrainManager *drain_manager)
-{
- setDrainState(Drained);
- return 0;
-}
-
-
SimObject *
SimObject::find(const char *name)
{