KASSERT  0.0.1
Karlsruhe Assertion Library
kassert::internal::Expression Class Referenceabstract

Interface for decomposed unary and binary expressions. More...

#include <expression_decomposition.hpp>

Inheritance diagram for kassert::internal::Expression:
kassert::internal::BinaryExpression< LhsT, RhsT > kassert::internal::UnaryExpression< LhsT >

Public Member Functions

virtual ~Expression ()=default
 Virtual destructor since we use virtual functions.
 
virtual bool result () const =0
 Evaluate the assertion wrapped in this Expr. More...
 
virtual void stringify (OStreamLogger &out) const =0
 Write this expression with stringified operands to the given assertion logger. More...
 

Friends

OStreamLoggeroperator<< (OStreamLogger &out, Expression const &expr)
 Writes an expression with stringified operands to the given assertion logger. More...
 

Detailed Description

Interface for decomposed unary and binary expressions.

Member Function Documentation

◆ result()

virtual bool kassert::internal::Expression::result ( ) const
pure virtual

Evaluate the assertion wrapped in this Expr.

Returns
The boolean value that the assertion evalutes to.

Implemented in kassert::internal::BinaryExpression< LhsT, RhsT >, and kassert::internal::UnaryExpression< LhsT >.

◆ stringify()

virtual void kassert::internal::Expression::stringify ( OStreamLogger out) const
pure virtual

Write this expression with stringified operands to the given assertion logger.

Parameters
outThe assertion logger.

Implemented in kassert::internal::BinaryExpression< LhsT, RhsT >, and kassert::internal::UnaryExpression< LhsT >.

Friends And Related Function Documentation

◆ operator<<

OStreamLogger & operator<< ( OStreamLogger out,
Expression const &  expr 
)
friend

Writes an expression with stringified operands to the given assertion logger.

Parameters
outThe assertion logger.
exprThe expression to be stringified.
Returns
The assertion logger.

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