AuboCaps  0.6.0
variable_model.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_VARIABLE_MODEL_H
2 #define AUBO_SCOPE_VARIABLE_MODEL_H
3 
4 #include <vector>
5 #include <functional>
9 
10 namespace arcs {
11 namespace aubo_scope {
12 ARCS_CLASS_FORWARD(VariableModel);
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 {
22 public:
25  ~VariableModel();
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 
75 private:
76  friend class DataSwitch;
77  VariableModel();
78  void *d_{ nullptr };
79 };
80 
81 } // namespace aubo_scope
82 } // namespace arcs
83 #endif // AUBO_SCOPE_VARIABLE_MODEL_H
ARCS_CLASS_FORWARD(GripForceCapability)
Provides methods that returns the variables that currently are registered in the system.
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16