From a4fcb6839f10203b1f93f2712c373a78b0975822 Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Fri, 6 Oct 2017 13:14:12 -0500 Subject: Style and comment changes in version.hpp Style and comment changes only. Made more clear the difference between the version id (e.g. ad324adb) and the version string (e.g. v1.99.10-19 or IBM-witherspoon-sequoia-ibm-OP9_v1.18_1.54) A similar change was made in openpower-pnor-code-mgmt. Change-Id: Ic8cb41ff35117196a134d46eaa4bd476c37abd4c Signed-off-by: Gunnar Mills --- version.hpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/version.hpp b/version.hpp index 1e69a6d..99c64c9 100644 --- a/version.hpp +++ b/version.hpp @@ -15,35 +15,36 @@ namespace manager typedef std::function eraseFunc; using VersionInherit = sdbusplus::server::object::object< - sdbusplus::xyz::openbmc_project::Software::server::Version, - sdbusplus::xyz::openbmc_project::Common::server::FilePath>; + sdbusplus::xyz::openbmc_project::Software::server::Version, + sdbusplus::xyz::openbmc_project::Common::server::FilePath>; /** @class Version * @brief OpenBMC version software management implementation. * @details A concrete implementation for xyz.openbmc_project.Software.Version - * DBus API. + * D-Bus API. */ class Version : public VersionInherit { public: /** @brief Constructs Version Software Manager * - * @param[in] bus - The Dbus bus object - * @param[in] objPath - The Dbus object path - * @param[in] versionId - The version identifier + * @param[in] bus - The D-Bus bus object + * @param[in] objPath - The D-Bus object path + * @param[in] versionString - The version string * @param[in] versionPurpose - The version purpose * @param[in] filePath - The image filesystem path */ Version(sdbusplus::bus::bus& bus, const std::string& objPath, - const std::string& versionId, + const std::string& versionString, VersionPurpose versionPurpose, const std::string& filePath) : VersionInherit( - bus, (objPath).c_str(), true), versionStr(versionId) + bus, (objPath).c_str(), true), + versionStr(versionString) { // Set properties. purpose(versionPurpose); - version(versionId); + version(versionString); path(filePath); // Emit deferred signal. emit_object_added(); @@ -58,19 +59,24 @@ class Version : public VersionInherit std::string key); /** - * @brief Get the Version id. + * @brief Calculate the version id from the version string. + * + * @details The version id is a unique 8 hexadecimal digit id + * calculated from the version string. + * + * @param[in] version - The image's version string (e.g. v1.99.10-19). * * @return The id. - **/ + */ static std::string getId(const std::string& version); /** - * @brief Get the active bmc version identifier. + * @brief Get the active BMC version string. * - * @param[in] releaseFilePath - The Path to file which contains - * the release version. + * @param[in] releaseFilePath - The path to the file which contains + * the release version string. * - * @return The version identifier. + * @return The version string (e.g. v1.99.10-19). */ static std::string getBMCVersion(const std::string& releaseFilePath); -- cgit v1.2.1