blob: 088628a618055b0ead66d2aaf31b86dece1237e7 [file] [log] [blame]
Deepak Kodihallia646edd2017-07-25 07:28:45 -05001#pragma once
2
3#include <string>
4#include <sdbusplus/bus.hpp>
5
6namespace settings
7{
8
9using Path = std::string;
10using Service = std::string;
11using Interface = std::string;
12
13constexpr auto root = "/";
14constexpr auto autoRebootIntf =
15 "xyz.openbmc_project.Control.Boot.RebootPolicy";
16constexpr auto powerRestoreIntf =
17 "xyz.openbmc_project.Control.Power.RestorePolicy";
18
19/** @class Objects
20 * @brief Fetch paths of settings d-bus objects of interest, upon construction
21 */
22struct Objects
23{
24 public:
25 /** @brief Constructor - fetch settings objects
26 *
27 * @param[in] bus - The Dbus bus object
28 */
29 Objects(sdbusplus::bus::bus& bus);
30 Objects(const Objects&) = delete;
31 Objects& operator=(const Objects&) = delete;
32 Objects(Objects&&) = delete;
33 Objects& operator=(Objects&&) = delete;
34 ~Objects() = default;
35
36 /** @brief Fetch d-bus service, given a path and an interface. The
37 * service can't be cached because mapper returns unique
38 * service names.
39 *
40 * @param[in] path - The Dbus object
41 * @param[in] interface - The Dbus interface
42 *
43 * @return std::string - the dbus service name
44 */
45 Service service(const Path& path, const Interface& interface) const;
46
47 /** @brief host auto_reboot settings object */
48 Path autoReboot;
49
50 /** @brief host power_restore_policy settings object */
51 Path powerRestorePolicy;
52
53 /** @brief The Dbus bus object */
54 sdbusplus::bus::bus& bus;
55};
56
57} // namespace settings