MarlinMT
0.1.0
|
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 {} |
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.
marlinmt::LogicalExpressions::LogicalExpressions | ( | ) |
|
inlinevirtual |
Virtual d'tor.
Definition at line 152 of file LogicalExpressions.h.
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.
void marlinmt::LogicalExpressions::clear | ( | ) |
Clear all boolean values.
Definition at line 32 of file LogicalExpressions.cc.
References _resultMap, and setValue().
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().
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().
|
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().
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().
|
protected |
Definition at line 177 of file LogicalExpressions.h.
Referenced by addCondition(), and conditionIsTrue().
|
protected |
Definition at line 178 of file LogicalExpressions.h.
Referenced by clear(), getValue(), and setValue().