blob: 573255c4367dba6c9d8fcb7cd8bf40a61eed8dbc [file] [log] [blame]
Saqib Khance148702017-06-11 12:01:58 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include "xyz/openbmc_project/Software/Version/server.hpp"
5#include "xyz/openbmc_project/Common/FilePath/server.hpp"
6
7namespace openpower
8{
9namespace software
10{
11namespace updater
12{
13
14using VersionInherit = sdbusplus::server::object::object<
15 sdbusplus::xyz::openbmc_project::Software::server::Version,
16 sdbusplus::xyz::openbmc_project::Common::server::FilePath>;
17
18/** @class Version
19 * @brief OpenBMC version software management implementation.
20 * @details A concrete implementation for xyz.openbmc_project.Software.Version
21 * DBus API.
22 */
23class Version : public VersionInherit
24{
25 public:
26 /** @brief Constructs Version Software Manager.
27 *
28 * @param[in] bus - The Dbus bus object
29 * @param[in] objPath - The Dbus object path
30 * @param[in] versionId - The version identifier
31 * @param[in] versionPurpose - The version purpose
32 * @param[in] filePath - The image filesystem path
33 */
34 Version(sdbusplus::bus::bus& bus,
35 const std::string& objPath,
36 const std::string& versionId,
37 VersionPurpose versionPurpose,
38 const std::string& filePath) : VersionInherit(
39 bus, (objPath).c_str(), true)
40 {
41 // Set properties.
42 purpose(versionPurpose);
43 version(versionId);
44 path(filePath);
45
46 // Emit deferred signal.
47 emit_object_added();
48 }
49};
50
51} // namespace updater
52} // namespace software
53} // namespace openpower