MADARA  3.2.3
ListNode.cpp
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NO_KARL_
3 
7 
8 
9 #include <string>
10 #include <sstream>
11 
14 : ComponentNode (context.get_logger ()), list_ ()
15 {
16 
17 }
18 
20 {
21  // do not clean up record_. Let the context clean that up.
22 }
23 
24 
25 void
27 {
28  visitor.visit (*this);
29 }
30 
33 {
36 }
37 
43 {
44  // a variable is one of very few nodes that can change over time and
45  // cannot be pruned
46  can_change = true;
47 
50 }
51 
56  const madara::knowledge::KnowledgeUpdateSettings & /*settings*/)
57 {
60 }
61 
62 
63 #endif // _MADARA_NO_KARL_
This class encapsulates an entry in a KnowledgeBase.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
Definition: ListNode.cpp:42
madara::knowledge::KnowledgeRecord KnowledgeRecord
::std::list< ComponentNode * > list_
list of trees in a parameter list
Definition: ListNode.h:57
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
Definition: ListNode.cpp:26
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
Definition: ListNode.cpp:32
This class stores variables and their values for use by any entity needing state information in a thr...
ListNode(madara::knowledge::ThreadSafeContext &context)
Ctor.
Definition: ListNode.cpp:12
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
Definition: ListNode.cpp:55
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
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual ~ListNode(void)
Dtor.
Definition: ListNode.cpp:19