14#ifndef WPIUTIL_WPI_VERSIONTUPLE_H
15#define WPIUTIL_WPI_VERSIONTUPLE_H
31 unsigned HasMinor : 1;
33 unsigned Subminor : 31;
34 unsigned HasSubminor : 1;
37 unsigned HasBuild : 1;
41 : Major(0), Minor(0), HasMinor(false), Subminor(0), HasSubminor(false),
42 Build(0), HasBuild(false) {}
45 : Major(Major), Minor(0), HasMinor(false), Subminor(0),
46 HasSubminor(false), Build(0), HasBuild(false) {}
49 : Major(Major), Minor(Minor), HasMinor(true), Subminor(0),
50 HasSubminor(false), Build(0), HasBuild(false) {}
52 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor)
53 : Major(Major), Minor(Minor), HasMinor(true), Subminor(Subminor),
54 HasSubminor(true), Build(0), HasBuild(false) {}
56 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor,
58 : Major(Major), Minor(Minor), HasMinor(true), Subminor(Subminor),
59 HasSubminor(true), Build(Build), HasBuild(true) {}
64 return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0;
101 if (Result.Build == 0) {
102 Result.HasBuild =
false;
103 if (Result.Subminor == 0) {
104 Result.HasSubminor =
false;
105 if (Result.Minor == 0)
106 Result.HasMinor =
false;
115 return X.Major == Y.Major && X.Minor == Y.Minor &&
116 X.Subminor == Y.Subminor && X.Build == Y.Build;
132 return std::tie(X.Major, X.Minor, X.Subminor, X.Build) <
133 std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build);
This file defines DenseMapInfo traits for DenseMap.
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:27
friend bool operator<=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes or is equivalent to another.
Definition: VersionTuple.h:149
VersionTuple withoutBuild() const
Return a version tuple that contains only the first 3 version components.
Definition: VersionTuple.h:92
std::optional< unsigned > getBuild() const
Retrieve the build version number, if provided.
Definition: VersionTuple.h:85
VersionTuple(unsigned Major, unsigned Minor)
Definition: VersionTuple.h:48
std::optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
Definition: VersionTuple.h:78
friend bool operator!=(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are not equivalent.
Definition: VersionTuple.h:123
VersionTuple(unsigned Major)
Definition: VersionTuple.h:44
friend bool operator<(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes another.
Definition: VersionTuple.h:131
friend bool operator>=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows or is equivalent to another.
Definition: VersionTuple.h:158
VersionTuple normalize() const
Return a version tuple that contains only components that are non-zero.
Definition: VersionTuple.h:99
std::optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
Definition: VersionTuple.h:71
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
Definition: VersionTuple.h:63
VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build)
Definition: VersionTuple.h:56
unsigned getMajor() const
Retrieve the major version number.
Definition: VersionTuple.h:68
VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor)
Definition: VersionTuple.h:52
friend bool operator==(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are equivalent.
Definition: VersionTuple.h:114
friend bool operator>(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows another.
Definition: VersionTuple.h:140
VersionTuple()
Definition: VersionTuple.h:40
Definition: AprilTagFieldLayout.h:18