cvc4-1.4
CVC4::expr::ExprSetDepth Class Reference

IOStream manipulator to set the maximum depth of Exprs when pretty-printing. More...

#include <expr.h>

Data Structures

class  Scope
 Set the expression depth on the output stream for the current stack scope. More...
 

Public Member Functions

 ExprSetDepth (long depth)
 Construct a ExprSetDepth with the given depth. More...
 
void applyDepth (std::ostream &out)
 

Static Public Member Functions

static long getDepth (std::ostream &out)
 
static void setDepth (std::ostream &out, long depth)
 

Detailed Description

IOStream manipulator to set the maximum depth of Exprs when pretty-printing.

-1 means print to any depth. E.g.:

// let a, b, c, and d be VARIABLEs Expr e = em->mkExpr(OR, a, b, em->mkExpr(AND, c, em->mkExpr(NOT, d))) out << setdepth(3) << e;

gives "(OR a b (AND c (NOT d)))", but

out << setdepth(1) << [same expr as above]

gives "(OR a b (...))".

The implementation of this class serves two purposes; it holds information about the depth setting (such as the index of the allocated word in ios_base), and serves also as the manipulator itself (as above).

Definition at line 682 of file expr.h.

Constructor & Destructor Documentation

◆ ExprSetDepth()

CVC4::expr::ExprSetDepth::ExprSetDepth ( long  depth)
inline

Construct a ExprSetDepth with the given depth.

Definition at line 703 of file expr.h.

Member Function Documentation

◆ applyDepth()

void CVC4::expr::ExprSetDepth::applyDepth ( std::ostream &  out)
inline

Definition at line 705 of file expr.h.

Referenced by CVC4::expr::operator<<().

◆ getDepth()

static long CVC4::expr::ExprSetDepth::getDepth ( std::ostream &  out)
inlinestatic

Definition at line 709 of file expr.h.

References CVC4::Options::current(), and CVC4::options::defaultExprDepth.

◆ setDepth()

static void CVC4::expr::ExprSetDepth::setDepth ( std::ostream &  out,
long  depth 
)
inlinestatic

The documentation for this class was generated from the following file: