Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | List of all members
wmtk::components::image_simulation::expression_parser::Expression Class Referenceabstract

Base class for boolean expression tree nodes used to evaluate cell tags. More...

#include <Expression.hpp>

Inheritance diagram for wmtk::components::image_simulation::expression_parser::Expression:
wmtk::components::image_simulation::expression_parser::AndExpr wmtk::components::image_simulation::expression_parser::EmptyExpr wmtk::components::image_simulation::expression_parser::NotExpr wmtk::components::image_simulation::expression_parser::OrExpr wmtk::components::image_simulation::expression_parser::TagExpr

Public Member Functions

virtual bool eval (const CellTag &tags) const =0
 Evaluates the expression against a given set of tags.
 
virtual std::string to_string () const =0
 Converts the expression to its string representation. Mainly for debugging purposes.
 
virtual bool contains_not () const
 Checks if the expression contains a logical NOT operation.
 
virtual bool contains_and () const
 Checks if the expression contains a logical AND operation.
 
virtual bool contains_or () const
 Checks if the expression contains a logical OR operation.
 
bool contains_only_and () const
 Checks if the expression contains only logical AND operations or none.
 
bool contains_only_or () const
 Checks if the expression contains only logical OR operations or none.
 
bool contains_only_not () const
 Checks if the expression contains only logical NOT operations or none.
 
virtual CellTag tags_involved () const =0
 Returns the set of tags involved in this expression.
 
virtual std::set< std::string > tag_names_involved () const =0
 

Detailed Description

Base class for boolean expression tree nodes used to evaluate cell tags.

Member Function Documentation

◆ contains_and()

virtual bool wmtk::components::image_simulation::expression_parser::Expression::contains_and ( ) const
inlinevirtual

◆ contains_not()

virtual bool wmtk::components::image_simulation::expression_parser::Expression::contains_not ( ) const
inlinevirtual

◆ contains_or()

virtual bool wmtk::components::image_simulation::expression_parser::Expression::contains_or ( ) const
inlinevirtual

◆ eval()

virtual bool wmtk::components::image_simulation::expression_parser::Expression::eval ( const CellTag &  tags) const
pure virtual

Evaluates the expression against a given set of tags.

Parameters
tagsThe tags evaluated against the boolean expression.
Returns
true If the expression is satisfied by the provided tags.
false Otherwise.

Implemented in wmtk::components::image_simulation::expression_parser::TagExpr, wmtk::components::image_simulation::expression_parser::EmptyExpr, wmtk::components::image_simulation::expression_parser::NotExpr, wmtk::components::image_simulation::expression_parser::AndExpr, and wmtk::components::image_simulation::expression_parser::OrExpr.

◆ tags_involved()

virtual CellTag wmtk::components::image_simulation::expression_parser::Expression::tags_involved ( ) const
pure virtual

Returns the set of tags involved in this expression.

This is useful for intent operations to determine which tags are relevant for the operation.

Returns
CellTag The set of tags involved in this expression.

Implemented in wmtk::components::image_simulation::expression_parser::TagExpr, wmtk::components::image_simulation::expression_parser::EmptyExpr, wmtk::components::image_simulation::expression_parser::NotExpr, wmtk::components::image_simulation::expression_parser::AndExpr, and wmtk::components::image_simulation::expression_parser::OrExpr.

◆ to_string()

virtual std::string wmtk::components::image_simulation::expression_parser::Expression::to_string ( ) const
pure virtual

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