blob: 6c45e0a07aad8d03915d70af698ce2963bfaad9e [file] [log] [blame]
Gunnar Mills392f2942017-04-12 11:04:37 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include "xyz/openbmc_project/Software/Version/server.hpp"
5
6namespace phosphor
7{
8namespace software
9{
10namespace manager
11{
12
13using VersionInherit = sdbusplus::server::object::object<
14 sdbusplus::xyz::openbmc_project::Software::server::Version>;
15
16/** @class Version
17 * @brief OpenBMC version software management implementation.
18 * @details A concrete implementation for xyz.openbmc_project.Software.Version
19 * DBus API.
20 */
21class Version : public VersionInherit
22{
23 public:
24 /** @brief Constructs Version Software Manager
25 *
26 * @param[in] bus - The Dbus bus object
27 * @param[in] objPath - The Dbus object path
28 * @param[in] versionId - The Host version identifier
29 */
30 Version(sdbusplus::bus::bus& bus,
31 const std::string& objPath,
32 const std::string& versionId) : VersionInherit(
33 bus, (objPath).c_str(), true)
34 {
35 // Set properties.
36 version(versionId);
37
38 // Emit deferred signal.
39 emit_object_added();
40 }
41
42 /**
43 * @brief Get the code version identifier.
44 *
45 * @return The version identifier.
46 **/
47 static std::string getVersion(const std::string& manifestFilePath);
48
49 /**
50 * @brief Get the Host Version id.
51 *
52 * @return The id.
53 **/
54 static std::string getId(const std::string& version);
55};
56
57} // namespace manager
58} // namespace software
59} // namespace phosphor
60