1 #pragma once 2 3 #include <sdbusplus/bus.hpp> 4 5 #include <string> 6 7 namespace settings 8 { 9 10 using Path = std::string; 11 using Service = std::string; 12 using Interface = std::string; 13 14 constexpr auto root = "/"; 15 constexpr 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 */ 20 struct Objects 21 { 22 public: 23 /** @brief Constructor - fetch settings objects 24 * 25 * @param[in] bus - The D-bus bus object 26 */ 27 Objects() = delete; 28 explicit Objects(sdbusplus::bus::bus&); 29 Objects(const Objects&) = delete; 30 Objects& operator=(const Objects&) = delete; 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 sync method settings object */ 47 Path timeSyncMethod; 48 49 private: 50 sdbusplus::bus::bus& bus; 51 }; 52 53 } // namespace settings 54