From a101d3298691265ee4cf72bed1ca59cd60318839 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 3 Nov 2009 00:31:47 +0000 Subject: commit of project structure including autotools support --- src/include/expr.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/include/expr.h (limited to 'src/include/expr.h') diff --git a/src/include/expr.h b/src/include/expr.h new file mode 100644 index 000000000..5e3559fd7 --- /dev/null +++ b/src/include/expr.h @@ -0,0 +1,54 @@ +/********************* -*- C++ -*- */ +/** expr.h + ** This file is part of the CVC4 prototype. + ** + ** Reference-counted encapsulation of a pointer to an expression. + ** + ** The Analysis of Computer Systems Group (ACSys) + ** Courant Institute of Mathematical Sciences + ** New York University + **/ + +#ifndef __CVC4_EXPR_H +#define __CVC4_EXPR_H + +namespace CVC4 { + +class ExprValue; + +/** + * Encapsulation of an ExprValue pointer. The reference count is + * maintained in the ExprValue. + */ +class Expr { + /** A convenient null-valued encapsulated pointer */ + static Expr s_null; + + /** The referenced ExprValue */ + ExprValue* d_ev; + + /** This constructor is reserved for use by the Expr package; one + * must construct an Expr using one of the build mechanisms of the + * Expr package. + * + * Increments the reference count. */ + explicit Expr(ExprValue*); + + /** Destructor. Decrements the reference count and, if zero, + * collects the ExprValue. */ + ~Expr(); + +public: + /** Access to the encapsulated expression. + * @return the encapsulated expression. */ + ExprValue* operator->(); + + /** Const access to the encapsulated expressoin. + * @return the encapsulated expression [const]. */ + const ExprValue* operator->() const; + +};/* class Expr */ + +} /* CVC4 namespace */ + +#endif /* __CVC4_EXPR_H */ -- cgit v1.2.3