MADARA  3.2.3
VariableIncrementNode.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_VARIABLE_INCREMENT_NODE_H_
3 #define _MADARA_VARIABLE_INCREMENT_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  ComponentNode * rhs,
37 
39  virtual ~VariableIncrementNode (void);
40 
42  virtual madara::knowledge::KnowledgeRecord item (void) const;
43 
47  virtual madara::knowledge::KnowledgeRecord prune (bool & can_change);
48 
53 
57  std::string expand_key (void) const;
58 
60  const std::string & key (void) const;
61 
63  virtual void accept (Visitor &visitor) const;
64 
65  private:
68 
71 
74 
77 
79 
81  };
82  }
83 }
84 
85 #endif // _MADARA_NO_KARL_
86 
87 #endif /* _MADARA_VARIABLE_INCREMENT_NODE_H_ */
This class encapsulates an entry in a KnowledgeBase.
CompositeArrayReference * array_
variable index holder
Defines a terminal node of that references the current value stored in a variable.
Definition: VariableNode.h:28
std::string expand_key(void) const
Expands the key (if necessary).
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...
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
const std::string & key(void) const
Return the variable key.
madara::knowledge::KnowledgeRecord value_
amount to increment by. Note that this can also do decrement.
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
VariableIncrementNode(ComponentNode *lhs, madara::knowledge::KnowledgeRecord value, ComponentNode *rhs, madara::knowledge::ThreadSafeContext &context)
Ctor.
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:91
ComponentNode * rhs_
holds a right hand side argument if it is not value_
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.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
Defines a terminal node of that references the current value stored in a variable.