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