16#ifndef IOX_POSH_VERSION_VERSION_INFO_HPP
17#define IOX_POSH_VERSION_VERSION_INFO_HPP
19#include "iceoryx_hoofs/cxx/helplets.hpp"
20#include "iceoryx_hoofs/cxx/serialization.hpp"
21#include "iceoryx_hoofs/cxx/string.hpp"
22#include "iceoryx_posh/iceoryx_posh_types.hpp"
23#include "iceoryx_posh/version/compatibility_check_level.hpp"
24#include "iceoryx_versions.hpp"
44 VersionInfo(
const uint16_t versionMajor,
45 const uint16_t versionMinor,
46 const uint16_t versionPatch,
47 const uint16_t versionTweak,
48 const BuildDateString_t& buildDateString,
49 const CommitIdString_t& commitIdString)
noexcept;
53 VersionInfo(
const cxx::Serialization& serial)
noexcept;
56 operator cxx::Serialization() const noexcept;
60 bool operator==(const VersionInfo& rhs) const noexcept;
64 bool operator!=(const VersionInfo& rhs) const noexcept;
69 bool checkCompatibility(const VersionInfo& other,
70 const CompatibilityCheckLevel compatibilityCheckLevel) const noexcept;
74 bool isValid() noexcept;
78 static VersionInfo getCurrentVersion() noexcept;
81 static const uint64_t SERIALIZATION_STRING_SIZE = 100u;
82 using SerializationString_t = cxx::
string<SERIALIZATION_STRING_SIZE>;
84 static_assert(COMMIT_ID_STRING_SIZE <= SERIALIZATION_STRING_SIZE, "CommitId needs to transfered completely.");
85 static_assert(COMMIT_ID_STRING_SIZE <= BUILD_DATE_STRING_SIZE, "BuildDate needs to transfered completely.");
86 static_assert(cxx::strlen2(ICEORYX_BUILDDATE) < BUILD_DATE_STRING_SIZE,
87 "COMMIT_BUILD_DATE_STRING_SIZE needs to be bigger.");
91 uint16_t m_versionMajor{0u};
92 uint16_t m_versionMinor{0u};
93 uint16_t m_versionPatch{0u};
94 uint16_t m_versionTweak{0u};
95 BuildDateString_t m_buildDateString;
96 CommitIdString_t m_commitIdString;