blob: db1e5e49f7bfa74c52493bffa3864957b402e59f [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";
16
17/** @class Objects
18 * @brief Fetch paths of settings D-bus objects of interest upon construction
19 */
20struct Objects
21{
22 public:
23 /** @brief Constructor - fetch settings objects
24 *
25 * @param[in] bus - The D-bus bus object
26 */
27 Objects();
28 Objects(const Objects&) = default;
29 Objects& operator=(const Objects&) = default;
30 Objects(Objects&&) = default;
31 Objects& operator=(Objects&&) = default;
32 ~Objects() = default;
33
34 /** @brief Fetch D-bus service, given a path and an interface. The
35 * service can't be cached because mapper returns unique
36 * service names.
37 *
38 * @param[in] path - The D-bus object
39 * @param[in] interface - The D-bus interface
40 *
41 * @return std::string - the D-bus service
42 */
43 Service service(const Path& path, const Interface& interface) const;
44
45 /** @brief time owner settings object */
46 Path timeOwner;
47
48 /** @brief time sync method settings object */
49 Path timeSyncMethod;
50};
51
52} // namespace settings