AuboCaps  0.6.0
feature.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_FEATURE_H
2 #define AUBO_SCOPE_FEATURE_H
3 
4 #include <vector>
6 
7 namespace arcs {
8 namespace aubo_scope {
9 
10 ARCS_CLASS_FORWARD(Feature);
11 
12 /**
13  * This base interface represents all types of features available in AuboScope
14  */
16 {
17 public:
18  Feature(Feature &f);
19  Feature(Feature &&f);
20  virtual ~Feature();
21 
22  /**
23  * Note: The feature can be renamed at any time
24  *
25  * @return The name of the feature
26  */
27  std::string getDisplayName();
28 
29  /**
30  * Returns whether the position of the feature has been fully
31  * defined/specified.
32  *
33  * @return <code>true</code> if the feature is defined, <code>false</code>
34  * otherwise.
35  */
36  bool isDefined();
37 
38  /**
39  * Returns whether the feature can be used as a variable in the program.
40  *
41  * @return <code>true</code> if the feature is variable, <code>false</code>
42  * otherwise.
43  */
44  bool isVariable();
45  bool isJoggable();
46 
47  /**
48  * A feature cannot be guaranteed to be present in AuboScope. The end user
49  * can load a different installation (not containing the feature) or the
50  * feature can be removed by the end user or the AuboCap that added the
51  * feature. This method can be used to determine, if the feature is present.
52  *
53  * @return <code>true</code> if this feature is present in AuboScope,
54  * otherwise <code>false</code>.
55  */
56  bool isResolvable();
57 
58  /**
59  * Returns the Cartesian location of the feature
60  *
61  * @return A pose representing the Cartesian location of the feature
62  */
63  std::vector<double> getPose();
64 
65  size_t hashCode();
66 
67 protected:
68  Feature();
69 
70 private:
71  friend class DataSwitch;
72  void *d_{ nullptr };
73 };
74 
76 {
77  bool operator()(FeaturePtr feature)
78  {
79  return feature && feature->isDefined();
80  }
81 };
82 
84 {
85  bool operator()(FeaturePtr feature)
86  {
87  return feature && feature->isJoggable() && feature->isDefined();
88  }
89 };
90 
91 } // namespace aubo_scope
92 } // namespace arcs
93 #endif
ARCS_CLASS_FORWARD(GripForceCapability)
This base interface represents all types of features available in AuboScope.
Definition: feature.h:15
bool operator()(FeaturePtr feature)
Definition: feature.h:85
bool operator()(FeaturePtr feature)
Definition: feature.h:77
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16