AuboStudio SDK 0.6.3

loop_node.h
浏览该文件的文档.
1 #ifndef AUBO_SCOPE_LOOP_NODE_H
2 #define AUBO_SCOPE_LOOP_NODE_H
3
4 #include <aubo_caps/domain/program/nodes/program_node.h>
5 #include <aubo_caps/domain/value/expression/expression.h>
6 #include <aubo_caps/domain/variable/variable.h>
7
8 namespace arcs {
9 namespace aubo_scope {
10 ARCS_CLASS_FORWARD(LoopNode);
11
12 class ARCS_ABI_EXPORT LoopNode : public ProgramNode
13 {
14 public:
15 /**
16 * The configuration type used to determine which type of configuration this
17 * instance is.
18 */
19 enum ConfigType
20 {
21
22 /**
23 * <p>
24 * Looping infinitely has been selected.
25 * </p>
26 *
27 * The config instance can be cast to {@link AlwaysLoopNodeConfig}
28 */
29 ALWAYS,
30
31 /**
32 * <p>
33 * Looping a certain number of times has been selected.
34 * </p>
35 *
36 * The config instance can be cast to {@link CounterLoopNodeConfig}
37 */
38 COUNTER,
39
40 /**
41 * <p>
42 * Looping as long as the evaluation of an expression is true has been
43 * selected.
44 * </p>
45 *
46 * The config instance can be cast to {@link ExpressionLoopNodeConfig}
47 */
48 EXPRESSION
49 };
50
51 LoopNode(LoopNode &f);
52 LoopNode(LoopNode &&f);
53 virtual ~LoopNode();
54
55 /**
56 * This method returns the type of configuration. Cast this instance
57 * appropriately to have access to specific getters.
58 *
59 * @return the type of this config.
60 */
61 ConfigType getConfigType();
62 void setConfigType(ConfigType type);
63
64 /**
65 * Creates a loop counter configuration.
66 *
67 * @param loopCount the number of iterations through the loop node.
68 * @param errorHandler error handler for handling validation. If using
69 * {@link ErrorHandler#AUTO_CORRECT} this will clamp the value to the
70 * nearest valid loop count value.
71 * @return the configuration.
72 */
73 void setLoopCount(int loop_count);
74 int getLoopCount();
75
76 /**
77 * Create a loop expression configuration.
78 *
79 * @param expression the expression whose evaluation must be true to
80 * continue looping, not <code>null</code>.
81 * @param evaluateContinuously if <code>true</code> the expression will be
82 * evaluated continuously during the looping (i.e. the loop can be
83 * interrupted anytime during its execution), otherwise <code>false</code>
84 * and the expression will be evaluated once per loop iteration.
85 * @return the configuration.
86 */
87 void setExpression(ExpressionPtr expression);
88 ExpressionPtr getExpression();
89
90 /**
91 *
92 * @return <code>true</code> if the expression will be evaluated
93 * continuously during the looping (i.e. the loop can be interrupted anytime
94 * during its execution), otherwise <code>false</code> and the expression
95 * will be evaluated once per loop iteration.
96 */
97 bool isEvaluateContinously();
98 void setEvaluateContinously(bool cont);
99
100 /**
101 *
102 * @return the variable for storing the loop count
103 */
104 void setLoopCountVariable(VariablePtr var);
105 VariablePtr getLoopCountVariable();
106
107 private:
108 friend class DataSwitch;
109 LoopNode();
110 void *d_{ nullptr };
111 };
112
113 } // namespace aubo_scope
114 } // namespace arcs
115 #endif // AUBO_SCOPE_LOOP_NODE_H
ARCS_ABI_EXPORT
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16
arcs::aubo_scope::LoopNode
Definition: loop_node.h:13
arcs::aubo_scope::LoopNode::getLoopCountVariable
VariablePtr getLoopCountVariable()
arcs::aubo_scope::LoopNode::getLoopCount
int getLoopCount()
arcs::aubo_scope::LoopNode::setLoopCount
void setLoopCount(int loop_count)
Creates a loop counter configuration.
arcs::aubo_scope::LoopNode::setConfigType
void setConfigType(ConfigType type)
arcs::aubo_scope::LoopNode::getConfigType
ConfigType getConfigType()
This method returns the type of configuration.
arcs::aubo_scope::LoopNode::setExpression
void setExpression(ExpressionPtr expression)
Create a loop expression configuration.
arcs::aubo_scope::LoopNode::setLoopCountVariable
void setLoopCountVariable(VariablePtr var)
arcs::aubo_scope::LoopNode::isEvaluateContinously
bool isEvaluateContinously()
arcs::aubo_scope::LoopNode::LoopNode
LoopNode(LoopNode &f)
arcs::aubo_scope::LoopNode::getExpression
ExpressionPtr getExpression()
arcs::aubo_scope::LoopNode::LoopNode
LoopNode()
arcs::aubo_scope::LoopNode::~LoopNode
virtual ~LoopNode()
arcs::aubo_scope::LoopNode::ConfigType
ConfigType
The configuration type used to determine which type of configuration this instance is.
Definition: loop_node.h:20
arcs::aubo_scope::LoopNode::ALWAYS
@ ALWAYS
Definition: loop_node.h:29
arcs::aubo_scope::LoopNode::COUNTER
@ COUNTER
Definition: loop_node.h:38
arcs::aubo_scope::LoopNode::setEvaluateContinously
void setEvaluateContinously(bool cont)
arcs::aubo_scope::LoopNode::LoopNode
LoopNode(LoopNode &&f)
arcs::aubo_scope::ProgramNode
Definition: program_node.h:19
expression.h
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs
Definition: contribution_provider.h:7
program_node.h
variable.h