Deleted Added
sdiff udiff text old ( 2797:b5f26b4eacef ) new ( 2868:6a7e69fa92d3 )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 217 unchanged lines hidden (view full) ---

226{
227 const string &section = name();
228 UNSERIALIZE_SCALAR(curTick);
229
230 mainEventQueue.unserialize(cp, "MainEventQueue");
231}
232
233void
234Serializable::serializeAll()
235{
236 string dir = Checkpoint::dir();
237 if (mkdir(dir.c_str(), 0775) == -1 && errno != EEXIST)
238 fatal("couldn't mkdir %s\n", dir);
239
240 string cpt_file = dir + Checkpoint::baseFilename;
241 ofstream outstream(cpt_file.c_str());
242 time_t t = time(NULL);
243 outstream << "// checkpoint generated: " << ctime(&t);
244
245 globals.serialize(outstream);
246 SimObject::serializeAll(outstream);
247}
248
249void
250Serializable::unserializeAll()
251{
252 string dir = Checkpoint::dir();
253 string cpt_file = dir + Checkpoint::baseFilename;
254 string section = "";
255
256 DPRINTFR(Config, "Loading checkpoint dir '%s'\n",
257 dir);
258 Checkpoint *cp = new Checkpoint(dir, section);
259 unserializeGlobals(cp);

--- 24 unchanged lines hidden (view full) ---

284{
285 // use csprintf to insert curTick into directory name if it
286 // appears to have a format placeholder in it.
287 return (checkpointDirBase.find("%") != string::npos) ?
288 csprintf(checkpointDirBase, curTick) : checkpointDirBase;
289}
290
291void
292debug_serialize()
293{
294 Serializable::serializeAll();
295}
296
297
298////////////////////////////////////////////////////////////////////////
299//
300// SerializableClass member definitions
301//
302////////////////////////////////////////////////////////////////////////

--- 102 unchanged lines hidden ---