MarlinMT  0.1.0
marlinmt::LogicalExpressions Class Reference

Helper class that holds named boolean values and named conditions that are expressions of these values and computes the corresponding truth values. More...

#include <LogicalExpressions.h>

Public Member Functions

 LogicalExpressions ()
 C'tor. More...
 
virtual ~LogicalExpressions ()
 Virtual d'tor. More...
 
void addCondition (const std::string &name, const std::string &expression)
 Add a new named logical expression formed out of [!,(,&&,||,),value], e.g. More...
 
void clear ()
 Clear all boolean values. More...
 
bool conditionIsTrue (const std::string &name) const
 True if the named condition (stored with addCondition) is true with the current values. More...
 
bool expressionIsTrue (const std::string &expression) const
 True if the given expression is true with the current values. More...
 
void setValue (const std::string &key, bool val)
 Set the the boolean value for the given key. More...
 

Protected Member Functions

bool getValue (const std::string &key) const
 helper function for finding return values, that actually have been set by their corresponding processor - throws exception if not set More...
 

Protected Attributes

ConditionsMap _condMap {}
 
ResultMap _resultMap {}
 

Detailed Description

Helper class that holds named boolean values and named conditions that are expressions of these values and computes the corresponding truth values.

Definition at line 143 of file LogicalExpressions.h.

Constructor & Destructor Documentation

◆ LogicalExpressions()

marlinmt::LogicalExpressions::LogicalExpressions ( )

C'tor.

Definition at line 20 of file LogicalExpressions.cc.

References setValue().

◆ ~LogicalExpressions()

virtual marlinmt::LogicalExpressions::~LogicalExpressions ( )
inlinevirtual

Virtual d'tor.

Definition at line 152 of file LogicalExpressions.h.

Member Function Documentation

◆ addCondition()

void marlinmt::LogicalExpressions::addCondition ( const std::string &  name,
const std::string &  expression 
)

Add a new named logical expression formed out of [!,(,&&,||,),value], e.g.


( A && ( B || !C ) ) || ( !B && D )

Definition at line 28 of file LogicalExpressions.cc.

References _condMap.

◆ clear()

void marlinmt::LogicalExpressions::clear ( )

Clear all boolean values.

Definition at line 32 of file LogicalExpressions.cc.

References _resultMap, and setValue().

◆ conditionIsTrue()

bool marlinmt::LogicalExpressions::conditionIsTrue ( const std::string &  name) const

True if the named condition (stored with addCondition) is true with the current values.

Definition at line 42 of file LogicalExpressions.cc.

References _condMap, and expressionIsTrue().

◆ expressionIsTrue()

bool marlinmt::LogicalExpressions::expressionIsTrue ( const std::string &  expression) const

True if the given expression is true with the current values.

Definition at line 53 of file LogicalExpressions.cc.

References marlinmt::Expression::AND, and getValue().

Referenced by conditionIsTrue().

◆ getValue()

bool marlinmt::LogicalExpressions::getValue ( const std::string &  key) const
protected

helper function for finding return values, that actually have been set by their corresponding processor - throws exception if not set

Definition at line 89 of file LogicalExpressions.cc.

References _resultMap.

Referenced by expressionIsTrue().

◆ setValue()

void marlinmt::LogicalExpressions::setValue ( const std::string &  key,
bool  val 
)

Set the the boolean value for the given key.

Definition at line 85 of file LogicalExpressions.cc.

References _resultMap.

Referenced by clear(), and LogicalExpressions().

Member Data Documentation

◆ _condMap

ConditionsMap marlinmt::LogicalExpressions::_condMap {}
protected

Definition at line 177 of file LogicalExpressions.h.

Referenced by addCondition(), and conditionIsTrue().

◆ _resultMap

ResultMap marlinmt::LogicalExpressions::_resultMap {}
protected

Definition at line 178 of file LogicalExpressions.h.

Referenced by clear(), getValue(), and setValue().


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