1 #ifndef LogicalExpressions_h
2 #define LogicalExpressions_h 1
65 if( c !=
' ' && c !=
'\t' ) {
105 if( c ==
'&' || c==
'|' ){
107 if ( c ==
'&' &&
_last ==
'&' ) {
112 if ( c ==
'|' &&
_last ==
'|' ) {
std::map< const std::string, bool > ResultMap
Tokenizer(std::vector< Expression > &tokens)
void clear()
Clear all boolean values.
void setValue(const std::string &key, bool val)
Set the the boolean value for the given key.
bool getValue(const std::string &key)
helper function for finding return values, that actually have been set by their corresponding process...
virtual ~LogicalExpressions()
Virtual d'tor.
Helper class for LogicalExpressions that splits the expression into subexpressions - needs to be apll...
Helper struct for LogicalExpression.
std::vector< Expression > & result()
Helper class that holds named boolean values and named conditions that are expressions of these value...
bool expressionIsTrue(const std::string &expression)
True if the given expression is true with the current values.
std::map< const std::string, std::string > ConditionsMap
LogicalExpressions()
C'tor.
bool conditionIsTrue(const std::string &name)
True if the named condition (stored with addCondition) is true with the current values.
std::vector< Expression > & _tokens
void operator()(const char &c)
Save the current character and change state if necessary.
void addCondition(const std::string &name, const std::string &expression)
Add a new named logical expression formed out of [!,(,&&,||,),value], e.g.
std::ostream & operator<<(std::ostream &s, Expression &e)