blob: ebf3fba711273648106a1db0dbb906e69ec86325 [file] [log] [blame]
Carol Wang71230ef2020-02-18 17:39:49 +08001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <phosphor-logging/log.hpp>
5#include <xyz/openbmc_project/State/ScheduledHostTransition/server.hpp>
6
7namespace phosphor
8{
9namespace state
10{
11namespace manager
12{
13
14using ScheduledHostTransitionInherit = sdbusplus::server::object::object<
15 sdbusplus::xyz::openbmc_project::State::server::ScheduledHostTransition>;
16
17/** @class ScheduledHostTransition
18 * @brief Scheduled host transition implementation.
19 * @details A concrete implementation for
20 * xyz.openbmc_project.State.ScheduledHostTransition
21 */
22class ScheduledHostTransition : public ScheduledHostTransitionInherit
23{
24 public:
25 ScheduledHostTransition(sdbusplus::bus::bus& bus, const char* objPath) :
26 ScheduledHostTransitionInherit(bus, objPath)
27 {
28 }
29
30 ~ScheduledHostTransition() = default;
31
32 /**
33 * @brief Handle with scheduled time
34 *
35 * @param[in] value - The seconds since epoch
36 * @return The time for the transition. It is the same as the input value if
37 * it is set successfully. Otherwise, it won't return value, but throw an
38 * error.
39 **/
40 uint64_t scheduledTime(uint64_t value) override;
41};
42} // namespace manager
43} // namespace state
44} // namespace phosphor