MADARA
3.4.1
VariableMultiplyNode.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef _MADARA_VARIABLE_MULTIPLY_NODE_H_
3
#define _MADARA_VARIABLE_MULTIPLY_NODE_H_
4
5
#ifndef _MADARA_NO_KARL_
6
7
#include <string>
8
#include <vector>
9
10
#include "
madara/expression/ComponentNode.h
"
11
#include "
madara/expression/VariableNode.h
"
12
#include "
madara/expression/CompositeArrayReference.h
"
13
#include "
madara/knowledge/ThreadSafeContext.h
"
14
#include "
madara/knowledge/KnowledgeRecord.h
"
15
16
namespace
madara
17
{
18
namespace
expression
19
{
20
// Forward declarations.
21
class
Visitor;
22
28
class
VariableMultiplyNode
:
public
ComponentNode
29
{
30
public
:
32
VariableMultiplyNode
(
ComponentNode
* lhs,
33
madara::knowledge::KnowledgeRecord
value,
ComponentNode
* rhs,
34
madara::knowledge::ThreadSafeContext
& context);
35
37
virtual
~VariableMultiplyNode
(
void
);
38
40
virtual
madara::knowledge::KnowledgeRecord
item
(
void
)
const
;
41
45
virtual
madara::knowledge::KnowledgeRecord
prune
(
bool
& can_change);
46
49
virtual
madara::knowledge::KnowledgeRecord
evaluate
(
50
const
madara::knowledge::KnowledgeUpdateSettings
& settings);
51
53
virtual
void
accept
(
Visitor
& visitor)
const
;
54
55
private
:
57
VariableNode
*
var_
;
58
60
CompositeArrayReference
*
array_
;
61
63
madara::knowledge::KnowledgeRecord
value_
;
64
66
ComponentNode
*
rhs_
;
67
};
68
}
69
}
70
71
#endif
// _MADARA_NO_KARL_
72
73
#endif
/* _MADARA_VARIABLE_MULTIPLY_NODE_H_ */
ComponentNode.h
CompositeArrayReference.h
KnowledgeRecord.h
ThreadSafeContext.h
VariableNode.h
madara::expression::ComponentNode
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition:
ComponentNode.h:37
madara::expression::CompositeArrayReference
Defines a terminal node of that references the current value stored in a variable.
Definition:
CompositeArrayReference.h:29
madara::expression::VariableMultiplyNode
Composite node that multiplies a variable by some right hand side.
Definition:
VariableMultiplyNode.h:29
madara::expression::VariableMultiplyNode::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
Definition:
VariableMultiplyNode.cpp:53
madara::expression::VariableMultiplyNode::rhs_
ComponentNode * rhs_
holds a right hand side argument if it is not value_
Definition:
VariableMultiplyNode.h:66
madara::expression::VariableMultiplyNode::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
Definition:
VariableMultiplyNode.cpp:37
madara::expression::VariableMultiplyNode::var_
VariableNode * var_
variable holder
Definition:
VariableMultiplyNode.h:57
madara::expression::VariableMultiplyNode::~VariableMultiplyNode
virtual ~VariableMultiplyNode(void)
Dtor.
Definition:
VariableMultiplyNode.cpp:26
madara::expression::VariableMultiplyNode::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
Definition:
VariableMultiplyNode.cpp:100
madara::expression::VariableMultiplyNode::accept
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
Definition:
VariableMultiplyNode.cpp:31
madara::expression::VariableMultiplyNode::VariableMultiplyNode
VariableMultiplyNode(ComponentNode *lhs, madara::knowledge::KnowledgeRecord value, ComponentNode *rhs, madara::knowledge::ThreadSafeContext &context)
Ctor.
Definition:
VariableMultiplyNode.cpp:11
madara::expression::VariableMultiplyNode::array_
CompositeArrayReference * array_
variable index holder
Definition:
VariableMultiplyNode.h:60
madara::expression::VariableMultiplyNode::value_
madara::knowledge::KnowledgeRecord value_
amount to increment by. Note that this can also do decrement.
Definition:
VariableMultiplyNode.h:63
madara::expression::VariableNode
Defines a terminal node of that references the current value stored in a variable.
Definition:
VariableNode.h:29
madara::expression::Visitor
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition:
Visitor.h:93
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
Copyright(c) 2020 Galois.
Definition:
AggregateFilter.h:31
include
madara
expression
VariableMultiplyNode.h
Generated on Sat Jan 20 2024 00:40:26 for MADARA by
1.9.1