Changeset 351c519
- Timestamp:
- Feb 28, 2019, 4:23:34 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 79de2210
- Parents:
- ebcc940
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Stats/Counter.h
rebcc940 r351c519 125 125 size_t count = 1; 126 126 }; 127 128 template<typename T> 129 class MaxCounter : public BaseCounter { 130 public: 131 MaxCounter(const char * const name ) : BaseCounter(name), max{} {} 132 MaxCounter(const char * const name, BaseCounter * parent) : BaseCounter(name, parent), max{} {} 133 134 inline void push(T value) { 135 max = std::max(max, value); 136 } 137 138 protected: 139 virtual ~MaxCounter() = default; 140 141 private: 142 virtual void print(std::ostream & os) { 143 os << max; 144 } 145 template<typename F> 146 friend void ForAllCounters(BaseCounter::list_t &, size_t, F ); 147 friend void print(); 148 149 T max; 150 }; 127 151 } 128 152 }
Note: See TracChangeset
for help on using the changeset viewer.