summaryrefslogtreecommitdiff
path: root/src/base/statistics.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-04-08 22:22:50 -0700
committerNathan Binkert <nate@binkert.org>2009-04-08 22:22:50 -0700
commitc87c9950dfa094b0c3820f9abca721b0d32d2a09 (patch)
tree790df23111653cae3d714c20fabc4c166ff01727 /src/base/statistics.hh
parent18a30524d6afb397df1af764e8dc80ff4e7cdb98 (diff)
downloadgem5-c87c9950dfa094b0c3820f9abca721b0d32d2a09.tar.xz
stats: disallow duplicate statistic names.
Diffstat (limited to 'src/base/statistics.hh')
-rw-r--r--src/base/statistics.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/base/statistics.hh b/src/base/statistics.hh
index 88704207d..cd5be21ce 100644
--- a/src/base/statistics.hh
+++ b/src/base/statistics.hh
@@ -114,6 +114,9 @@ class Info
Info();
virtual ~Info();
+ /** Set the name of this statistic */
+ void setName(const std::string &name);
+
/**
* Check that this stat has been set up properly and is ready for
* use
@@ -402,10 +405,10 @@ class DataWrap : public InfoAccess
* @return A reference to this stat.
*/
Derived &
- name(const std::string &_name)
+ name(const std::string &name)
{
Info *info = this->info();
- info->name = _name;
+ info->setName(name);
info->flags |= print;
return this->self();
}