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>
8
#include "
madara/knowledge/KnowledgeRecord.h
"
9
#include "
madara/expression/CompositeTernaryNode.h
"
10
#include "
madara/knowledge/Functions.h
"
11
#include "
madara/knowledge/ThreadSafeContext.h
"
12
13
namespace
madara
14
{
15
namespace
expression
16
{
17
class
ComponentNode;
18
class
Visitor;
19
24
class
CompositeFunctionNode
:
public
CompositeTernaryNode
25
{
26
public
:
33
CompositeFunctionNode
(
const
std::string
& name,
34
madara::knowledge::ThreadSafeContext
& context,
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
60
virtual
madara::knowledge::KnowledgeRecord
evaluate
(
61
const
madara::knowledge::KnowledgeUpdateSettings
& settings);
62
67
virtual
void
accept
(
Visitor
& visitor)
const
;
68
69
private
:
70
// function name
71
const
std::string
name_
;
72
73
// variables context
74
knowledge::ThreadSafeContext
&
context_
;
75
76
// function pointer
77
knowledge::Function
*
function_
;
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_ */
CompositeTernaryNode.h
Functions.h
KnowledgeRecord.h
ThreadSafeContext.h
madara::expression::CompositeFunctionNode
A composite node that calls a function.
Definition:
CompositeFunctionNode.h:25
madara::expression::CompositeFunctionNode::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Definition:
CompositeFunctionNode.cpp:100
madara::expression::CompositeFunctionNode::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Definition:
CompositeFunctionNode.cpp:61
madara::expression::CompositeFunctionNode::accept
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Definition:
CompositeFunctionNode.cpp:225
madara::expression::CompositeFunctionNode::name_
const std::string name_
Definition:
CompositeFunctionNode.h:71
madara::expression::CompositeFunctionNode::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
Definition:
CompositeFunctionNode.cpp:50
madara::expression::CompositeFunctionNode::~CompositeFunctionNode
virtual ~CompositeFunctionNode(void)
Destructor.
Definition:
CompositeFunctionNode.cpp:47
madara::expression::CompositeFunctionNode::function_
knowledge::Function * function_
Definition:
CompositeFunctionNode.h:77
madara::expression::CompositeFunctionNode::CompositeFunctionNode
CompositeFunctionNode(const std::string &name, madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Definition:
CompositeFunctionNode.cpp:36
madara::expression::CompositeFunctionNode::context_
knowledge::ThreadSafeContext & context_
Definition:
CompositeFunctionNode.h:74
madara::expression::CompositeFunctionNode::compiled_args_
std::vector< knowledge::KnowledgeRecord * > compiled_args_
Definition:
CompositeFunctionNode.h:80
madara::expression::CompositeTernaryNode
Definition:
CompositeTernaryNode.h:26
madara::expression::Visitor
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition:
Visitor.h:93
madara::knowledge::Function
This class stores a function definition.
Definition:
Functions.h:46
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:88
madara::knowledge::KnowledgeUpdateSettings
Settings for applying knowledge updates.
Definition:
KnowledgeUpdateSettings.h:24
madara::knowledge::ThreadSafeContext
This class stores variables and their values for use by any entity needing state information in a thr...
Definition:
ThreadSafeContext.h:76
madara::expression::ComponentNodes
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
Definition:
ComponentNode.h:100
madara::knowledge::tags::string
constexpr string_t string
Definition:
KnowledgeRecord.h:56
madara
Copyright(c) 2020 Galois.
Definition:
AggregateFilter.h:31
include
madara
expression
CompositeFunctionNode.h
Generated on Sat Jan 20 2024 00:40:26 for MADARA by
1.9.1