MADARA  3.4.1
CompositeForLoop.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_COMPOSITE_FOR_LOOP_H_
3 #define _MADARA_COMPOSITE_FOR_LOOP_H_
4 
5 #ifndef _MADARA_NO_KARL_
6 
11 
12 namespace madara
13 {
14 namespace expression
15 {
16 class ComponentNode;
17 class Visitor;
18 
24 {
25 public:
34  CompositeForLoop(ComponentNode* precondition, ComponentNode* condition,
35  ComponentNode* postcondition, ComponentNode* body,
37 
41  virtual ~CompositeForLoop(void);
42 
47  virtual madara::knowledge::KnowledgeRecord item(void) const;
48 
54  virtual madara::knowledge::KnowledgeRecord prune(bool& can_change);
55 
63 
68  virtual void accept(Visitor& visitor) const;
69 
70 private:
71  // variables context
72  // madara::knowledge::ThreadSafeContext & context_;
73 
74  // the loop precondition (what happens before the loop)
76 
77  // the loop condition (what must be true to continue looping)
79 
80  // the postcondition (what happens after a loop)
82 
83  // the body (what happens after a condition is true--the loop contents)
85 
86  // function pointer
87  // madara::knowledge::Function * function_;
88 };
89 }
90 }
91 
92 #endif // _MADARA_NO_KARL_
93 
94 #endif /* _MADARA_COMPOSITE_FOR_LOOP_H_ */
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition: ComponentNode.h:37
A composite node that iterates until a condition is met.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
CompositeForLoop(ComponentNode *precondition, ComponentNode *condition, ComponentNode *postcondition, ComponentNode *body, madara::knowledge::ThreadSafeContext &context)
Constructor.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
virtual ~CompositeForLoop(void)
Destructor.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:93
This class encapsulates an entry in a KnowledgeBase.
Settings for applying knowledge updates.
This class stores variables and their values for use by any entity needing state information in a thr...
Copyright(c) 2020 Galois.