From: Morgan Deters Date: Mon, 25 Jan 2010 21:10:01 +0000 (+0000) Subject: scoped node managers X-Git-Tag: cvc5-1.0.0~9342 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53b60534fd72480121fa399534517938a5361c57;p=cvc5.git scoped node managers --- diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h index 827c6c1b7..60699eeaf 100644 --- a/src/expr/node_manager.h +++ b/src/expr/node_manager.h @@ -53,6 +53,19 @@ public: Node mkVar(); }; + +class NodeManagerScope { + NodeManager *d_oldNodeManager; + +public: + NodeManagerScope(const NodeManager* nm) : d_oldNodeManager(NodeManager::s_current) { + NodeManager::s_current = nm; + } + ~NodeManagerScope() { + NodeManager::s_current = d_oldNodeManager; + } +}; + }/* CVC4 namespace */ #endif /* __CVC4__EXPR_MANAGER_H */