The abstract base class for arithmetic terms. More...
#include <qExpr.h>
Public Member Functions | |
virtual term * | dup () const =0 |
Make a duplicate copy of the term. | |
virtual double | eval () const =0 |
Evaluate the term. | |
virtual bool | isTrue () const |
Should the value be treated as true? This implementation captures the normal case, where an arithmetic expression is treated as 'true' if it is not zero. | |
virtual void | print (std::ostream &out) const =0 |
Print a human readable version of the expression. | |
virtual void | printFull (std::ostream &out) const |
Same as print. | |
virtual term * | reduce () |
Shorten the expression by evaluating the constants. | |
virtual TERM_TYPE | termType () const =0 |
The abstract base class for arithmetic terms.
All allowed arithmetic expressions in a compRange or a select expression are derived from this class. Constant expressions are also allowed to represent where clauses that are always true or always false.
virtual bool ibis::math::term::isTrue | ( | ) | const [inline, virtual] |
Should the value be treated as true? This implementation captures the normal case, where an arithmetic expression is treated as 'true' if it is not zero.
Reimplemented in ibis::math::number, and ibis::math::literal.
References eval().
Referenced by ibis::query::doEstimate(), ibis::query::doEvaluate(), ibis::countQuery::doEvaluate(), ibis::query::doScan(), and ibis::countQuery::doScan().
virtual term* ibis::math::term::reduce | ( | ) | [inline, virtual] |
Shorten the expression by evaluating the constants.
Return a new pointer if the expression is changed, otherwise return the pointer this.
Reimplemented in ibis::math::bediener, ibis::math::stdFunction1, and ibis::math::stdFunction2.
Referenced by ibis::math::bediener::reduce(), ibis::math::stdFunction2::reduce(), ibis::math::stdFunction1::reduce(), ibis::qExpr::simplify(), ibis::selectClause::verify(), and ibis::selectClause::verifySome().
![]() |