MADARA
3.1.8
Main Page
Namespaces
Classes
Files
File List
File Members
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
(
35
ComponentNode
* precondition,
36
ComponentNode
* condition,
37
ComponentNode
* postcondition,
38
ComponentNode
* body,
39
madara::knowledge::ThreadSafeContext
& context);
40
44
virtual
~CompositeForLoop
(
void
);
45
50
virtual
madara::knowledge::KnowledgeRecord
item
(
void
)
const
;
51
57
virtual
madara::knowledge::KnowledgeRecord
prune
(
bool
& can_change);
58
64
virtual
madara::knowledge::KnowledgeRecord
evaluate
(
65
const
madara::knowledge::KnowledgeUpdateSettings
& settings);
66
71
virtual
void
accept
(
Visitor
&visitor)
const
;
72
73
private
:
74
75
// variables context
76
madara::knowledge::ThreadSafeContext
&
context_
;
77
78
// the loop precondition (what happens before the loop)
79
ComponentNode
*
precondition_
;
80
81
// the loop condition (what must be true to continue looping)
82
ComponentNode
*
condition_
;
83
84
// the postcondition (what happens after a loop)
85
ComponentNode
*
postcondition_
;
86
87
// the body (what happens after a condition is true--the loop contents)
88
ComponentNode
*
body_
;
89
90
// function pointer
91
madara::knowledge::Function
*
function_
;
92
};
93
}
94
}
95
96
#endif // _MADARA_NO_KARL_
97
98
#endif
/* _MADARA_COMPOSITE_FOR_LOOP_H_ */
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:60
Functions.h
KnowledgeRecord.h
madara::knowledge::Function
This class stores a function definition.
Definition:
Functions.h:44
madara::expression::CompositeForLoop::prune
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Definition:
CompositeForLoop.cpp:50
madara::expression::CompositeForLoop
A composite node that iterates until a condition is met.
Definition:
CompositeForLoop.h:23
madara::expression::CompositeForLoop::item
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
Definition:
CompositeForLoop.cpp:39
madara::expression::CompositeForLoop::accept
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Definition:
CompositeForLoop.cpp:96
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::CompositeForLoop::precondition_
ComponentNode * precondition_
Definition:
CompositeForLoop.h:79
madara::expression::CompositeForLoop::~CompositeForLoop
virtual ~CompositeForLoop(void)
Destructor.
Definition:
CompositeForLoop.cpp:34
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::CompositeForLoop::context_
madara::knowledge::ThreadSafeContext & context_
Definition:
CompositeForLoop.h:76
madara::expression::CompositeForLoop::evaluate
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Definition:
CompositeForLoop.cpp:64
madara::expression::CompositeForLoop::condition_
ComponentNode * condition_
Definition:
CompositeForLoop.h:82
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::CompositeForLoop::function_
madara::knowledge::Function * function_
Definition:
CompositeForLoop.h:91
madara::expression::CompositeForLoop::CompositeForLoop
CompositeForLoop(ComponentNode *precondition, ComponentNode *condition, ComponentNode *postcondition, ComponentNode *body, madara::knowledge::ThreadSafeContext &context)
Constructor.
Definition:
CompositeForLoop.cpp:20
madara::expression::CompositeForLoop::postcondition_
ComponentNode * postcondition_
Definition:
CompositeForLoop.h:85
ComponentNode.h
madara::expression::CompositeForLoop::body_
ComponentNode * body_
Definition:
CompositeForLoop.h:88
include
madara
expression
CompositeForLoop.h
Generated on Wed May 9 2018 18:17:13 for MADARA by
1.8.11