diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2020-03-06 15:25:57 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-10 21:57:42 +0000 |
commit | 157f1221f6e2d896fb5968714d84b3da52eab504 (patch) | |
tree | 1f89050f5875e539e1cfd5c7c1cc592babc14083 /src/mongo/util/version.h | |
parent | 8393d898d70421a944adfb39835ec82fe3e3b860 (diff) | |
download | mongo-157f1221f6e2d896fb5968714d84b3da52eab504.tar.gz |
SERVER-46763 structure the VersionInfoInterface tuples
Diffstat (limited to 'src/mongo/util/version.h')
-rw-r--r-- | src/mongo/util/version.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/mongo/util/version.h b/src/mongo/util/version.h index e6726132ced..a9a2f0084cd 100644 --- a/src/mongo/util/version.h +++ b/src/mongo/util/version.h @@ -31,7 +31,6 @@ #define UTIL_VERSION_HEADER #include <string> -#include <tuple> #include <vector> #include "mongo/base/string_data.h" @@ -46,12 +45,21 @@ class BSONObjBuilder; * able to access version information. */ class VersionInfoInterface { - VersionInfoInterface(const VersionInfoInterface&) = delete; - VersionInfoInterface& operator=(const VersionInfoInterface&) = delete; - public: - using BuildInfoTuple = std::tuple<StringData, StringData, bool, bool>; + struct BuildInfoField { + StringData key; + StringData value; + bool inBuildInfo; // included in buildInfo BSON + bool inVersion; // included in --version output + }; + + enum class NotEnabledAction { + kAbortProcess, + kFallback, + }; + VersionInfoInterface(const VersionInfoInterface&) = delete; + VersionInfoInterface& operator=(const VersionInfoInterface&) = delete; virtual ~VersionInfoInterface() = default; /** @@ -60,11 +68,6 @@ public: */ static void enable(const VersionInfoInterface* handler); - enum class NotEnabledAction { - kAbortProcess, - kFallback, - }; - /** * Obtain the currently configured instance of the VersionInfoInterface. By default, if this * method is called and no implementation has been configured with the 'enable' method above, @@ -126,9 +129,9 @@ public: virtual StringData targetMinOS() const noexcept = 0; /** - * Returns a vector of tuples describing build information (e.g. LINKFLAGS, compiler, etc.). + * Returns build information (e.g. LINKFLAGS, compiler, etc.). */ - virtual std::vector<BuildInfoTuple> buildInfo() const = 0; + virtual std::vector<BuildInfoField> buildInfo() const = 0; /** * Returns the version of OpenSSL in use, if any, adorned with the provided prefix and suffix. |