diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/stats.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/stats.h b/src/util/stats.h index 43f84fee6..8d3d4cfda 100644 --- a/src/util/stats.h +++ b/src/util/stats.h @@ -49,6 +49,7 @@ public: static void flushStatistics(std::ostream& out); static inline void registerStat(Stat* s) throw (AssertionException); + static inline void unregisterStat(Stat* s) throw (AssertionException); }; /* class StatisticsRegistry */ @@ -95,6 +96,12 @@ inline void StatisticsRegistry::registerStat(Stat* s) throw (AssertionException) d_registeredStats.insert(s); } } +inline void StatisticsRegistry::unregisterStat(Stat* s) throw (AssertionException){ + if(USE_STATISTICS){ + AlwaysAssert(d_registeredStats.find(s) != d_registeredStats.end()); + d_registeredStats.erase(s); + } +} |