AuboStudio SDK  0.6.3
data_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_DATA_MODEL_H
2#define AUBO_SCOPE_DATA_MODEL_H
3
4#include <stdint.h>
5#include <string>
6#include <vector>
7#include <set>
8
16
17namespace arcs {
18namespace aubo_scope {
20
21/**
22 * \chinese
23 * 数据模型
24 * 此接口用于存储和管理表示当前配置的数据,例如 {@link ProgramNodeContribution}
25 * 或 {@link InstallationNodeContribution} 的配置。提供了在字典中添加、删除、获取
26 * 和修改值的方法。
27 *
28 * 为已使用的键设置新值将覆盖当前值。无论值的类型如何都会发生(例如,在键
29 * <i>myBool</i> 下存储值 <code>true</code>,之后又在同一键下存储一个
30 * <code>Angle</code> 对象,将会用提供的 <code>Angle</code> 对象覆盖
31 * <code>true</code> 值)。
32 *
33 * 每个 AuboCap 安装画面都有一个底层的 <code>DataModel</code> 对象。该对象随每个
34 * AuboScope 安装一起保存和加载。
35 *
36 * 同样,每个贡献的程序节点实例都有一个底层的 <code>DataModel</code>
37 * 对象。该对象随节点所在程序一起保存和加载。基于 HTML 的程序节点贡献中,对
38 * <code>DataModel</code> 对象的所有修改都支持撤销/重做操作。基于 Qt 的 AuboStudio
39 * 插件必须使用 {@link UndoRedoManager} 将更改记录到撤销/重做栈中。
40 *
41 * 检索对象时,键和对象类型都必须与之前存储的匹配。这意味着如果使用键
42 * <i>myAngle</i> 存储了一个 <code>TCP</code> 对象,然后尝试使用键 <i>myAngle</i>
43 * 通过 {@link #get(std::string key, Angle default_value)} 检索它,将不会返回存储
44 * 的值,因为类型不匹配。相反,将返回提供的 <code>default_value</code>。
45 * \endchinese
46 * \english
47 * DataModel
48 * This interface is used for storing and managing data that represents the
49 * current configuration of, e.g. a
50 * {@link ProgramNodeContribution} or {@link InstallationNodeContribution}.
51 * Methods for adding, removing, retrieving and changing values in a dictionary
52 * are provided.
53 *
54 * Setting a new value for a key already in use, will overwrite the current
55 * value with the new value. This happens regardless of the type of value (e.g.
56 * storing the value <code>true</code> under the key <i>myBool</i>
57 * and afterwards storing an <code>Angle</code> object under the same key will
58 * overwrite the value <code>true</code> with the provided <code>Angle</code>
59 * object).
60 *
61 * A auboCap installation screen has an underlying <code>DataModel</code>
62 * object. That object is saved and loaded along with each AuboScope
63 * installation.
64 *
65 * Similarly, each contributed program node instance has an underlying
66 * <code>DataModel</code> object. That object is saved and loaded along with the
67 * program where the node occurs. Undo/redo actions are supported for all
68 * modifications to the <code>DataModel</code> object in HTML-based program node
69 * contributions. Qt-based aubo_studio plugins must use the {@link
70 * UndoRedoManager} to record the changes on the undo/redo stack.
71 *
72 * When retrieving an object, both key and object type must match what was
73 * previously stored. This means that if a
74 * <code>TCP</code> object was stored using the key <i>myAngle</i>, then
75 * attempting to retrieve it using
76 * {@link #get(std::string key, Angle default_value)} with the key
77 * <i>myAngle</i> will not return the stored value, since the types do not
78 * match. Instead the provided <code>default_value</code> will be returned.
79 * \endenglish
80 *
81 */
83{
84public:
88
89 /**
90 * \chinese
91 * 将<code>bool</code>值赋给指定键。
92 *
93 * @param key 数据模型中的键(不可为<code>null</code>或空<code>std::string</code>)。
94 * @param value 赋给键的值。
95 *
96 * @throws IllegalArgumentException 如果键为<code>null</code>或空<code>std::string</code>。
97 * @throws IllegalStateException 如果在Qt-based AuboCap程序节点中调用时不在
98 * {@link UndoableChanges}范围内(另见{@link UndoRedoManager})。
99 * \endchinese
100 * \english
101 * Assign a <code>bool</code> value to the specified key.
102 *
103 * @param key key in the data model (not <code>null</code> and not an empty
104 * <code>std::string</code>).
105 * @param value value assigned to key.
106 *
107 * @throws IllegalArgumentException if the key is <code>null</code> or an
108 * empty <code>std::string</code>.
109 * @throws IllegalStateException if called from a Qt-based AuboCap
110 * program node outside of an {@link UndoableChanges} scope (see also {@link
111 * UndoRedoManager}).
112 * \endenglish
113 */
114 void set(const std::string &key, bool value);
115
116 /**
117 * \chinese
118 * 获取赋给指定键的<code>bool</code>值。
119 *
120 * @param key 数据模型中的键。
121 * @param default_value 键不存在时返回的值。
122 * @return 赋给键的值。如果不存在,返回default_value。
123 * \endchinese
124 * \english
125 * Get the <code>bool</code> value assigned to the specified key.
126 *
127 * @param key key in the data model.
128 * @param default_value value to be returned, if key does not exist.
129 * @return the value assigned to the key. If not exist, default_value is
130 * returned.
131 * \endenglish
132 */
133 bool get(const std::string &key, bool default_value) const;
134
135 /**
136 * \chinese
137 * 将<code>int</code>值赋给指定键。
138 *
139 * @param key 数据模型中的键。
140 * @param value 赋给键的值。
141 *
142 * @throws IllegalArgumentException 如果键为<code>null</code>或空字符串。
143 * @throws IllegalStateException 如果不在{@link UndoableChanges}范围内调用。
144 * \endchinese
145 * \english
146 * Assign an <code>int</code> value to the specified key.
147 *
148 * @param key key in the data model (not <code>null</code> and not an empty
149 * <code>std::string</code>).
150 * @param value value assigned to key.
151 *
152 * @throws IllegalArgumentException if the key is <code>null</code> or an
153 * empty <code>std::string</code>.
154 * @throws IllegalStateException if called from a Qt-based AuboCap
155 * program node outside of an {@link UndoableChanges} scope (see also {@link
156 * UndoRedoManager}).
157 * \endenglish
158 */
159 void set(const std::string &key, int value);
160
161 /**
162 * \chinese
163 * 获取赋给指定键的<code>int</code>值。
164 *
165 * @param key 数据模型中的键。
166 * @param default_value 键不存在时返回的值。
167 * @return 赋给键的值。
168 * \endchinese
169 * \english
170 * Get the <code>int</code> value assigned to the specified key.
171 *
172 * @param key key in the data model.
173 * @param default_value value to be returned, if key does not exist.
174 * @return the value assigned to the key. If not exist, default_value is
175 * returned.
176 * \endenglish
177 */
178 int get(const std::string &key, int default_value) const;
179
180 /**
181 * \chinese
182 * 将<code>long</code>值赋给指定键。
183 * \endchinese
184 * \english
185 * Assign a <code>long</code> value to the specified key.
186 *
187 * @param key key in the data model (not <code>null</code> and not an empty
188 * <code>std::string</code>).
189 * @param value value assigned to key.
190 *
191 * @throws IllegalArgumentException if the key is <code>null</code> or an
192 * empty <code>std::string</code>.
193 * @throws IllegalStateException if called from a Qt-based AuboCap
194 * program node outside of an {@link UndoableChanges} scope (see also {@link
195 * UndoRedoManager}).
196 * \endenglish
197 */
198 void set(const std::string &key, long value);
199 void set(const std::string &key, uint64_t value);
200
201 /**
202 * \chinese
203 * 获取赋给指定键的<code>long</code>值。
204 * \endchinese
205 * \english
206 * Get the <code>long</code> value assigned to the specified key.
207 *
208 * @param key key in the data model.
209 * @param default_value value to be returned, if key does not exist.
210 * @return the value assigned to the key. If not exist, default_value is
211 * returned.
212 * \endenglish
213 */
214 long get(const std::string &key, long default_value) const;
215 uint64_t get(const std::string &key, uint64_t default_value) const;
216
217 /**
218 * \chinese
219 * 将<code>float</code>值赋给指定键。
220 * \endchinese
221 * \english
222 * Assign a <code>float</code> value to the specified key.
223 *
224 * @param key key in the data model (not <code>null</code> and not an empty
225 * <code>std::string</code>).
226 * @param value value assigned to key.
227 *
228 * @throws IllegalArgumentException if the key is <code>null</code> or an
229 * empty <code>std::string</code>.
230 * @throws IllegalStateException if called from a Qt-based AuboCap
231 * program node outside of an {@link UndoableChanges} scope (see also {@link
232 * UndoRedoManager}).
233 * \endenglish
234 */
235 void set(const std::string &key, float value);
236
237 /**
238 * \chinese
239 * 获取赋给指定键的<code>float</code>值。
240 * \endchinese
241 * \english
242 * Get the <code>float</code> value assigned to the specified key.
243 *
244 * @param key key in the data model.
245 * @param default_value value to be returned, if key does not exist.
246 * @return the value assigned to the key. If not exist, default_value is
247 * returned.
248 * \endenglish
249 */
250 float get(const std::string &key, float default_value) const;
251
252 /**
253 * \chinese
254 * 将<code>double</code>值赋给指定键。
255 * \endchinese
256 * \english
257 * Assign a <code>double</code> value to the specified key.
258 *
259 * @param key key in the data model (not <code>null</code> and not an empty
260 * <code>std::string</code>).
261 * @param value value assigned to key.
262 *
263 * @throws IllegalArgumentException if the key is <code>null</code> or an
264 * empty <code>std::string</code>.
265 * @throws IllegalStateException if called from a Qt-based AuboCap
266 * program node outside of an {@link UndoableChanges} scope (see also {@link
267 * UndoRedoManager}).
268 * \endenglish
269 */
270 void set(const std::string &key, double value);
271
272 /**
273 * \chinese
274 * 获取赋给指定键的<code>double</code>值。
275 * \endchinese
276 * \english
277 * Get the <code>double</code> value assigned to the specified key.
278 *
279 * @param key key in the data model.
280 * @param default_value value to be returned, if key does not exist.
281 * @return the value assigned to the key. If not exist, default_value is
282 * returned.
283 * \endenglish
284 */
285 double get(const std::string &key, double default_value) const;
286
287 /**
288 * \chinese
289 * 将<code>std::string</code>值赋给指定键。
290 * \endchinese
291 * \english
292 * Assign a <code>std::string</code> value to the specified key.
293 *
294 * @param key key in the data model (not <code>null</code> and not an empty
295 * <code>std::string</code>).
296 * @param value value assigned to key.
297 *
298 * @throws IllegalArgumentException if the key is <code>null</code> or an
299 * empty <code>std::string</code>.
300 * @throws IllegalStateException if called from a Qt-based AuboCap
301 * program node outside of an {@link UndoableChanges} scope (see also {@link
302 * UndoRedoManager}).
303 * \endenglish
304 */
305 void set(const std::string &key, const std::string &value);
306
307 /**
308 * \chinese
309 * 获取赋给指定键的<code>std::string</code>值。
310 * \endchinese
311 * \english
312 * Get the <code>std::string</code> value assigned to the specified key.
313 *
314 * @param key key in the data model.
315 * @param default_value value to be returned, if key does not exist.
316 * @return the value assigned to the key. If not exist, default_value is
317 * returned.
318 * \endenglish
319 */
320 std::string get(const std::string &key,
321 const std::string &default_value) const;
322 /**
323 * \chinese
324 * 将<code>Variable</code>值赋给指定键。
325 * \endchinese
326 * \english
327 * Assign a <code>Variable</code> value to the specified key.
328 *
329 * @param key key in the data model (not <code>null</code> and not an empty
330 * <code>std::string</code>).
331 * @param value value assigned to key.
332 *
333 * @throws IllegalArgumentException if the key is <code>null</code> or an
334 * empty <code>std::string</code>.
335 * @throws IllegalStateException if called from a Qt-based AuboCap
336 * program node outside of an {@link UndoableChanges} scope (see also {@link
337 * UndoRedoManager}).
338 * \endenglish
339 */
340 void set(const std::string &key, VariablePtr value);
341 void set(const std::string &key, ExpressionPtr value);
342 void set(const std::string &key, PayloadPtr value);
343 void set(const std::string &key, IoPtr value);
344 void set(const std::string &key, WaypointPtr value);
345
346 /**
347 * \chinese
348 * 获取赋给指定键的<code>Variable</code>值。
349 * @return 赋给键的值。
350 * \endchinese
351 * \english
352 * Get the <code>Variable</code> value assigned to the specified key.
353 *
354 * @param key key in the data model.
355 * @param default_value value to be returned, if key does not exist.
356 * @return the value assigned to the key. If not exist, default_value is
357 * returned.
358 * \endenglish
359 */
360 VariablePtr get(const std::string &key, VariablePtr default_value) const;
361 ExpressionPtr get(const std::string &key,
362 ExpressionPtr default_value) const;
363 PayloadPtr get(const std::string &key, PayloadPtr default_value) const;
364 IoPtr get(const std::string &key, IoPtr default_value) const;
365 WaypointPtr get(const std::string &key, WaypointPtr default_value) const;
366
367 /**
368 * \chinese
369 * 将<code>bool[]</code>数组赋给指定键。
370 * \endchinese
371 * \english
372 * Assign a <code>bool[]</code> as value to the specified key.
373 * @param key key in the data model (not <code>null</code>) and not an empty
374 * <code>std::string</code>).
375 * @param value value assigned to key.
376 *
377 * @throws IllegalArgumentException if the key is <code>null</code> or an
378 * empty <code>std::string</code>.
379 * @throws IllegalStateException if called from a Qt-based AuboCap
380 * program node outside of an {@link UndoableChanges} scope (see also {@link
381 * UndoRedoManager}).
382 * \endenglish
383 */
384 void set(const std::string &key, const std::vector<bool> &value);
385
386 /**
387 * \chinese
388 * 获取赋给指定键的<code>bool[]</code>数组。
389 * \endchinese
390 * \english
391 * Get the <code>bool[]</code> as value assigned to the specified key.
392 *
393 * @param key key in the data model.
394 * @param default_value value to be returned, if key does not exist.
395 * @return the value assigned to the key. If not exist, default_value is
396 * returned.
397 * \endenglish
398 */
399 std::vector<bool> get(const std::string &key,
400 const std::vector<bool> &default_value) const;
401
402 /**
403 * \chinese
404 * 将<code>int[]</code>数组赋给指定键。
405 * \endchinese
406 * \english
407 * Assign a <code>int[]</code> as value to the specified key.
408 *
409 * @param key key in the data model (not <code>null</code> and not an empty
410 * <code>std::string</code>).
411 * @param value value assigned to key.
412 *
413 * @throws IllegalArgumentException if the key is <code>null</code> or an
414 * empty <code>std::string</code>.
415 * @throws IllegalStateException if called from a Qt-based AuboCap
416 * program node outside of an {@link UndoableChanges} scope (see also {@link
417 * UndoRedoManager}).
418 * \endenglish
419 */
420 void set(const std::string &key, const std::vector<int> &value);
421
422 /**
423 * \chinese
424 * 获取赋给指定键的<code>int[]</code>数组。
425 * \endchinese
426 * \english
427 * Get the <code>int[]</code> as value assigned to the specified key.
428 *
429 * @param key key in the data model.
430 * @param default_value value to be returned, if key does not exist.
431 * @return the value assigned to the key. If not exist, default_value is
432 * returned.
433 * \endenglish
434 */
435 std::vector<int> get(const std::string &key,
436 const std::vector<int> &default_value) const;
437
438 /**
439 * \chinese
440 * 将<code>long[]</code>数组赋给指定键。
441 * \endchinese
442 * \english
443 * Assign a <code>long[]</code> as value to the specified key.
444 *
445 * @param key key in the data model (not <code>null</code> and not an empty
446 * <code>std::string</code>).
447 * @param value value assigned to key.
448 *
449 * @throws IllegalArgumentException if the key is <code>null} or an empty
450 * <code>std::string</code>.
451 * @throws IllegalStateException if called from a Qt-based AuboCap
452 * program node outside of an {@link UndoableChanges} scope (see also {@link
453 * UndoRedoManager}).
454 * \endenglish
455 */
456 void set(const std::string &key, const std::vector<long> &value);
457 void set(const std::string &key, const std::vector<uint64_t> &value);
458
459 /**
460 * \chinese
461 * 获取赋给指定键的<code>long[]</code>数组。
462 * \endchinese
463 * \english
464 * Get the <code>long[]</code> as value assigned to the specified key.
465 *
466 * @param key key in the data model.
467 * @param default_value value to be returned, if key does not exist.
468 * @return the value assigned to the key. If not exist, default_value is
469 * returned.
470 * \endenglish
471 */
472 std::vector<long> get(const std::string &key,
473 const std::vector<long> &default_value) const;
474 std::vector<uint64_t> get(const std::string &key,
475 const std::vector<uint64_t> &default_value) const;
476
477 /**
478 * \chinese
479 * 将<code>float[]</code>数组赋给指定键。
480 * \endchinese
481 * \english
482 * Assign a <code>float[]</code> as value to the specified key.
483 *
484 * @param key key in the data model (not <code>null</code> and not an empty
485 * <code>std::string</code>).
486 * @param value value assigned to key.
487 *
488 * @throws IllegalArgumentException if the key is <code>null</code> or an
489 * empty <code>std::string</code>.
490 * @throws IllegalStateException if called from a Qt-based AuboCap
491 * program node outside of an {@link UndoableChanges} scope (see also {@link
492 * UndoRedoManager}).
493 * \endenglish
494 */
495 void set(const std::string &key, const std::vector<float> &value);
496
497 /**
498 * \chinese
499 * 获取赋给指定键的<code>float[]</code>数组。
500 * \endchinese
501 * \english
502 * Get the <code>float[]</code> as value assigned to the specified key.
503 *
504 * @param key key in the data model.
505 * @param default_value value to be returned, if key does not exist.
506 * @return the value assigned to the key. If not exist, default_value is
507 * returned.
508 * \endenglish
509 */
510 std::vector<float> get(const std::string &key,
511 const std::vector<float> &default_value) const;
512
513 /**
514 * \chinese
515 * 将<code>double[]</code>数组赋给指定键。
516 * \endchinese
517 * \english
518 * Assign a <code>double[]</code> as value to the specified key.
519 *
520 * @param key key in the data model (not <code>null</code> and not an empty
521 * <code>std::string</code>).
522 * @param value value assigned to key.
523 *
524 * @throws IllegalArgumentException if the key is <code>null</code> or an
525 * empty <code>std::string</code>.
526 * @throws IllegalStateException if called from a Qt-based AuboCap
527 * program node outside of an {@link UndoableChanges} scope (see also {@link
528 * UndoRedoManager}).
529 * \endenglish
530 */
531 void set(const std::string &key, const std::vector<double> &value);
532
533 /**
534 * \chinese
535 * 获取赋给指定键的<code>double[]</code>数组。
536 * \endchinese
537 * \english
538 * Get the <code>double[]</code> as value assigned to the specified key.
539 *
540 * @param key key in the data model.
541 * @param default_value value to be returned, if key does not exist.
542 * @return the value assigned to the key. If not exist, default_value is
543 * returned.
544 * \endenglish
545 */
546 std::vector<double> get(const std::string &key,
547 const std::vector<double> &default_value) const;
548
549 /**
550 * \chinese
551 * 将<code>std::string[]</code>数组赋给指定键。
552 * \endchinese
553 * \english
554 * Assign a <code>std::string[]</code> as value to the specified key.
555 *
556 * @param key key in the data model (not <code>null</code> and not an empty
557 * <code>std::string</code>).
558 * @param value value assigned to key.
559 *
560 * @throws IllegalArgumentException if the key is <code>null</code> or an
561 * empty <code>std::string</code>.
562 * @throws IllegalStateException if called from a Qt-based AuboCap
563 * program node outside of an {@link UndoableChanges} scope (see also {@link
564 * UndoRedoManager}).
565 * \endenglish
566 */
567 void set(const std::string &key, const std::vector<std::string> &value);
568
569 /**
570 * \chinese
571 * 获取赋给指定键的<code>std::string[]</code>数组。
572 * \endchinese
573 * \english
574 * Get the <code>std::string[]</code> as value assigned to the specified
575 * key.
576 *
577 * @param key key in the data model.
578 * @param default_value value to be returned, if key does not exist.
579 * @return the value assigned to the key. If not exist, default_value is
580 * returned.
581 * \endenglish
582 */
583 std::vector<std::string> get(
584 const std::string &key,
585 const std::vector<std::string> &default_value) const;
586
587 /**
588 * \chinese
589 * 将<code>TCP</code>值赋给指定键。
590 * \endchinese
591 * \english
592 * Assign a <code>TCP</code> value to the specified key.
593 *
594 * @param key key in the data model (not <code>null</code> and not an empty
595 * <code>std::string</code>).
596 * @param value value assigned to key.
597 *
598 * @throws IllegalArgumentException if the key is <code>null</code> or an
599 * empty <code>std::string</code>.
600 * @throws IllegalStateException if called from a Qt-based AuboCap
601 * program node outside of an {@link UndoableChanges} scope (see also {@link
602 * UndoRedoManager}).
603 * \endenglish
604 */
605 void set(const std::string &key, TCPPtr value);
606
607 /**
608 * \chinese
609 * 获取赋给指定键的<code>TCP</code>值。
610 * \endchinese
611 * \english
612 * Get the <code>TCP value assigned to the specified key.
613 *
614 * @param key key in the data model.
615 * @param default_value value to be returned, if key does not exist.
616 * @return the value assigned to the key. If not exist, default_value is
617 * returned.
618 * \endenglish
619 */
620 TCPPtr get(const std::string &key, TCPPtr default_value) const;
621
622 /**
623 * \chinese
624 * 将<code>Feature</code>值赋给指定键。
625 * \endchinese
626 * \english
627 * Assign a <code>Feature</code> value to the specified key.
628 *
629 * @param key key in the data model (not <code>null</code> and not an empty
630 * <code>std::string</code>).
631 * @param value value assigned to key.
632 *
633 * @throws IllegalArgumentException if the key is <code>null</code> or an
634 * empty <code>std::string</code>.
635 * @throws IllegalStateException if called from a Qt-based AuboCap
636 * program node outside of an {@link UndoableChanges} scope (see also {@link
637 * UndoRedoManager}).
638 * \endenglish
639 */
640 void set(const std::string &key, FeaturePtr value);
641
642 /**
643 * \chinese
644 * 获取赋给指定键的<code>Feature</code>值。
645 * \endchinese
646 * \english
647 * Get the <code>Feature</code> value assigned to the specified key.
648 *
649 * @param key key in the data model.
650 * @param default_value value to be returned, if key does not exist.
651 * @return the value assigned to the key. If not exist, default_value is
652 * returned.
653 * \endenglish
654 */
655 FeaturePtr get(const std::string &key, FeaturePtr default_value) const;
656
657 /**
658 * \chinese
659 * 获取数据模型中所有键的集合。
660 * @return 键的集合。
661 * \endchinese
662 * \english
663 * Get a set of all the keys in the data model.
664 *
665 * @return A Set of keys.
666 * \endenglish
667 */
668 std::set<std::string> getKeys() const;
669
670 /**
671 * \chinese
672 * 检查数据模型中是否存在指定键。
673 * @param key 数据模型中的键。
674 * @return 如果键存在返回<code>true</code>,否则返回<code>false</code>。
675 * \endchinese
676 * \english
677 * Check if a key is present in the data model.
678 *
679 * @param key key in the data model (not <code>null</code> and not an empty
680 * <code>std::string</code>).
681 * @return <code>true</code>, if key exist, otherwise <code>false</code>.
682 * \endenglish
683 */
684 bool isSet(const std::string &key) const;
685
686 /**
687 * \chinese
688 * 从数据模型中移除一个键值对。
689 * @param key 数据模型中的键。
690 * @return 成功返回<code>true</code>,否则返回<code>false</code>。
691 * @throws IllegalStateException 如果在Qt-based AuboCap程序节点中调用时不在
692 * {@link UndoableChanges}范围内。
693 * \endchinese
694 * \english
695 * Remove a key-value pair from the data model.
696 *
697 * @param key key in the data model (not <code>null</code> and not an empty
698 * <code>std::string</code>).
699 * @return <code>true</code>, if succeed, otherwise <code>false</code>.
700 * @throws IllegalStateException if called from a Qt-based AuboCap
701 * program node outside of an {@link UndoableChanges} scope (see also {@link
702 * UndoRedoManager}).
703 * \endenglish
704 */
705 bool remove(const std::string &key);
706
707private:
708 friend class DataSwitch;
710 void *d_{ nullptr };
711};
712
713} // namespace aubo_scope
714} // namespace arcs
715
716#endif
#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 数据模型 此接口用于存储和管理表示当前配置的数据,例如 ProgramNodeContribution 或 InstallationNodeContribution 的配置。提供了在字...
std::vector< std::string > get(const std::string &key, const std::vector< std::string > &default_value) const
\chinese 获取赋给指定键的std::string[]数组。 \endchinese \english Get the std::string[] as value assigned to the...
bool isSet(const std::string &key) const
\chinese 检查数据模型中是否存在指定键。
void set(const std::string &key, FeaturePtr value)
\chinese 将Feature值赋给指定键。 \endchinese \english Assign a Feature value to the specified key.
void set(const std::string &key, const std::string &value)
\chinese 将std::string值赋给指定键。 \endchinese \english Assign a std::string value to the specified key.
void set(const std::string &key, WaypointPtr value)
void set(const std::string &key, ExpressionPtr value)
WaypointPtr get(const std::string &key, WaypointPtr default_value) const
void set(const std::string &key, IoPtr value)
TCPPtr get(const std::string &key, TCPPtr default_value) const
\chinese 获取赋给指定键的TCP值。 \endchinese \english Get the TCP value assigned to the specified key.
int get(const std::string &key, int default_value) const
\chinese 获取赋给指定键的int值。
ExpressionPtr get(const std::string &key, ExpressionPtr default_value) const
bool remove(const std::string &key)
\chinese 从数据模型中移除一个键值对。
void set(const std::string &key, const std::vector< double > &value)
\chinese 将double[]数组赋给指定键。 \endchinese \english Assign a double[] as value to the specified key.
IoPtr get(const std::string &key, IoPtr default_value) const
void set(const std::string &key, const std::vector< long > &value)
\chinese 将long[]数组赋给指定键。 \endchinese \english Assign a long[] as value to the specified key.
std::string get(const std::string &key, const std::string &default_value) const
\chinese 获取赋给指定键的std::string值。 \endchinese \english Get the std::string value assigned to the specifi...
std::vector< bool > get(const std::string &key, const std::vector< bool > &default_value) const
\chinese 获取赋给指定键的bool[]数组。 \endchinese \english Get the bool[] as value assigned to the specified key...
std::vector< uint64_t > get(const std::string &key, const std::vector< uint64_t > &default_value) const
std::vector< long > get(const std::string &key, const std::vector< long > &default_value) const
\chinese 获取赋给指定键的long[]数组。 \endchinese \english Get the long[] as value assigned to the specified key...
void set(const std::string &key, uint64_t value)
float get(const std::string &key, float default_value) const
\chinese 获取赋给指定键的float值。 \endchinese \english Get the float value assigned to the specified key.
void set(const std::string &key, bool value)
\chinese 将bool值赋给指定键。
long get(const std::string &key, long default_value) const
\chinese 获取赋给指定键的long值。 \endchinese \english Get the long value assigned to the specified key.
void set(const std::string &key, double value)
\chinese 将double值赋给指定键。 \endchinese \english Assign a double value to the specified key.
void set(const std::string &key, const std::vector< std::string > &value)
\chinese 将std::string[]数组赋给指定键。 \endchinese \english Assign a std::string[] as value to the specified...
void set(const std::string &key, VariablePtr value)
\chinese 将Variable值赋给指定键。 \endchinese \english Assign a Variable value to the specified key.
void set(const std::string &key, const std::vector< uint64_t > &value)
void set(const std::string &key, const std::vector< float > &value)
\chinese 将float[]数组赋给指定键。 \endchinese \english Assign a float[] as value to the specified key.
void set(const std::string &key, const std::vector< bool > &value)
\chinese 将bool[]数组赋给指定键。 \endchinese \english Assign a bool[] as value to the specified key.
void set(const std::string &key, float value)
\chinese 将float值赋给指定键。 \endchinese \english Assign a float value to the specified key.
VariablePtr get(const std::string &key, VariablePtr default_value) const
\chinese 获取赋给指定键的Variable值。
std::vector< float > get(const std::string &key, const std::vector< float > &default_value) const
\chinese 获取赋给指定键的float[]数组。 \endchinese \english Get the float[] as value assigned to the specified k...
uint64_t get(const std::string &key, uint64_t default_value) const
PayloadPtr get(const std::string &key, PayloadPtr default_value) const
double get(const std::string &key, double default_value) const
\chinese 获取赋给指定键的double值。 \endchinese \english Get the double value assigned to the specified key.
std::vector< int > get(const std::string &key, const std::vector< int > &default_value) const
\chinese 获取赋给指定键的int[]数组。 \endchinese \english Get the int[] as value assigned to the specified key.
std::vector< double > get(const std::string &key, const std::vector< double > &default_value) const
\chinese 获取赋给指定键的double[]数组。 \endchinese \english Get the double[] as value assigned to the specified...
void set(const std::string &key, TCPPtr value)
\chinese 将TCP值赋给指定键。 \endchinese \english Assign a TCP value to the specified key.
bool get(const std::string &key, bool default_value) const
\chinese 获取赋给指定键的bool值。
void set(const std::string &key, PayloadPtr value)
void set(const std::string &key, int value)
\chinese 将int值赋给指定键。
void set(const std::string &key, const std::vector< int > &value)
\chinese 将int[]数组赋给指定键。 \endchinese \english Assign a int[] as value to the specified key.
FeaturePtr get(const std::string &key, FeaturePtr default_value) const
\chinese 获取赋给指定键的Feature值。 \endchinese \english Get the Feature value assigned to the specified key.
void set(const std::string &key, long value)
\chinese 将long值赋给指定键。 \endchinese \english Assign a long value to the specified key.
std::set< std::string > getKeys() const
\chinese 获取数据模型中所有键的集合。