27 InfoSingle(
const std::string& expression,
int context,
unsigned int& refreshCounter)
28 :
InfoBool(expression, context, refreshCounter)
44 InfoExpression(
const std::string& expression,
int context,
unsigned int& refreshCounter)
45 :
InfoBool(expression, context, refreshCounter)
73 class InfoSubexpression
76 virtual ~InfoSubexpression(
void) =
default;
77 virtual bool Evaluate(
int contextWindow,
const CGUIListItem* item) = 0;
78 virtual node_type_t Type()
const=0;
81 typedef std::shared_ptr<InfoSubexpression> InfoSubexpressionPtr;
84 class InfoLeaf :
public InfoSubexpression
87 InfoLeaf(InfoPtr info,
bool invert) : m_info(std::move(info)), m_invert(invert) {}
88 bool Evaluate(
int contextWindow,
const CGUIListItem* item)
override;
89 node_type_t Type()
const override {
return NODE_LEAF; }
97 class InfoAssociativeGroup :
public InfoSubexpression
100 InfoAssociativeGroup(node_type_t type,
const InfoSubexpressionPtr &left,
const InfoSubexpressionPtr &right);
101 void AddChild(
const InfoSubexpressionPtr &child);
102 void Merge(
const std::shared_ptr<InfoAssociativeGroup>& other);
103 bool Evaluate(
int contextWindow,
const CGUIListItem* item)
override;
104 node_type_t Type()
const override {
return m_type; }
108 std::list<InfoSubexpressionPtr> m_children;
111 static operator_t GetOperator(
char ch);
112 static void OperatorPop(std::stack<operator_t> &operator_stack,
bool &invert, std::stack<InfoSubexpressionPtr> &nodes);
113 bool Parse(
const std::string &expression);
114 InfoSubexpressionPtr m_expression_tree;
Definition: GUIInfoManager.h:56
Definition: GUIListItem.h:29
Class to wrap active boolean conditions.
Definition: InfoExpression.h:24
Definition: ContextMenuItem.h:23
void Update(int contextWindow, const CGUIListItem *item) override
Update the value of this info bool This is called if and only if the info bool is dirty...
Definition: InfoExpression.cpp:26
Base class, wrapping boolean conditions and expressions.
Definition: InfoBool.h:23
Class to wrap active boolean expressions.
Definition: InfoExpression.h:41