MADARA  3.4.1
ListNode.cpp
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NO_KARL_
3 
7 
8 #include <string>
9 #include <sstream>
10 
13  : ComponentNode(context.get_logger()), list_()
14 {
15 }
16 
18 {
19  // do not clean up record_. Let the context clean that up.
20 }
21 
23 {
24  visitor.visit(*this);
25 }
26 
28 {
31 }
32 
37  bool& can_change)
38 {
39  // a variable is one of very few nodes that can change over time and
40  // cannot be pruned
41  can_change = true;
42 
45 }
46 
51 {
54 }
55 
56 #endif // _MADARA_NO_KARL_
madara::knowledge::KnowledgeRecord KnowledgeRecord
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition: ComponentNode.h:37
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
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
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
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...