AuboStudio SDK  0.6.3
variable_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_VARIABLE_MODEL_H
2#define AUBO_SCOPE_VARIABLE_MODEL_H
3
4#include <vector>
5#include <functional>
9
10namespace arcs {
11namespace aubo_scope {
13
14/**
15 * Provides methods that returns the variables that currently are registered in
16 * the system. A variable is registered if it has been stored in a {@link
17 * DataModel} instance or used for the configuration of a built-in AuboScope
18 * program node.
19 */
21{
22public:
26
27 /**
28 *
29 * @return the collection of all variables that currently are registered in
30 * the system.
31 */
32 std::vector<VariablePtr> getAll();
33
34 VariablePtr get(const std::string &name);
35
36 /**
37 * Get a subset of all the variables registered in the system using a
38 * filter.
39 *
40 * @param filter see {@link VariableFilterFactory} for examples.
41 * @return the collection of Variables that are accepted by the filter.
42 */
43 std::vector<VariablePtr> get(std::function<bool(VariablePtr)> filter =
44 [](VariablePtr) { return true; });
45
46 /**
47 * @return a {@link VariableFactory} to create variable objects.
48 */
49 VariableFactoryPtr getVariableFactory();
50
51 /**
52 *
53 * Get the feature variable for a {@link Feature}.
54 *
55 * @param feature the feature with a variable.
56 * @return the variable for the feature.
57 * @throws IllegalArgumentException If feature not is present in the
58 * installation or feature has no variable, see {@link
59 * Feature#isVariable()}.
60 */
61 FeatureVariablePtr getFeatureVariable(FeaturePtr feature);
62
63 /**
64
65 * Register callback for changed
66 *
67 * @param receiver
68 * @param slot
69 */
70 std::string connectedTo(const std::string &receiver,
71 const std::function<void(VariableModel *)> &slot);
72
73 void disconnectFrom(const std::string &receiver);
74
75private:
76 friend class DataSwitch;
78 void *d_{ nullptr };
79};
80
81} // namespace aubo_scope
82} // namespace arcs
83#endif // AUBO_SCOPE_VARIABLE_MODEL_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...
Provides methods that returns the variables that currently are registered in the system.
VariableModel(VariableModel &&f)
FeatureVariablePtr getFeatureVariable(FeaturePtr feature)
Get the feature variable for a Feature.
std::vector< VariablePtr > get(std::function< bool(VariablePtr)> filter=[](VariablePtr) { return true;})
Get a subset of all the variables registered in the system using a filter.
VariableFactoryPtr getVariableFactory()
void disconnectFrom(const std::string &receiver)
VariableModel(VariableModel &f)
std::string connectedTo(const std::string &receiver, const std::function< void(VariableModel *)> &slot)
Register callback for changed
VariablePtr get(const std::string &name)
std::vector< VariablePtr > getAll()