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>
6 #include <aubo_caps/domain/feature/feature.h>
7 #include <aubo_caps/domain/variable/variable_factory.h>
8 #include <aubo_caps/domain/variable/feature_variable.h>
9
10 namespace arcs {
11 namespace aubo_scope {
12 ARCS_CLASS_FORWARD(VariableModel);
13
14 /**
15 * @defgroup VariableModel VariableModel
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 */
21 class ARCS_ABI_EXPORT VariableModel
22 {
23 public:
24 VariableModel(VariableModel &f);
25 VariableModel(VariableModel &&f);
26 ~VariableModel();
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
82 private:
83 friend class DataSwitch;
84 VariableModel();
85 void *d_{ nullptr };
86 };
87
88 } // namespace aubo_scope
89 } // namespace arcs
90 #endif // AUBO_SCOPE_VARIABLE_MODEL_H
ARCS_ABI_EXPORT
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16
arcs::aubo_scope::VariableModel
Definition: variable_model.h:22
arcs::aubo_scope::VariableModel::VariableModel
VariableModel(VariableModel &&f)
arcs::aubo_scope::VariableModel::~VariableModel
~VariableModel()
arcs::aubo_scope::VariableModel::VariableModel
VariableModel(VariableModel &f)
arcs::aubo_scope::VariableModel::VariableModel
VariableModel()
arcs::aubo_scope::VariableModel::get
VariablePtr get(const std::string &name)
feature.h
feature_variable.h
arcs::aubo_scope::VariableModel::getFeatureVariable
FeatureVariablePtr getFeatureVariable(FeaturePtr feature)
Get the feature variable for a Feature.
arcs::aubo_scope::VariableModel::get
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.
arcs::aubo_scope::VariableModel::getVariableFactory
VariableFactoryPtr getVariableFactory()
arcs::aubo_scope::VariableModel::disconnectFrom
void disconnectFrom(const std::string &receiver)
disconnectFrom
arcs::aubo_scope::VariableModel::connectedTo
std::string connectedTo(const std::string &receiver, const std::function< void(VariableModel *)> &slot)
Register callback for changed
arcs::aubo_scope::VariableModel::getAll
std::vector< VariablePtr > getAll()
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs
Definition: contribution_provider.h:7
variable_factory.h