summaryrefslogtreecommitdiff
path: root/src/util/statistics_registry.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-09-28 17:29:01 +0000
committerMorgan Deters <mdeters@gmail.com>2012-09-28 17:29:01 +0000
commit65f720aac2d497c6e829d9c76638073a10060e7d (patch)
tree357035797e31f96a37dce30cb97ddb0aaf8f3bb7 /src/util/statistics_registry.cpp
parentc0c351a89871e0a6881668fa1a8d87349ab8af8e (diff)
Public interface review items:
* Internal uses of CheckArgument changed to AssertArgument/AlwaysAssertArgument() * Make util/Assert.h cvc4_private instead of public, so AssertionException and friends are now internal-only * CheckArgument() throws non-AssertionException * things outside the core library (parsers, driver) use regular C-style assert, or a public exception type. * auto-generated documentation for Smt options and internal options Also, a small fix to SMT-LIBv1 QF_ABV and QF_AUFBV definitions, which were nonstandard.
Diffstat (limited to 'src/util/statistics_registry.cpp')
-rw-r--r--src/util/statistics_registry.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/util/statistics_registry.cpp b/src/util/statistics_registry.cpp
index f2a698a48..48e1355ec 100644
--- a/src/util/statistics_registry.cpp
+++ b/src/util/statistics_registry.cpp
@@ -50,36 +50,38 @@ StatisticsRegistry* StatisticsRegistry::current() {
return stats::getStatisticsRegistry(smt::currentSmtEngine());
}
-void StatisticsRegistry::registerStat(Stat* s) throw(AssertionException) {
+void StatisticsRegistry::registerStat(Stat* s) throw(CVC4::IllegalArgumentException) {
#ifdef CVC4_STATISTICS_ON
StatSet& stats = current()->d_stats;
- AlwaysAssert(stats.find(s) == stats.end(),
- "Statistic `%s' was already registered with this registry.", s->getName().c_str());
+ CheckArgument(stats.find(s) == stats.end(), s,
+ "Statistic `%s' was already registered with this registry.",
+ s->getName().c_str());
stats.insert(s);
#endif /* CVC4_STATISTICS_ON */
}/* StatisticsRegistry::registerStat() */
-void StatisticsRegistry::unregisterStat(Stat* s) throw(AssertionException) {
+void StatisticsRegistry::unregisterStat(Stat* s) throw(CVC4::IllegalArgumentException) {
#ifdef CVC4_STATISTICS_ON
StatSet& stats = current()->d_stats;
- AlwaysAssert(stats.find(s) != stats.end(),
- "Statistic `%s' was not registered with this registry.", s->getName().c_str());
+ CheckArgument(stats.find(s) != stats.end(), s,
+ "Statistic `%s' was not registered with this registry.",
+ s->getName().c_str());
stats.erase(s);
#endif /* CVC4_STATISTICS_ON */
}/* StatisticsRegistry::unregisterStat() */
#endif /* ! __BUILDING_STATISTICS_FOR_EXPORT */
-void StatisticsRegistry::registerStat_(Stat* s) throw(AssertionException) {
+void StatisticsRegistry::registerStat_(Stat* s) throw(CVC4::IllegalArgumentException) {
#ifdef CVC4_STATISTICS_ON
- AlwaysAssert(d_stats.find(s) == d_stats.end());
+ CheckArgument(d_stats.find(s) == d_stats.end(), s);
d_stats.insert(s);
#endif /* CVC4_STATISTICS_ON */
}/* StatisticsRegistry::registerStat_() */
-void StatisticsRegistry::unregisterStat_(Stat* s) throw(AssertionException) {
+void StatisticsRegistry::unregisterStat_(Stat* s) throw(CVC4::IllegalArgumentException) {
#ifdef CVC4_STATISTICS_ON
- AlwaysAssert(d_stats.find(s) != d_stats.end());
+ CheckArgument(d_stats.find(s) != d_stats.end(), s);
d_stats.erase(s);
#endif /* CVC4_STATISTICS_ON */
}/* StatisticsRegistry::unregisterStat_() */
@@ -98,7 +100,7 @@ void StatisticsRegistry::flushInformation(std::ostream &out) const {
void TimerStat::start() {
if(__CVC4_USE_STATISTICS) {
- AlwaysAssert(!d_running);
+ CheckArgument(!d_running, *this, "timer already running");
clock_gettime(CLOCK_MONOTONIC, &d_start);
d_running = true;
}
@@ -106,7 +108,7 @@ void TimerStat::start() {
void TimerStat::stop() {
if(__CVC4_USE_STATISTICS) {
- AlwaysAssert(d_running);
+ CheckArgument(d_running, *this, "timer not running");
::timespec end;
clock_gettime(CLOCK_MONOTONIC, &end);
d_data += end - d_start;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback