Deleted Added
sdiff udiff text old ( 2667:fe64b8353b1c ) new ( 2738:5d7a31c7fa29 )
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;

--- 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/config_node.hh"
48#include "sim/eventq.hh"
49#include "sim/param.hh"
50#include "sim/serialize.hh"
51#include "sim/sim_events.hh"
52#include "sim/sim_exit.hh"
53#include "sim/sim_object.hh"
54
55using namespace std;

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

437Serializable::create(Checkpoint *cp, const std::string &section)
438{
439 Serializable *object = SerializableClass::createObject(cp, section);
440 object->unserialize(cp, section);
441 return object;
442}
443
444
445Checkpoint::Checkpoint(const std::string &cpt_dir, const std::string &path,
446 const ConfigNode *_configNode)
447 : db(new IniFile), basePath(path), configNode(_configNode), cptDir(cpt_dir)
448{
449 string filename = cpt_dir + "/" + Checkpoint::baseFilename;
450 if (!db->load(filename)) {
451 fatal("Can't load checkpoint file '%s'\n", filename);
452 }
453}
454
455

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

465Checkpoint::findObj(const std::string &section, const std::string &entry,
466 Serializable *&value)
467{
468 string path;
469
470 if (!db->find(section, entry, path))
471 return false;
472
473 if ((value = configNode->resolveSimObject(path)) != NULL)
474 return true;
475
476 if ((value = objMap[path]) != NULL)
477 return true;
478
479 return false;
480}
481
482
483bool
484Checkpoint::sectionExists(const std::string &section)
485{
486 return db->sectionExists(section);
487}