MADARA  3.4.1
CompositeFunctionNode.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_COMPOSITE_FUNCTION_NODE_H_
3 #define _MADARA_COMPOSITE_FUNCTION_NODE_H_
4 
5 #ifndef _MADARA_NO_KARL_
6 
7 #include <vector>
12 
13 namespace madara
14 {
15 namespace expression
16 {
17 class ComponentNode;
18 class Visitor;
19 
25 {
26 public:
35  const ComponentNodes& nodes);
36 
40  virtual ~CompositeFunctionNode(void);
41 
46  virtual madara::knowledge::KnowledgeRecord item(void) const;
47 
53  virtual madara::knowledge::KnowledgeRecord prune(bool& can_change);
54 
62 
67  virtual void accept(Visitor& visitor) const;
68 
69 private:
70  // function name
72 
73  // variables context
75 
76  // function pointer
78 
79  // pointers to .1, .2, .3, etc.
80  std::vector<knowledge::KnowledgeRecord*> compiled_args_;
81 };
82 }
83 }
84 
85 #endif // _MADARA_NO_KARL_
86 
87 #endif /* _MADARA_COMPOSITE_FUNCTION_NODE_H_ */
A composite node that calls a function.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
CompositeFunctionNode(const std::string &name, madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
std::vector< knowledge::KnowledgeRecord * > compiled_args_
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:93
This class stores a function definition.
Definition: Functions.h:46
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...
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
constexpr string_t string
Copyright(c) 2020 Galois.