MADARA  3.2.3
ComponentNode.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_COMPONENT_NODE_H_
3 #define _MADARA_COMPONENT_NODE_H_
4 
5 #ifndef _MADARA_NO_KARL_
6 
7 #include <string>
8 #include <deque>
9 #include <stdexcept>
12 #include "madara/utility/StdInt.h"
13 #include "madara/logger/Logger.h"
14 #include "KarlException.h"
15 
16 namespace madara
17 {
18  namespace knowledge
19  {
20  class ThreadSafeContext;
21  }
22 
23  namespace expression
24  {
25  // Forward declaration.
26  class Visitor;
27 
37  {
38  public:
44 
48  virtual ~ComponentNode (void) = 0;
49 
54  virtual madara::knowledge::KnowledgeRecord item (void) const;
55 
60  virtual madara::knowledge::KnowledgeRecord prune (bool & can_change) = 0;
61 
67  virtual madara::knowledge::KnowledgeRecord evaluate (
69  = 0;
70 
75  virtual ComponentNode *left (void) const;
76 
81  virtual ComponentNode *right (void) const;
82 
87  virtual void accept (Visitor &visitor) const;
88 
93  void set_logger (logger::Logger & logger);
94 
95  protected:
98  };
99 
101  typedef std::deque <ComponentNode *> ComponentNodes;
102  }
103 }
104 
105 #endif // _MADARA_NO_KARL_
106 
107 #endif /* _MADARA_COMPONENT_NODE_H_ */
This class encapsulates an entry in a KnowledgeBase.
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
logger::Logger * logger_
handle the context
Definition: ComponentNode.h:97
Provides knowledge logging services to files and terminals.
Definition: GlobalLogger.h:11
A multi-threaded logger for logging to one or more destinations.
Definition: Logger.h:88
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
Provides functions and classes for the distributed knowledge base.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.