AuboStudio SDK  0.6.3
loop_node.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_LOOP_NODE_H
2#define AUBO_SCOPE_LOOP_NODE_H
3
7
8namespace arcs {
9namespace aubo_scope {
11
13{
14public:
15 /**
16 * The configuration type used to determine which type of configuration this
17 * instance is.
18 */
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 */
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 */
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 */
49 };
50
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 */
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);
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 */
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
107private:
108 friend class DataSwitch;
110 void *d_{ nullptr };
111};
112
113} // namespace aubo_scope
114} // namespace arcs
115#endif // AUBO_SCOPE_LOOP_NODE_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
VariablePtr getLoopCountVariable()
void setLoopCount(int loop_count)
Creates a loop counter configuration.
void setConfigType(ConfigType type)
ConfigType getConfigType()
This method returns the type of configuration.
void setExpression(ExpressionPtr expression)
Create a loop expression configuration.
void setLoopCountVariable(VariablePtr var)
ExpressionPtr getExpression()
ConfigType
The configuration type used to determine which type of configuration this instance is.
void setEvaluateContinously(bool cont)