MADARA  3.2.3
VariableCompareNode.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_VARIABLE_COMPARE_NODE_H_
3 #define _MADARA_VARIABLE_COMPARE_NODE_H_
4 
5 #ifndef _MADARA_NO_KARL_
6 
7 #include <string>
8 #include <vector>
9 
15 
16 namespace madara
17 {
18  namespace expression
19  {
20  // Forward declarations.
21  class Visitor;
22 
30  {
31  public:
35  int type, ComponentNode * rhs,
37 
39  {
40  LESS_THAN = 0,
42  EQUAL = 2,
45  };
46 
48  virtual ~VariableCompareNode (void);
49 
51  virtual madara::knowledge::KnowledgeRecord item (void) const;
52 
56  virtual madara::knowledge::KnowledgeRecord prune (bool & can_change);
57 
62 
66  std::string expand_key (void) const;
67 
69  const std::string & key (void) const;
70 
72  virtual void accept (Visitor &visitor) const;
73 
74  private:
77 
80 
83 
86 
88 
91 
93  };
94  }
95 }
96 
97 #endif // _MADARA_NO_KARL_
98 
99 #endif /* _MADARA_VARIABLE_COMPARE_NODE_H_ */
This class encapsulates an entry in a KnowledgeBase.
Defines a terminal node of that references the current value stored in a variable.
Definition: VariableNode.h:28
Defines a terminal node of that references the current value stored in a variable.
VariableNode * var_
variable holder
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
madara::knowledge::ThreadSafeContext & context_
This class stores variables and their values for use by any entity needing state information in a thr...
VariableCompareNode(ComponentNode *lhs, madara::knowledge::KnowledgeRecord value, int type, ComponentNode *rhs, madara::knowledge::ThreadSafeContext &context)
Ctor.
CompositeArrayReference * array_
variable index holder
static struct madara::knowledge::tags::string_t string
An abstract base class defines a simple abstract implementation of an expression tree node...
Definition: ComponentNode.h:36
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:91
const std::string & key(void) const
Return the variable key.
std::string expand_key(void) const
Expands the key (if necessary).
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
ComponentNode * rhs_
holds a right hand side argument if it is not value_
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
madara::knowledge::KnowledgeRecord value_
amount to increment by. Note that this can also do decrement.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
Defines a terminal node of that references the current value stored in a variable.