MADARA
3.1.8
Main Page
Namespaces
Classes
Files
File List
File Members
VariableDecrementNode.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef _MADARA_VARIABLE_DECREMENT_NODE_H_
3
#define _MADARA_VARIABLE_DECREMENT_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
VariableDecrementNode
:
public
ComponentNode
29
{
30
public
:
32
VariableDecrementNode
(
ComponentNode
* lhs,
33
madara::knowledge::KnowledgeRecord
value,
34
ComponentNode
* rhs,
35
madara::knowledge::ThreadSafeContext
&context);
36
38
virtual
~VariableDecrementNode
(
void
);
39
41
virtual
madara::knowledge::KnowledgeRecord
item
(
void
)
const
;
42
46
virtual
madara::knowledge::KnowledgeRecord
prune
(
bool
& can_change);
47
50
virtual
madara::knowledge::KnowledgeRecord
evaluate
(
51
const
madara::knowledge::KnowledgeUpdateSettings
& settings);
52
54
virtual
void
accept
(
Visitor
&visitor)
const
;
55
56
private
:
58
VariableNode
*
var_
;
59
61
CompositeArrayReference
*
array_
;
62
64
madara::knowledge::KnowledgeRecord
value_
;
65
67
ComponentNode
*
rhs_
;
68
69
madara::knowledge::ThreadSafeContext
&
context_
;
70
};
71
}
72
}
73
74
#endif // _MADARA_NO_KARL_
75
76
#endif
/* _MADARA_VARIABLE_DECREMENT_NODE_H_ */
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:60
KnowledgeRecord.h
madara::expression::VariableNode
Defines a terminal node of that references the current value stored in a variable.
Definition:
VariableNode.h:28
madara::expression::VariableDecrementNode::~VariableDecrementNode
virtual ~VariableDecrementNode(void)
Dtor.
Definition:
VariableDecrementNode.cpp:25
madara::expression::VariableDecrementNode::rhs_
ComponentNode * rhs_
holds a right hand side argument if it is not value_
Definition:
VariableDecrementNode.h:67
madara::expression::VariableDecrementNode
Composite node that subtracts a variable by some right hand side.
Definition:
VariableDecrementNode.h:28
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::VariableDecrementNode::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
Definition:
VariableDecrementNode.cpp:95
madara::expression::VariableDecrementNode::value_
madara::knowledge::KnowledgeRecord value_
amount to increment by. Note that this can also do decrement.
Definition:
VariableDecrementNode.h:64
madara::expression::VariableDecrementNode::context_
madara::knowledge::ThreadSafeContext & context_
Definition:
VariableDecrementNode.h:69
madara::expression::VariableDecrementNode::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
Definition:
VariableDecrementNode.cpp:38
CompositeArrayReference.h
madara::expression::ComponentNode
An abstract base class defines a simple abstract implementation of an expression tree node...
Definition:
ComponentNode.h:35
madara::expression::Visitor
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition:
Visitor.h:90
madara::expression::VariableDecrementNode::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
Definition:
VariableDecrementNode.cpp:54
madara::expression::VariableDecrementNode::array_
CompositeArrayReference * array_
variable index holder
Definition:
VariableDecrementNode.h:61
madara::expression::VariableDecrementNode::accept
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
Definition:
VariableDecrementNode.cpp:32
madara::knowledge::KnowledgeUpdateSettings
Settings for applying knowledge updates.
Definition:
KnowledgeUpdateSettings.h:23
VariableNode.h
madara
Copyright (c) 2015 Carnegie Mellon University.
Definition:
AggregateFilter.h:30
madara::expression::VariableDecrementNode::VariableDecrementNode
VariableDecrementNode(ComponentNode *lhs, madara::knowledge::KnowledgeRecord value, ComponentNode *rhs, madara::knowledge::ThreadSafeContext &context)
Ctor.
Definition:
VariableDecrementNode.cpp:12
madara::expression::VariableDecrementNode::var_
VariableNode * var_
variable holder
Definition:
VariableDecrementNode.h:58
ComponentNode.h
madara::expression::CompositeArrayReference
Defines a terminal node of that references the current value stored in a variable.
Definition:
CompositeArrayReference.h:28
include
madara
expression
VariableDecrementNode.h
Generated on Wed May 9 2018 18:17:14 for MADARA by
1.8.11