blob: eb970aa2bdc007faae8f6f1944c56125167482ef [file] [log] [blame]
Gunnar Mills9df13162017-03-08 15:00:08 -06001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include "xyz/openbmc_project/Software/Version/server.hpp"
5
6namespace openpower
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
Gunnar Mills44c77292017-03-20 15:02:27 -050028 * @param[in] versionId - The Host version identifier
Gunnar Mills9df13162017-03-08 15:00:08 -060029 */
30 Version(sdbusplus::bus::bus& bus,
Gunnar Mills44c77292017-03-20 15:02:27 -050031 const std::string& objPath) : VersionInherit(
32 bus, (objPath).c_str()) {};
33
34 /**
35 * @brief Get the code version identifier.
36 *
37 * @return The version identifier.
38 **/
39 static std::string getVersion(const std::string& tocFilePath);
40
41 /**
42 * @brief Get the Host Version id.
43 *
44 * @return The id.
45 **/
46 static std::string getId(const std::string& version);
Gunnar Mills9df13162017-03-08 15:00:08 -060047};
48
49} // namespace manager
50} // namespace software
51} // namespace openpower
52