-/* Contains the statistic implementation details */
-//////////////////////////////////////////////////////////////////////
-//
-// Statistics Framework Base classes
-//
-//////////////////////////////////////////////////////////////////////
-struct StatData
-{
- /** The name of the stat. */
- std::string name;
- /** The description of the stat. */
- std::string desc;
- /** The formatting flags. */
- StatFlags flags;
- /** The display precision. */
- int precision;
- /** A pointer to a prerequisite Stat. */
- const StatData *prereq;
- /**
- * A unique stat ID for each stat in the simulator.
- * Can be used externally for lookups as well as for debugging.
- */
- int id;
-
- StatData();
- virtual ~StatData();
-
- /**
- * Reset the corresponding stat to the default state.
- */
- virtual void reset() = 0;
-
- /**
- * @return true if this stat has a value and satisfies its
- * requirement as a prereq
- */
- virtual bool zero() const = 0;
-
- /**
- * Check that this stat has been set up properly and is ready for
- * use
- * @return true for success
- */
- virtual bool check() const = 0;
- bool baseCheck() const;
-
- /**
- * Visitor entry for outputing statistics data
- */
- virtual void visit(Visit &visitor) = 0;
-
- /**
- * Checks if the first stat's name is alphabetically less than the second.
- * This function breaks names up at periods and considers each subname
- * separately.
- * @param stat1 The first stat.
- * @param stat2 The second stat.
- * @return stat1's name is alphabetically before stat2's
- */
- static bool less(StatData *stat1, StatData *stat2);
-};
-
-class ScalarData : public StatData
-{
- public:
- virtual Counter value() const = 0;
- virtual Result result() const = 0;
- virtual Result total() const = 0;
- virtual void visit(Visit &visitor) { visitor.visit(*this); }
-};
-
-template <class Stat>
-class ScalarStatData : public ScalarData