AuboStudio SDK  0.6.3
variable.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_VARIABLE_H
2#define AUBO_SCOPE_VARIABLE_H
3
4#include <string>
6
7namespace arcs {
8namespace aubo_scope {
10
11/**
12 * @ingroup ApplicationApi
13 * \chinese
14 * 变量接口
15 * 表示 AuboScope 中的变量。变量可用于在程序中存储和传递数据。
16 * \endchinese
17 * \english
18 * Variable
19 * Represents a variable in AuboScope. Variables can be used to store and pass
20 * data in programs.
21 * \endenglish
22 */
23
25{
26public:
29 virtual ~Variable();
30
31 /**
32 * The variable type used to determine which type of variable this instance
33 * is.
34 */
35 enum Type : int
36 {
37
38 /**
39 * <p>
40 * GLOBAL means that the variable is available everywhere in a program.
41 * </p>
42 *
43 * This variable instance can be cast to {@link GlobalVariable}.
44 */
46
47 /**
48 * <p>
49 * VALUE_PERSISTED means that the variable is stored with the
50 * installation. These variables are defined in the installation and
51 * will retain their values even when a robot is turned off and on.
52 * </p>
53 *
54 * This variable instance can be cast to {@link ValuePersistedVariable}.
55 */
57
58 /**
59 * <p>
60 * FEATURE means that a Feature is marked as a variable. The variable is
61 * defined in the installation and will exist even when a robot is
62 * turned off and on.
63 * </p>
64 *
65 * This variable instance can be cast to {@link FeatureVariable}.
66 */
68 };
69
70 /**
71 * @ingroup Variable
72 * \chinese
73 * 获取变量类型
74 * @return 变量类型枚举。
75 * \endchinese
76 * \english
77 * Returns the type of variable.
78 * @return the type of variable.
79 * \endenglish
80 */
82
83 /**
84 * @ingroup Variable
85 * \chinese
86 * 获取变量显示名称。注意:变量可随时被重命名。
87 * @return 变量显示名称。
88 * \endchinese
89 * \english
90 * Note: The variable can be renamed at any time.
91 * @return the display name of the variable.
92 * \endenglish
93 */
94 std::string getDisplayName();
95
96 /**
97 * @ingroup Variable
98 * \chinese
99 * 判断是否引用相同的内部变量
100 * @return 如果对象引用相同的内部变量返回true。
101 * \endchinese
102 * \english
103 * Checks if the object references the same internal Variable.
104 * @return true if object references the same internal Variable.
105 * \endenglish
106 */
107 bool equals(VariablePtr object);
108
109 /**
110 * @ingroup Variable
111 * \chinese
112 * 获取哈希码
113 * @return 此对象的哈希码。
114 * \endchinese
115 * \english
116 * Returns the hash code for this object.
117 * @return hashCode for this object.
118 * \endenglish
119 */
120 size_t hashCode();
121
122 /**
123 * @ingroup Variable
124 * \chinese
125 * 获取变量的字符串表示
126 * @return 变量的字符串表示。
127 * \endchinese
128 * \english
129 * Returns a string representation of the variable.
130 * @return a string representation of the variable.
131 * \endenglish
132 */
133 std::string toString();
134
135protected:
137
138private:
139 friend class DataSwitch;
140 void *d_{ nullptr };
141};
142
143} // namespace aubo_scope
144} // namespace arcs
145#endif // AUBO_SCOPE_VARIABLE_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...
\chinese 变量接口 表示 AuboScope 中的变量。变量可用于在程序中存储和传递数据。 \endchinese \english Variable Represents a variable...
Type getType()
\chinese 获取变量类型
Type
The variable type used to determine which type of variable this instance is.
std::string toString()
\chinese 获取变量的字符串表示
std::string getDisplayName()
\chinese 获取变量显示名称。注意:变量可随时被重命名。
size_t hashCode()
\chinese 获取哈希码
bool equals(VariablePtr object)
\chinese 判断是否引用相同的内部变量