diff options
author | Deepak Kodihalli <dkodihal@in.ibm.com> | 2017-08-27 08:13:37 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-09-08 18:49:51 +0000 |
commit | e602709d4b95895a72d77f2cda1259c2ff9b8b1b (patch) | |
tree | 9e611532486e1a5e61341c4cef82d1641365492d /settings.cpp | |
parent | 62736ecab919357d85d8a578bd0df33d5038e578 (diff) | |
download | phosphor-host-ipmid-e602709d4b95895a72d77f2cda1259c2ff9b8b1b.tar.gz phosphor-host-ipmid-e602709d4b95895a72d77f2cda1259c2ff9b8b1b.zip |
settings: handle multiple objects/interfaces
Handle the fact that a settings object can now implement multiple
interfaces, and also the fact that multiple settings objects
can implement the same interface.
Change-Id: Icf55b08fe2d355a10f7007489dfddb128e05d90e
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'settings.cpp')
-rw-r--r-- | settings.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/settings.cpp b/settings.cpp index cb86d99..59f9f33 100644 --- a/settings.cpp +++ b/settings.cpp @@ -46,8 +46,19 @@ Objects::Objects(sdbusplus::bus::bus& bus, for (auto& iter : result) { const auto& path = iter.first; - auto& interface = iter.second.begin()->second[0]; - map.emplace(std::move(interface), path); + for (auto& interface : iter.second.begin()->second) + { + auto found = map.find(interface); + if (map.end() != found) + { + auto& paths = found->second; + paths.push_back(path); + } + else + { + map.emplace(std::move(interface), std::vector<Path>({path})); + } + } } } |