diff options
author | Yifan Hong | 2017-05-24 16:37:19 -0500 |
---|---|---|
committer | Yifan Hong | 2017-05-24 19:30:09 -0500 |
commit | 0fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7 (patch) | |
tree | 1f1e2ae4b906ff48c39acd3069aa17ae1f656dcf /CompatibilityMatrix.cpp | |
parent | 79dcc1fcecf4b9b6ff775914f19e6bd7de1d331c (diff) | |
download | platform-system-libvintf-0fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7.tar.gz platform-system-libvintf-0fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7.tar.xz platform-system-libvintf-0fd7aeff56fc919dd70aeddfa10df39b4ca7e9a7.zip |
HalGroup is the base class for HalManifest and CompatibilityMatrix.
Move common functions to HalGroup.h
Test: libvintf_test
Test: vintf_object_test
Bug: 38217107
Change-Id: I8acac6f4fcf79e2c9c3ec9df475f341c772aa983
Diffstat (limited to 'CompatibilityMatrix.cpp')
-rw-r--r-- | CompatibilityMatrix.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/CompatibilityMatrix.cpp b/CompatibilityMatrix.cpp index 379fd78..627c238 100644 --- a/CompatibilityMatrix.cpp +++ b/CompatibilityMatrix.cpp | |||
@@ -24,8 +24,7 @@ namespace vintf { | |||
24 | constexpr Version CompatibilityMatrix::kVersion; | 24 | constexpr Version CompatibilityMatrix::kVersion; |
25 | 25 | ||
26 | bool CompatibilityMatrix::add(MatrixHal &&hal) { | 26 | bool CompatibilityMatrix::add(MatrixHal &&hal) { |
27 | mHals.emplace(hal.name, std::move(hal)); | 27 | return HalGroup<MatrixHal>::add(std::move(hal)); |
28 | return true; | ||
29 | } | 28 | } |
30 | 29 | ||
31 | bool CompatibilityMatrix::add(MatrixKernel &&kernel) { | 30 | bool CompatibilityMatrix::add(MatrixKernel &&kernel) { |
@@ -36,18 +35,6 @@ bool CompatibilityMatrix::add(MatrixKernel &&kernel) { | |||
36 | return true; | 35 | return true; |
37 | } | 36 | } |
38 | 37 | ||
39 | ConstMultiMapValueIterable<std::string, MatrixHal> CompatibilityMatrix::getHals() const { | ||
40 | return ConstMultiMapValueIterable<std::string, MatrixHal>(mHals); | ||
41 | } | ||
42 | |||
43 | MatrixHal *CompatibilityMatrix::getAnyHal(const std::string &name) { | ||
44 | auto it = mHals.find(name); | ||
45 | if (it == mHals.end()) { | ||
46 | return nullptr; | ||
47 | } | ||
48 | return &(it->second); | ||
49 | } | ||
50 | |||
51 | const MatrixKernel *CompatibilityMatrix::findKernel(const KernelVersion &v) const { | 38 | const MatrixKernel *CompatibilityMatrix::findKernel(const KernelVersion &v) const { |
52 | if (mType != SchemaType::FRAMEWORK) { | 39 | if (mType != SchemaType::FRAMEWORK) { |
53 | return nullptr; | 40 | return nullptr; |