Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:33

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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   // this is filled by the Core shared library
0025   // while the constants below depend on the include
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 }  // namespace Acts