AuboStudio SDK  0.6.3
persisted_variable.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_PERSISTED_VARIABLE_H
2#define AUBO_SCOPE_PERSISTED_VARIABLE_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * ingroup ApplicationApi
12 * This interface represents variables stored with the installation. These
13 * variables are defined in the installation and will exist even when a robot is
14 * turned off and on.
15 */
17{
18public:
22
23 /**
24 * @ingroup PersistedVariable
25 * A persisted variable can not be guaranteed to be present. This method can
26 * be used to determine, if the variable is present.
27 *
28 *The persisted variable will not be present, if the end user loads a
29 *different installation which does not contain the variable, or if the
30 *variable is deleted by the end user.
31 *
32 * A program node storing a <code>PersistedVariable</code> in its Data
33 *Model will be undefined if the variable cannot be resolved (i.e. the
34 *variable is not present).
35 *
36 * @return <code>true</code>, if this persisted variable is resolvable (i.e.
37 * present in the current installation).
38 */
40
41protected:
43
44private:
45 friend class DataSwitch;
46 void *d_{ nullptr };
47};
48
50{
51 bool operator()(VariablePtr var)
52 {
53 return std::dynamic_pointer_cast<PersistedVariable>(var) != nullptr &&
54 var->getType() == Variable::VALUE_PERSISTED;
55 }
56};
57
58} // namespace aubo_scope
59} // namespace arcs
60#endif // AUBO_SCOPE_PERSISTED_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...
ingroup ApplicationApi This interface represents variables stored with the installation.
bool isResolvable()
A persisted variable can not be guaranteed to be present.
PersistedVariable(PersistedVariable &&f)
PersistedVariable(PersistedVariable &f)