/*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2002-2004 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
class Globals : public Serializable
{
public:
- string name() const;
- void serialize(ostream& os);
+ const string name() const;
+ void serialize(ostream &os);
void unserialize(Checkpoint *cp);
};
/// The one and only instance of the Globals class.
Globals globals;
-string
+const string
Globals::name() const
{
return "Globals";
}
void
-Globals::serialize(ostream& os)
+Globals::serialize(ostream &os)
{
nameOut(os);
SERIALIZE_SCALAR(curTick);
if (serialize_dir.isValid()) {
checkpointDirBase = serialize_dir;
} else {
- if (outputDirectory.empty())
- checkpointDirBase = "m5.%012d";
- else
- checkpointDirBase = outputDirectory + "cpt.%012d";
+ checkpointDirBase = outputDirectory + "cpt.%012d";
}
// guarantee that directory ends with a '/'
Checkpoint::Checkpoint(const std::string &cpt_dir, const std::string &path,
const ConfigNode *_configNode)
- : db(new IniFile), basePath(path), configNode(_configNode)
+ : db(new IniFile), basePath(path), configNode(_configNode), cptDir(cpt_dir)
{
string filename = cpt_dir + "/" + Checkpoint::baseFilename;
if (!db->load(filename)) {