MADARA
3.1.8
Main Page
Namespaces
Classes
Files
File List
File Members
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
71
// function name
72
const
std::string
name_
;
73
74
// variables context
75
knowledge::ThreadSafeContext
&
context_
;
76
77
// function pointer
78
knowledge::Function
*
function_
;
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_ */
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:60
Functions.h
KnowledgeRecord.h
madara::expression::CompositeFunctionNode::compiled_args_
std::vector< knowledge::KnowledgeRecord * > compiled_args_
Definition:
CompositeFunctionNode.h:81
CompositeTernaryNode.h
madara::expression::CompositeFunctionNode::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
Definition:
CompositeFunctionNode.cpp:53
madara::knowledge::Function
This class stores a function definition.
Definition:
Functions.h:44
madara::expression::CompositeFunctionNode::function_
knowledge::Function * function_
Definition:
CompositeFunctionNode.h:78
madara::expression::ComponentNodes
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
Definition:
ComponentNode.h:100
ThreadSafeContext.h
madara::knowledge::ThreadSafeContext
This class stores variables and their values for use by any entity needing state information in a thr...
Definition:
ThreadSafeContext.h:82
madara::expression::CompositeFunctionNode::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Definition:
CompositeFunctionNode.cpp:64
madara::expression::CompositeFunctionNode
A composite node that calls a function.
Definition:
CompositeFunctionNode.h:24
madara::expression::CompositeFunctionNode::~CompositeFunctionNode
virtual ~CompositeFunctionNode(void)
Destructor.
Definition:
CompositeFunctionNode.cpp:48
madara::expression::CompositeFunctionNode::accept
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Definition:
CompositeFunctionNode.cpp:235
madara::expression::CompositeTernaryNode
Definition:
CompositeTernaryNode.h:26
madara::expression::CompositeFunctionNode::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Definition:
CompositeFunctionNode.cpp:104
madara::expression::Visitor
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition:
Visitor.h:90
madara::knowledge::tags::string
static constexpr struct madara::knowledge::tags::string_t string
madara::expression::CompositeFunctionNode::name_
const std::string name_
Definition:
CompositeFunctionNode.h:72
madara::expression::CompositeFunctionNode::CompositeFunctionNode
CompositeFunctionNode(const std::string &name, madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Definition:
CompositeFunctionNode.cpp:36
madara::knowledge::KnowledgeUpdateSettings
Settings for applying knowledge updates.
Definition:
KnowledgeUpdateSettings.h:23
madara
Copyright (c) 2015 Carnegie Mellon University.
Definition:
AggregateFilter.h:30
madara::expression::CompositeFunctionNode::context_
knowledge::ThreadSafeContext & context_
Definition:
CompositeFunctionNode.h:75
include
madara
expression
CompositeFunctionNode.h
Generated on Wed May 9 2018 18:17:13 for MADARA by
1.8.11