FairMQ  1.3.9
C++ Message Passing Framework
Version.h
1 /********************************************************************************
2  * Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef FAIR_MQ_TOOLS_VERSION_H
10 #define FAIR_MQ_TOOLS_VERSION_H
11 
12 #include <ostream>
13 #include <tuple>
14 
15 namespace fair
16 {
17 namespace mq
18 {
19 namespace tools
20 {
21 
22 struct Version
23 {
24  const int fkMajor, fkMinor, fkPatch;
25 
26  friend auto operator< (const Version& lhs, const Version& rhs) -> bool { return std::tie(lhs.fkMajor, lhs.fkMinor, lhs.fkPatch) < std::tie(rhs.fkMajor, rhs.fkMinor, rhs.fkPatch); }
27  friend auto operator> (const Version& lhs, const Version& rhs) -> bool { return rhs < lhs; }
28  friend auto operator<=(const Version& lhs, const Version& rhs) -> bool { return !(lhs > rhs); }
29  friend auto operator>=(const Version& lhs, const Version& rhs) -> bool { return !(lhs < rhs); }
30  friend auto operator==(const Version& lhs, const Version& rhs) -> bool { return std::tie(lhs.fkMajor, lhs.fkMinor, lhs.fkPatch) == std::tie(rhs.fkMajor, rhs.fkMinor, rhs.fkPatch); }
31  friend auto operator!=(const Version& lhs, const Version& rhs) -> bool { return !(lhs == rhs); }
32  friend auto operator<<(std::ostream& os, const Version& v) -> std::ostream& { return os << v.fkMajor << "." << v.fkMinor << "." << v.fkPatch; }
33 };
34 
35 } /* namespace tools */
36 } /* namespace mq */
37 } /* namespace fair */
38 
39 #endif /* FAIR_MQ_TOOLS_VERSION_H */
Tools for interfacing containers to the transport via polymorphic allocators.
Definition: DeviceRunner.h:23
Definition: Version.h:22

privacy