- virtual void printValue(std::ostream &o) const { o << Value; }
- virtual bool hasSomeData() const { return Value != 0; }
-public:
- // Normal constructor, default initialize data item...
- Statistic(const char *name, const char *desc)
- : StatisticBase(name, desc), Value(0) {}
-
- // Constructor to provide an initial value...
- Statistic(const unsigned &Val, const char *name, const char *desc)
- : StatisticBase(name, desc), Value(Val) {}
-
- // Print information when destroyed, iff command line option is specified
- ~Statistic() { destroy(); }
+ /// construct - This should only be called for non-global statistics.
+ void construct(const char *name, const char *desc) {
+ Name = name; Desc = desc;
+ Value = 0; Initialized = 0;
+ }