blob: 3b5e2540be3327945b0a8b5faef8dbb947203654 [file] [log] [blame]
Gunnar Millsec1b41c2017-05-02 12:20:36 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <xyz/openbmc_project/Software/Activation/server.hpp>
5
6namespace phosphor
7{
8namespace software
9{
10namespace updater
11{
12
13using ActivationInherit = sdbusplus::server::object::object<
14 sdbusplus::xyz::openbmc_project::Software::server::Activation>;
15
16/** @class Activation
17 * @brief OpenBMC activation software management implementation.
18 * @details A concrete implementation for
19 * xyz.openbmc_project.Software.Activation DBus API.
20 */
21class Activation : public ActivationInherit
22{
23 public:
24 /** @brief Constructs Activation Software Manager
25 *
26 * @param[in] bus - The Dbus bus object
27 * @param[in] path - The Dbus object path
Gunnar Mills2ce7da22017-05-04 15:37:56 -050028 * @param[in] versionId - The software version id
29 * @param[in] activationStatus - The status of Activation
Gunnar Millsec1b41c2017-05-02 12:20:36 -050030 */
Gunnar Mills2ce7da22017-05-04 15:37:56 -050031 Activation(sdbusplus::bus::bus& bus, const std::string& path,
32 std::string& versionId,
33 sdbusplus::xyz::openbmc_project::Software::
34 server::Activation::Activations activationStatus) :
35 ActivationInherit(bus, path.c_str(), true),
36 bus(bus),
37 path(path),
38 versionId(versionId)
39 {
40 // Set Properties.
41 activation(activationStatus);
42 // Emit deferred signal.
43 emit_object_added();
44 }
45
46 /** @brief Persistent sdbusplus DBus bus connection */
47 sdbusplus::bus::bus& bus;
48
49 /** @brief Persistent DBus object path */
50 std::string path;
51
52 /** @brief Version id */
53 std::string versionId;
Gunnar Millsec1b41c2017-05-02 12:20:36 -050054};
55
56} // namespace updater
57} // namespace software
58} // namespace phosphor