serialize.cc (7576:4154f3e1edae) serialize.cc (7823:dac01f14f20f)
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;

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

395{
396 return "Globals";
397}
398
399void
400Globals::serialize(ostream &os)
401{
402 nameOut(os);
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;

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

395{
396 return "Globals";
397}
398
399void
400Globals::serialize(ostream &os)
401{
402 nameOut(os);
403 SERIALIZE_SCALAR(curTick);
403 SERIALIZE_SCALAR(curTick());
404
405 nameOut(os, "MainEventQueue");
406 mainEventQueue.serialize(os);
407}
408
409void
410Globals::unserialize(Checkpoint *cp)
411{
412 const string &section = name();
404
405 nameOut(os, "MainEventQueue");
406 mainEventQueue.serialize(os);
407}
408
409void
410Globals::unserialize(Checkpoint *cp)
411{
412 const string &section = name();
413 UNSERIALIZE_SCALAR(curTick);
413 Tick tick;
414 paramIn(cp, section, "curTick", tick);
415 curTick(tick);
414
415 mainEventQueue.unserialize(cp, "MainEventQueue");
416}
417
418Serializable::Serializable()
419{
420}
421

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

528
529const char *Checkpoint::baseFilename = "m5.cpt";
530
531string Checkpoint::currentDirectory;
532
533string
534Checkpoint::setDir(const string &name)
535{
416
417 mainEventQueue.unserialize(cp, "MainEventQueue");
418}
419
420Serializable::Serializable()
421{
422}
423

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

530
531const char *Checkpoint::baseFilename = "m5.cpt";
532
533string Checkpoint::currentDirectory;
534
535string
536Checkpoint::setDir(const string &name)
537{
536 // use csprintf to insert curTick into directory name if it
538 // use csprintf to insert curTick() into directory name if it
537 // appears to have a format placeholder in it.
538 currentDirectory = (name.find("%") != string::npos) ?
539 // appears to have a format placeholder in it.
540 currentDirectory = (name.find("%") != string::npos) ?
539 csprintf(name, curTick) : name;
541 csprintf(name, curTick()) : name;
540 if (currentDirectory[currentDirectory.size() - 1] != '/')
541 currentDirectory += "/";
542 return currentDirectory;
543}
544
545string
546Checkpoint::dir()
547{

--- 40 unchanged lines hidden ---
542 if (currentDirectory[currentDirectory.size() - 1] != '/')
543 currentDirectory += "/";
544 return currentDirectory;
545}
546
547string
548Checkpoint::dir()
549{

--- 40 unchanged lines hidden ---