scoped node managers
authorMorgan Deters <mdeters@gmail.com>
Mon, 25 Jan 2010 21:10:01 +0000 (21:10 +0000)
committerMorgan Deters <mdeters@gmail.com>
Mon, 25 Jan 2010 21:10:01 +0000 (21:10 +0000)
src/expr/node_manager.h

index 827c6c1b70628a1d5e41ee325a29bcf80b82ff92..60699eeaf0d1d7a9c55c556e110998a0ae60dc31 100644 (file)
@@ -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 */