MADARA  3.2.3
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:
33  CompositeFunctionNode (const std::string & name,
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 
71  // function name
73 
74  // variables context
76 
77  // function pointer
79 
80  // pointers to .1, .2, .3, etc.
81  std::vector <knowledge::KnowledgeRecord *> compiled_args_;
82  };
83  }
84 }
85 
86 #endif // _MADARA_NO_KARL_
87 
88 #endif /* _MADARA_COMPOSITE_FUNCTION_NODE_H_ */
This class encapsulates an entry in a KnowledgeBase.
std::vector< knowledge::KnowledgeRecord * > compiled_args_
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
This class stores a function definition.
Definition: Functions.h:44
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
This class stores variables and their values for use by any entity needing state information in a thr...
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
A composite node that calls a function.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
static struct madara::knowledge::tags::string_t string
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:91
CompositeFunctionNode(const std::string &name, madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.