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; --- 30 unchanged lines hidden (view full) --- 39#include <string> 40#include <vector> 41 42#include "base/inifile.hh" 43#include "base/misc.hh" 44#include "base/output.hh" 45#include "base/str.hh" 46#include "base/trace.hh" |
47#include "sim/eventq.hh" 48#include "sim/param.hh" 49#include "sim/serialize.hh" 50#include "sim/sim_events.hh" 51#include "sim/sim_exit.hh" 52#include "sim/sim_object.hh" 53 54using namespace std; --- 381 unchanged lines hidden (view full) --- 436Serializable::create(Checkpoint *cp, const std::string §ion) 437{ 438 Serializable *object = SerializableClass::createObject(cp, section); 439 object->unserialize(cp, section); 440 return object; 441} 442 443 |
444Checkpoint::Checkpoint(const std::string &cpt_dir, const std::string &path) 445 : db(new IniFile), basePath(path), cptDir(cpt_dir) |
446{ 447 string filename = cpt_dir + "/" + Checkpoint::baseFilename; 448 if (!db->load(filename)) { 449 fatal("Can't load checkpoint file '%s'\n", filename); 450 } 451} 452 453 --- 9 unchanged lines hidden (view full) --- 463Checkpoint::findObj(const std::string §ion, const std::string &entry, 464 Serializable *&value) 465{ 466 string path; 467 468 if (!db->find(section, entry, path)) 469 return false; 470 |
471 if ((value = objMap[path]) != NULL) 472 return true; 473 474 return false; 475} 476 477 478bool 479Checkpoint::sectionExists(const std::string §ion) 480{ 481 return db->sectionExists(section); 482} |