diff --git a/src/sim/root.cc b/src/sim/root.cc index d9098a671b..7ca84bf8c5 100644 --- a/src/sim/root.cc +++ b/src/sim/root.cc @@ -49,10 +49,10 @@ #include "sim/root.hh" Root *Root::_root = NULL; -Root::Stats Root::Stats::instance; -Root::Stats &rootStats = Root::Stats::instance; +Root::RootStats Root::RootStats::instance; +Root::RootStats &rootStats = Root::RootStats::instance; -Root::Stats::Stats() +Root::RootStats::RootStats() : Stats::Group(nullptr), simSeconds(this, "sim_seconds", "Number of seconds simulated"), simTicks(this, "sim_ticks", "Number of ticks simulated"), @@ -92,7 +92,7 @@ Root::Stats::Stats() } void -Root::Stats::resetStats() +Root::RootStats::resetStats() { statTime.setTimer(); startTick = curTick(); @@ -180,7 +180,7 @@ Root::Root(const RootParams &p) // stat formulas. The most convenient way to implement that is by // having a single global stat group for global stats. Merge that // group into the root object here. - mergeStatGroup(&Root::Stats::instance); + mergeStatGroup(&Root::RootStats::instance); } void diff --git a/src/sim/root.hh b/src/sim/root.hh index fa152ff2df..817e2f334d 100644 --- a/src/sim/root.hh +++ b/src/sim/root.hh @@ -90,26 +90,26 @@ class Root : public SimObject } public: // Global statistics - struct Stats : public ::Stats::Group + struct RootStats : public Stats::Group { void resetStats() override; - ::Stats::Formula simSeconds; - ::Stats::Value simTicks; - ::Stats::Value finalTick; - ::Stats::Value simFreq; - ::Stats::Value hostSeconds; + Stats::Formula simSeconds; + Stats::Value simTicks; + Stats::Value finalTick; + Stats::Value simFreq; + Stats::Value hostSeconds; - ::Stats::Formula hostTickRate; - ::Stats::Value hostMemory; + Stats::Formula hostTickRate; + Stats::Value hostMemory; - static Stats instance; + static RootStats instance; private: - Stats(); + RootStats(); - Stats(const Stats &) = delete; - Stats &operator=(const Stats &) = delete; + RootStats(const RootStats &) = delete; + RootStats &operator=(const RootStats &) = delete; Time statTime; Tick startTick; @@ -151,6 +151,6 @@ class Root : public SimObject * Global simulator statistics that are not associated with a * specific SimObject. */ -extern Root::Stats &rootStats; +extern Root::RootStats &rootStats; #endif // __SIM_ROOT_HH__