Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <map> |
| 4 | #include <sdbusplus/server.hpp> |
| 5 | #include <string> |
| 6 | #include <vector> |
| 7 | |
| 8 | namespace ibm |
| 9 | { |
| 10 | namespace logging |
| 11 | { |
| 12 | |
| 13 | using DbusInterface = std::string; |
| 14 | using DbusProperty = std::string; |
Matt Spinler | 259e727 | 2018-03-29 10:57:17 -0500 | [diff] [blame] | 15 | using Value = sdbusplus::message::variant<bool, uint32_t, uint64_t, std::string, |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 16 | std::vector<std::string>>; |
| 17 | |
| 18 | using DbusPropertyMap = std::map<DbusProperty, Value>; |
| 19 | using DbusInterfaceMap = std::map<DbusInterface, DbusPropertyMap>; |
| 20 | using DbusInterfaceList = std::vector<DbusInterface>; |
| 21 | |
Matt Spinler | bc99749 | 2018-03-27 11:24:45 -0500 | [diff] [blame] | 22 | using ObjectValueTree = |
| 23 | std::map<sdbusplus::message::object_path, DbusInterfaceMap>; |
| 24 | |
Matt Spinler | 32219be | 2018-05-23 11:29:41 -0500 | [diff] [blame^] | 25 | /** |
| 26 | * Returns the managed objects for an object path and service |
| 27 | * |
| 28 | * Returns an empty map if there are any failures. |
| 29 | * |
| 30 | * @param[in] bus - the D-Bus object |
| 31 | * @param[in] service - the D-Bus service name |
| 32 | * @param[in] objPath - the D-Bus object path |
| 33 | * |
| 34 | * @return ObjectValueTree - A map of object paths to their |
| 35 | * interfaces and properties. |
| 36 | */ |
Matt Spinler | 259e727 | 2018-03-29 10:57:17 -0500 | [diff] [blame] | 37 | ObjectValueTree getManagedObjects(sdbusplus::bus::bus& bus, |
| 38 | const std::string& service, |
| 39 | const std::string& objPath); |
Matt Spinler | e0017eb | 2018-03-27 11:17:38 -0500 | [diff] [blame] | 40 | } |
| 41 | } |