MADARA  3.4.1
ListNode.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_LIST_NODE_H_
3 #define _MADARA_LIST_NODE_H_
4 
5 #ifndef _MADARA_NO_KARL_
6 
7 #include <list>
8 #include <string>
9 #include <vector>
10 
14 
15 namespace madara
16 {
17 namespace expression
18 {
19 // Forward declarations.
20 class Visitor;
21 
27 class ListNode : public ComponentNode
28 {
29 public:
32 
34  virtual ~ListNode(void);
35 
37  virtual madara::knowledge::KnowledgeRecord item(void) const;
38 
42  virtual madara::knowledge::KnowledgeRecord prune(bool& can_change);
43 
48 
50  virtual void accept(Visitor& visitor) const;
51 
52 private:
53  // variables context
54  // madara::knowledge::ThreadSafeContext & context_;
55 
57  ::std::list<ComponentNode*> list_;
58 };
59 }
60 }
61 
62 #endif // _MADARA_NO_KARL_
63 
64 #endif /* _MADARA_LIST_NODE_H_ */
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition: ComponentNode.h:37
Defines a terminal node that contains a list.
Definition: ListNode.h:28
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
Definition: ListNode.cpp:49
virtual ~ListNode(void)
Dtor.
Definition: ListNode.cpp:17
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
Definition: ListNode.cpp:27
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
Definition: ListNode.cpp:22
ListNode(madara::knowledge::ThreadSafeContext &context)
Ctor.
Definition: ListNode.cpp:11
::std::list< ComponentNode * > list_
list of trees in a parameter list
Definition: ListNode.h:57
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
Definition: ListNode.cpp:36
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.