File indexing completed on 2025-01-18 09:11:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/ActsVersion.hpp"
0010
0011 #include <ostream>
0012 #include <string_view>
0013
0014 namespace Acts {
0015
0016 VersionInfo::VersionInfo(unsigned int majorIn, unsigned int minorIn,
0017 unsigned int patchIn, const char* const commitHashIn)
0018 : versionMajor(majorIn),
0019 versionMinor(minorIn),
0020 versionPatch(patchIn),
0021 commitHash(commitHashIn) {}
0022
0023 VersionInfo VersionInfo::fromLibrary() {
0024
0025
0026 return VersionInfo{VersionMajor, VersionMinor, VersionPatch, CommitHash};
0027 }
0028
0029 bool VersionInfo::operator==(const VersionInfo& other) const {
0030 return versionMajor == other.versionMajor &&
0031 versionMinor == other.versionMinor &&
0032 versionPatch == other.versionPatch &&
0033 std::string_view{commitHash} == std::string_view{other.commitHash};
0034 }
0035
0036 std::ostream& operator<<(std::ostream& os, const VersionInfo& vi) {
0037 os << vi.versionMajor << "." << vi.versionMinor << "." << vi.versionPatch
0038 << " (commit " << vi.commitHash << ")";
0039 return os;
0040 }
0041 }