summaryrefslogtreecommitdiff
path: root/src/include/expr.h
blob: 5e3559fd7d315a692d99e14058be4de480281bad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback