Saqib Khan | ce14870 | 2017-06-11 12:01:58 -0500 | [diff] [blame] | 1 | #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 | |
| 7 | namespace openpower |
| 8 | { |
| 9 | namespace software |
| 10 | { |
| 11 | namespace updater |
| 12 | { |
| 13 | |
| 14 | using 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 | */ |
| 23 | class 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 |