15 if( e.
isNot ) s <<
" ! " ;
16 s <<
" [ " << e.
Value <<
" ] " << std::endl ;
54 std::vector<Expression> tokens ;
56 std::for_each( expression.begin(),expression.end(), t ) ;
59 if( tokens.size() == 1
60 && tokens[0].Value.find(
'&') == std::string::npos
61 && tokens[0].Value.find(
'|') == std::string::npos ) {
62 if( tokens[0].isNot ) {
63 return not
getValue( tokens[0].Value ) ;
69 bool returnVal = true ;
70 for(
auto it = tokens.begin() ; it != tokens.end() ; it++ ) {
73 tokenValue = ! tokenValue ;
76 returnVal &= tokenValue ;
79 returnVal |= tokenValue ;
92 std::ostringstream error;
93 error <<
"LogicalExpressions::getValue(): key \"" << key <<
"\" not found. Bad processor condition?\n";
96 streamlog_out( DEBUG ) <<
" key : " << iter->first <<
" val: " << iter->second << std::endl ;
98 throw marlinmt::ParseException( error.str() );
void clear()
Clear all boolean values.
std::ostream & operator<<(std::ostream &stream, const Configuration &cfg)
Stream operator.
bool getValue(const std::string &key) const
helper function for finding return values, that actually have been set by their corresponding process...
Helper struct for LogicalExpression.
void addCondition(const std::string &name, const std::string &expression)
Add a new named logical expression formed out of [!,(,&&,||,),value], e.g.
LogicalExpressions()
C'tor.
Helper class for LogicalExpressions that splits the expression into subexpressions - needs to be apll...
void setValue(const std::string &key, bool val)
Set the the boolean value for the given key.
bool expressionIsTrue(const std::string &expression) const
True if the given expression is true with the current values.
bool conditionIsTrue(const std::string &name) const
True if the named condition (stored with addCondition) is true with the current values.