diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-09-22 21:10:51 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-09-22 21:10:51 +0000 |
commit | e2611a54c5479086df0c4a80f56597aae80b5c4e (patch) | |
tree | b0d98600bd70147f28197883d3481614b87d76f6 /src/expr | |
parent | 8b106b77c11d12d16abac845ed704845ef888bd2 (diff) |
Separate public-facing and internal-facing interfaces to Statistics.
The external interface (e.g., what's answered by ExprManager::getStatistics() and SmtEngine::getStatistics()) is a snapshot of the current statistics (rather than a reference to the actual StatisticsRegistry).
The StatisticsRegistry is now internal-only. However, it's built as a convenience library so that the parser and driver can use it too (by re-linking against it).
This is part of the ongoing effort to clean up the public interface.
(this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/expr_manager_template.cpp | 10 | ||||
-rw-r--r-- | src/expr/expr_manager_template.h | 10 | ||||
-rw-r--r-- | src/expr/node_manager.cpp | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/expr/expr_manager_template.cpp b/src/expr/expr_manager_template.cpp index 03f3a04b0..18b7bff0f 100644 --- a/src/expr/expr_manager_template.cpp +++ b/src/expr/expr_manager_template.cpp @@ -21,7 +21,7 @@ #include "expr/variable_type_map.h" #include "context/context.h" #include "options/options.h" -#include "util/stats.h" +#include "util/statistics_registry.h" #include <map> @@ -906,8 +906,12 @@ Context* ExprManager::getContext() const { return d_ctxt; } -StatisticsRegistry* ExprManager::getStatisticsRegistry() const throw() { - return d_nodeManager->getStatisticsRegistry(); +Statistics ExprManager::getStatistics() const throw() { + return Statistics(*d_nodeManager->getStatisticsRegistry()); +} + +SExpr ExprManager::getStatistic(const std::string& name) const throw() { + return d_nodeManager->getStatisticsRegistry()->getStatistic(name); } namespace expr { diff --git a/src/expr/expr_manager_template.h b/src/expr/expr_manager_template.h index 8e0f23c6a..8c964a5eb 100644 --- a/src/expr/expr_manager_template.h +++ b/src/expr/expr_manager_template.h @@ -27,7 +27,8 @@ #include "expr/type.h" #include "expr/expr.h" #include "util/subrange_bound.h" -#include "util/stats.h" +#include "util/statistics.h" +#include "util/sexpr.h" ${includes} @@ -35,7 +36,7 @@ ${includes} // compiler directs the user to the template file instead of the // generated one. We don't want the user to modify the generated one, // since it'll get overwritten on a later build. -#line 39 "${template}" +#line 40 "${template}" namespace CVC4 { @@ -454,7 +455,10 @@ public: Expr mkBoundVar(Type type); /** Get a reference to the statistics registry for this ExprManager */ - StatisticsRegistry* getStatisticsRegistry() const throw(); + Statistics getStatistics() const throw(); + + /** Get a reference to the statistics registry for this ExprManager */ + SExpr getStatistic(const std::string& name) const throw(); /** Export an expr to a different ExprManager */ //static Expr exportExpr(const Expr& e, ExprManager* em); diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp index 82242cb1c..a66933470 100644 --- a/src/expr/node_manager.cpp +++ b/src/expr/node_manager.cpp @@ -22,7 +22,7 @@ #include "util/Assert.h" #include "options/options.h" -#include "util/stats.h" +#include "util/statistics_registry.h" #include "util/tls.h" #include "expr/type_checker.h" |