summaryrefslogtreecommitdiff
path: root/src/mongo/util/uuid.h
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2017-06-15 00:20:33 -0400
committerGeert Bosch <geert@mongodb.com>2017-06-23 15:11:09 -0400
commita69ae445303fc4821c6745866b3902623a385c1c (patch)
tree177cab03d8078defe675fd0dff15349cc32401c0 /src/mongo/util/uuid.h
parent3bb0f6030b5609002049ea2156e97fe4c6c05d5d (diff)
downloadmongo-a69ae445303fc4821c6745866b3902623a385c1c.tar.gz
SERVER-27992 Use UUIDs for replication
Diffstat (limited to 'src/mongo/util/uuid.h')
-rw-r--r--src/mongo/util/uuid.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/util/uuid.h b/src/mongo/util/uuid.h
index 9e1caa88b6c..0049fe9b665 100644
--- a/src/mongo/util/uuid.h
+++ b/src/mongo/util/uuid.h
@@ -64,7 +64,7 @@ public:
static constexpr int kNumBytes = sizeof(UUIDStorage);
/**
- * Generate a new random v4 UUID per RFC 4122.
+ * Generates a new random v4 UUID per RFC 4122.
*/
static UUID gen();
@@ -81,7 +81,7 @@ public:
static StatusWith<UUID> parse(BSONElement from);
/**
- * Parse a BSON document of the form { uuid: BinData(4, "...") }.
+ * Parses a BSON document of the form { uuid: BinData(4, "...") }.
*
* For IDL.
*/
@@ -107,17 +107,17 @@ public:
}
/**
- * Append to builder as BinData(4, "...") element with the given name.
+ * Appends to builder as BinData(4, "...") element with the given name.
*/
void appendToBuilder(BSONObjBuilder* builder, StringData name) const;
/**
- * Return a BSON object of the form { uuid: BinData(4, "...") }.
+ * Returns a BSON object of the form { uuid: BinData(4, "...") }.
*/
BSONObj toBSON() const;
/**
- * Return a string representation of this UUID, in hexadecimal,
+ * Returns a string representation of this UUID, in hexadecimal,
* as per RFC 4122:
*
* 4 Octets - 2 Octets - 2 Octets - 2 Octets - 6 Octets
@@ -133,6 +133,11 @@ public:
}
/**
+ * Returns true only if the UUID is the RFC 4122 variant, v4 (random).
+ */
+ bool isRFC4122v4() const;
+
+ /**
* Custom hasher so UUIDs can be used in unordered data structures.
*
* ex: std::unordered_set<UUID, UUID::Hash> uuidSet;