blob: 2e794af84c2a933433a238fc7353e0a33009cd31 [file] [log] [blame]
Alexander Hansencc372352025-01-14 14:15:39 +01001#pragma once
2
3#include <sdbusplus/async/context.hpp>
4#include <xyz/openbmc_project/Software/Update/aserver.hpp>
5
6namespace phosphor::software
7{
8class Software;
9};
10
11using RequestedApplyTimes = sdbusplus::common::xyz::openbmc_project::software::
12 ApplyTime::RequestedApplyTimes;
13
14namespace phosphor::software::update
15{
16
17class SoftwareUpdate :
18 public sdbusplus::aserver::xyz::openbmc_project::software::Update<
19 SoftwareUpdate>
20{
21 public:
Alexander Hansen8b4ab1e2025-04-10 14:25:53 +020022 SoftwareUpdate(const SoftwareUpdate&) = delete;
23 SoftwareUpdate(SoftwareUpdate&&) = delete;
24 SoftwareUpdate& operator=(const SoftwareUpdate&) = delete;
25 SoftwareUpdate& operator=(SoftwareUpdate&&) = delete;
Alexander Hansencc372352025-01-14 14:15:39 +010026 SoftwareUpdate(sdbusplus::async::context& ctx, const char* path,
27 Software& software,
28 const std::set<RequestedApplyTimes>& allowedApplyTimes);
29
Alexander Hansen8b4ab1e2025-04-10 14:25:53 +020030 ~SoftwareUpdate();
31
Alexander Hansencc372352025-01-14 14:15:39 +010032 auto method_call(start_update_t su, auto image, auto applyTime)
33 -> sdbusplus::async::task<start_update_t::return_type>;
34
35 auto get_property(allowed_apply_times_t aat) const;
36
37 private:
38 Software& software;
39
40 const std::set<RequestedApplyTimes> allowedApplyTimes;
41};
42
43}; // namespace phosphor::software::update