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