summaryrefslogtreecommitdiffstats
path: root/fan_enclosure.hpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-02-20 16:01:21 -0600
committerMatthew Barth <msbarth@us.ibm.com>2017-03-15 13:46:31 -0500
commit1562ac70266a50043ec44c8adcafaea4a97dfca5 (patch)
treedf6a6c123f8a4983e071136daadea7a9804bc6df /fan_enclosure.hpp
parentcd4f4d1a0a49f4ed43b3a773d2e2046cc15ef1d1 (diff)
downloadphosphor-fan-presence-1562ac70266a50043ec44c8adcafaea4a97dfca5.tar.gz
phosphor-fan-presence-1562ac70266a50043ec44c8adcafaea4a97dfca5.zip
Function to setup fan inventory object map
The getObjectMap() function constructs the object map needed by inventory manager for the object path, interface, and properties of a fan. Change-Id: I8cce5cd611d3a0f7a2079b81f280b261aee486e2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'fan_enclosure.hpp')
-rw-r--r--fan_enclosure.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/fan_enclosure.hpp b/fan_enclosure.hpp
index 5c6a040..3876cea 100644
--- a/fan_enclosure.hpp
+++ b/fan_enclosure.hpp
@@ -14,6 +14,17 @@ namespace presence
class FanEnclosure
{
+ using Property = std::string;
+ using Value = sdbusplus::message::variant<bool, int64_t, std::string>;
+ // Association between property and its value
+ using PropertyMap = std::map<Property, Value>;
+ using Interface = std::string;
+ // Association between interface and the dbus property
+ using InterfaceMap = std::map<Interface, PropertyMap>;
+ using Object = sdbusplus::message::object_path;
+ // Association between object and the interface
+ using ObjectMap = std::map<Object, InterfaceMap>;
+
public:
FanEnclosure() = delete;
FanEnclosure(const FanEnclosure&) = delete;
@@ -43,6 +54,7 @@ class FanEnclosure
std::vector<std::unique_ptr<Sensor>> sensors;
void addInventory();
+ ObjectMap getObjectMap();
};
OpenPOWER on IntegriCloud