MADARA
3.4.1
CompositeForLoop.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef _MADARA_COMPOSITE_FOR_LOOP_H_
3
#define _MADARA_COMPOSITE_FOR_LOOP_H_
4
5
#ifndef _MADARA_NO_KARL_
6
7
#include "
madara/expression/ComponentNode.h
"
8
#include "
madara/knowledge/ThreadSafeContext.h
"
9
#include "
madara/knowledge/Functions.h
"
10
#include "
madara/knowledge/KnowledgeRecord.h
"
11
12
namespace
madara
13
{
14
namespace
expression
15
{
16
class
ComponentNode;
17
class
Visitor;
18
23
class
CompositeForLoop
:
public
ComponentNode
24
{
25
public
:
34
CompositeForLoop
(
ComponentNode
* precondition,
ComponentNode
* condition,
35
ComponentNode
* postcondition,
ComponentNode
* body,
36
madara::knowledge::ThreadSafeContext
& context);
37
41
virtual
~CompositeForLoop
(
void
);
42
47
virtual
madara::knowledge::KnowledgeRecord
item
(
void
)
const
;
48
54
virtual
madara::knowledge::KnowledgeRecord
prune
(
bool
& can_change);
55
61
virtual
madara::knowledge::KnowledgeRecord
evaluate
(
62
const
madara::knowledge::KnowledgeUpdateSettings
& settings);
63
68
virtual
void
accept
(
Visitor
& visitor)
const
;
69
70
private
:
71
// variables context
72
// madara::knowledge::ThreadSafeContext & context_;
73
74
// the loop precondition (what happens before the loop)
75
ComponentNode
*
precondition_
;
76
77
// the loop condition (what must be true to continue looping)
78
ComponentNode
*
condition_
;
79
80
// the postcondition (what happens after a loop)
81
ComponentNode
*
postcondition_
;
82
83
// the body (what happens after a condition is true--the loop contents)
84
ComponentNode
*
body_
;
85
86
// function pointer
87
// madara::knowledge::Function * function_;
88
};
89
}
90
}
91
92
#endif
// _MADARA_NO_KARL_
93
94
#endif
/* _MADARA_COMPOSITE_FOR_LOOP_H_ */
ComponentNode.h
Functions.h
KnowledgeRecord.h
ThreadSafeContext.h
madara::expression::ComponentNode
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition:
ComponentNode.h:37
madara::expression::CompositeForLoop
A composite node that iterates until a condition is met.
Definition:
CompositeForLoop.h:24
madara::expression::CompositeForLoop::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Definition:
CompositeForLoop.cpp:44
madara::expression::CompositeForLoop::CompositeForLoop
CompositeForLoop(ComponentNode *precondition, ComponentNode *condition, ComponentNode *postcondition, ComponentNode *body, madara::knowledge::ThreadSafeContext &context)
Constructor.
Definition:
CompositeForLoop.cpp:18
madara::expression::CompositeForLoop::condition_
ComponentNode * condition_
Definition:
CompositeForLoop.h:78
madara::expression::CompositeForLoop::precondition_
ComponentNode * precondition_
Definition:
CompositeForLoop.h:75
madara::expression::CompositeForLoop::accept
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Definition:
CompositeForLoop.cpp:90
madara::expression::CompositeForLoop::~CompositeForLoop
virtual ~CompositeForLoop(void)
Destructor.
Definition:
CompositeForLoop.cpp:31
madara::expression::CompositeForLoop::postcondition_
ComponentNode * postcondition_
Definition:
CompositeForLoop.h:81
madara::expression::CompositeForLoop::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
Definition:
CompositeForLoop.cpp:33
madara::expression::CompositeForLoop::body_
ComponentNode * body_
Definition:
CompositeForLoop.h:84
madara::expression::CompositeForLoop::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Definition:
CompositeForLoop.cpp:59
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
CompositeForLoop.h
Generated on Sat Jan 20 2024 00:40:26 for MADARA by
1.9.1