AuboCaps  0.6.0
variable_factory.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_VARIABLE_FACTORY_H
2 #define AUBO_SCOPE_VARIABLE_FACTORY_H
3 
7 
8 namespace arcs {
9 namespace aubo_scope {
10 ARCS_CLASS_FORWARD(VariableFactory);
11 
12 /**
13  * <p>
14  * This interface supplies methods to create variable objects.
15  * </p>
16  *
17  * <b>NOTE:</b> Only use this functionality in a AuboCap program node (not
18  * relevant for an installation node).
19  */
21 {
22 public:
25  ~VariableFactory();
26 
27  /**
28  * <p>
29  * Creates a global variable. Registering the variable in AuboScope (by
30  * storing it in a {@link DataModel} instance or using it for the
31  * configuration of a built-in AuboScope program node) will make it
32  * accessible to all program nodes.
33  * </p>
34  *
35  * <b>NOTE:</b> Only use this method in a AuboCap program node (not relevant
36  * for an installation node).
37  *
38  * @param suggested_name Suggested name of the variable. Valid names must
39  * match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters.
40  *
41  * @return GlobalVariable.
42  * @throws VariableException In case of an illegal name.
43  */
44  GlobalVariablePtr createGlobalVariable(const std::string &suggested_name);
45 
46  /**
47  * <p>
48  * Creates a global variable.
49  * </p>
50  *
51  * <p>
52  * Registering the variable in AuboScope (by storing it in a {@link
53  * DataModel} instance or using it for the configuration of a built-in
54  * AuboScope program node) will make it accessible to all program nodes.
55  * </p>
56  *
57  * <p>
58  * Setting an initial value will make it possible to read from the variable
59  * immediately without having to assign a value to it first. This can be
60  * useful in various constructs which requires an initial value, e.g. 'var_1
61  * = var_1 + 1' or 'if (var_2 =):'.
62  * </p>
63  *
64  * <b>NOTE:</b> Only use this method in a AuboCap program node (not relevant
65  * for an installation node).
66  *
67  * @param suggested_name Suggested name of the variable. Valid names must
68  * match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters.
69  * @param initialValue The expression that will be evaluated in order to
70  * initialize the value of the variable. This value is assigned before the
71  * actual program runs.
72  *
73  * @return GlobalVariable.
74  * @throws VariableException In case of an illegal name.
75  */
76  GlobalVariablePtr createGlobalVariable(const std::string &suggested_name,
77  ExpressionPtr initialValue);
78 
79  /**
80  * <p>
81  * Creates a feature variable.
82  * </p>
83  *
84  * <p>
85  * Registering the variable in AuboScope (by storing it in a {@link
86  * DataModel} instance or using it for the configuration of a built-in
87  * AuboScope program node) will make it accessible to all program nodes.
88  * </p>
89  *
90  * <p>
91  * Setting an initial value will make it possible to read from the variable
92  * immediately without having to assign a value to it first. This can be
93  * useful in various constructs which requires an initial valu.
94  * </p>
95  *
96  * <b>NOTE:</b> Only use this method in a AuboCap program node (not relevant
97  * for an installation node).
98  *
99  * @param suggested_name Suggested name of the variable. Valid names must
100  * match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters.
101  * @param initialValue The expression that will be evaluated in order to
102  * initialize the value of the variable. This value is assigned before the
103  * actual program runs.
104  *
105  * @return FeatureVariable.
106  * @throws VariableException In case of an illegal name.
107  */
108  FeatureVariablePtr createFeatureVariable(const std::string &suggested_name,
109  const std::vector<double> &pose);
110 
111 private:
112  friend class DataSwitch;
113  VariableFactory();
114  void *d_{ nullptr };
115 };
116 
117 } // namespace aubo_scope
118 } // namespace arcs
119 #endif // AUBO_SCOPE_VARIABLE_FACTORY_H
ARCS_CLASS_FORWARD(GripForceCapability)
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16