diff options
Diffstat (limited to 'include/vintf/MatrixHal.h')
-rw-r--r-- | include/vintf/MatrixHal.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/vintf/MatrixHal.h b/include/vintf/MatrixHal.h index 6044792..595c57a 100644 --- a/include/vintf/MatrixHal.h +++ b/include/vintf/MatrixHal.h | |||
@@ -48,23 +48,35 @@ struct MatrixHal { | |||
48 | 48 | ||
49 | inline const std::string& getName() const { return name; } | 49 | inline const std::string& getName() const { return name; } |
50 | 50 | ||
51 | // Return true if "this" contains all interface/instance instances in "other". | ||
52 | bool containsInstances(const MatrixHal& other) const; | ||
53 | |||
54 | bool forEachInstance(const std::function<bool(const MatrixInstance&)>& func) const; | 51 | bool forEachInstance(const std::function<bool(const MatrixInstance&)>& func) const; |
55 | 52 | ||
56 | private: | 53 | private: |
57 | friend struct HalManifest; | 54 | friend struct HalManifest; |
58 | friend struct CompatibilityMatrix; | 55 | friend struct CompatibilityMatrix; |
56 | // Loop over interface/instance for a specific VersionRange. | ||
59 | bool forEachInstance(const VersionRange& vr, | 57 | bool forEachInstance(const VersionRange& vr, |
60 | const std::function<bool(const MatrixInstance&)>& func) const; | 58 | const std::function<bool(const MatrixInstance&)>& func) const; |
59 | // Loop over interface/instance. VersionRange is supplied to the function as a vector. | ||
60 | bool forEachInstance( | ||
61 | const std::function<bool(const std::vector<VersionRange>&, const std::string&, | ||
62 | const std::string&)>& func) const; | ||
61 | bool isCompatible(const std::set<FqInstance>& providedInstances, | 63 | bool isCompatible(const std::set<FqInstance>& providedInstances, |
62 | const std::set<Version>& providedVersions) const; | 64 | const std::set<Version>& providedVersions) const; |
63 | bool isCompatible(const VersionRange& vr, const std::set<FqInstance>& providedInstances, | 65 | bool isCompatible(const VersionRange& vr, const std::set<FqInstance>& providedInstances, |
64 | const std::set<Version>& providedVersions) const; | 66 | const std::set<Version>& providedVersions) const; |
65 | 67 | ||
66 | void setOptional(bool o); | 68 | void setOptional(bool o); |
67 | void insertVersionRanges(const MatrixHal& other); | 69 | void insertVersionRanges(const std::vector<VersionRange>& other); |
70 | void insertInstance(const std::string& interface, const std::string& instance); | ||
71 | // Return true if it has any interface/instance tags. | ||
72 | bool hasAnyInstance() const; | ||
73 | bool hasInstance(const std::string& interface, const std::string& instance) const; | ||
74 | // Return true if it contains only interface/instance. | ||
75 | bool hasOnlyInstance(const std::string& interface, const std::string& instance) const; | ||
76 | // Remove a specific interface/instances. Return true if removed, false otherwise. | ||
77 | bool removeInstance(const std::string& interface, const std::string& instance); | ||
78 | // Remove all <interface> tags. | ||
79 | void clearInstances(); | ||
68 | }; | 80 | }; |
69 | 81 | ||
70 | } // namespace vintf | 82 | } // namespace vintf |