blob: 95d20dc37d221def7df3420cace55023bcb67561 [file] [log] [blame]
Deepak Kodihalli20ed79e2017-07-25 05:48:58 -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 timeOwnerIntf = "xyz.openbmc_project.Time.Owner";
15constexpr auto timeSyncIntf = "xyz.openbmc_project.Time.Synchronization";
Lei YUdebe1d82017-10-13 13:21:37 +080016constexpr auto hostStateIntf = "xyz.openbmc_project.State.Host";
Deepak Kodihalli20ed79e2017-07-25 05:48:58 -050017
18/** @class Objects
19 * @brief Fetch paths of settings D-bus objects of interest upon construction
20 */
21struct Objects
22{
23 public:
24 /** @brief Constructor - fetch settings objects
25 *
26 * @param[in] bus - The D-bus bus object
27 */
28 Objects();
29 Objects(const Objects&) = default;
30 Objects& operator=(const Objects&) = default;
31 Objects(Objects&&) = default;
32 Objects& operator=(Objects&&) = default;
33 ~Objects() = default;
34
35 /** @brief Fetch D-bus service, given a path and an interface. The
36 * service can't be cached because mapper returns unique
37 * service names.
38 *
39 * @param[in] path - The D-bus object
40 * @param[in] interface - The D-bus interface
41 *
42 * @return std::string - the D-bus service
43 */
44 Service service(const Path& path, const Interface& interface) const;
45
46 /** @brief time owner settings object */
47 Path timeOwner;
48
49 /** @brief time sync method settings object */
50 Path timeSyncMethod;
Lei YUdebe1d82017-10-13 13:21:37 +080051
52 /** @brief host state object */
53 Path hostState;
Deepak Kodihalli20ed79e2017-07-25 05:48:58 -050054};
55
56} // namespace settings