BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlb_guid.h
Go to the documentation of this file.
1/// @file bdlb_guid.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlb_guid.h -*-C++-*-
8#ifndef INCLUDED_BDLB_GUID
9#define INCLUDED_BDLB_GUID
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13#include <bdlscm_version.h>
14
15/// @defgroup bdlb_guid bdlb_guid
16/// @brief Provide a value-semantic type for Globally Unique Identifiers.
17/// @addtogroup bdl
18/// @{
19/// @addtogroup bdlb
20/// @{
21/// @addtogroup bdlb_guid
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#bdlb_guid-purpose"> Purpose</a>
26/// * <a href="#bdlb_guid-classes"> Classes </a>
27/// * <a href="#bdlb_guid-description"> Description </a>
28/// * <a href="#bdlb_guid-usage"> Usage </a>
29///
30/// # Purpose {#bdlb_guid-purpose}
31/// Provide a value-semantic type for Globally Unique Identifiers.
32///
33/// # Classes {#bdlb_guid-classes}
34///
35/// - bdlb::Guid: value-semantic type to represent Globally Unique Identifiers
36///
37/// @see bdlb_guidutil
38///
39/// # Description {#bdlb_guid-description}
40/// This component provides a value-semantic type for Globally
41/// Unique Identifiers (GUIDs), `bdlb::Guid`, with format as described by RFC
42/// 4122 (`http://www.ietf.org/rfc/rfc4122.txt`). All equality and comparison
43/// methods are defined for these GUIDs. Note that this component does not
44/// provide the facilities to generate GUIDs, and thus makes no guarantees of
45/// uniqueness or randomness.
46///
47/// ## Usage {#bdlb_guid-usage}
48///
49///
50/// Suppose we are building a utility to create globally unique names which may
51/// be based on a common base name, such as a code-generator.
52///
53/// First, let us define the core types needed, the first of which is a utility
54/// to allocate GUIDs.
55/// @code
56/// /// This struct provides a namespace for methods to generate GUIDs.
57/// struct MyGuidGeneratorUtil {
58///
59/// // CLASS METHODS
60///
61/// /// Generate a version 1 GUID, placing the value into the
62/// /// specified 'guid' pointer. Return 0 on success, and non-zero
63/// /// otherwise.
64/// static int generate(bdlb::Guid *guid);
65/// };
66///
67/// // CLASS METHODS
68/// inline
69/// int my_GuidGeneratorUtil::generate(bdlb::Guid *guid)
70/// {
71/// // For brevity, we use a static sequence of pre-generated GUIDs.
72///
73/// static unsigned char GUIDS[][bdlb::Guid::k_GUID_NUM_BYTES] = {
74/// { 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe,
75/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
76///
77/// { 0x5c, 0x9d, 0x4e, 0x51, 0x0d, 0xf1, 0x11, 0xe4,
78/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
79///
80/// { 0x5c, 0x9d, 0x4e, 0x52, 0x0d, 0xf1, 0x11, 0xe4,
81/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
82///
83/// { 0x5c, 0x9d, 0x4e, 0x53, 0x0d, 0xf1, 0x11, 0xe4,
84/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
85///
86/// { 0x5c, 0x9d, 0x4e, 0x54, 0x0d, 0xf1, 0x11, 0xe4,
87/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
88///
89/// { 0x5c, 0x9d, 0x4e, 0x55, 0x0d, 0xf1, 0x11, 0xe4,
90/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
91///
92/// { 0x5c, 0x9d, 0x4e, 0x56, 0x0d, 0xf1, 0x11, 0xe4,
93/// 0x91, 0x91, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 },
94/// };
95///
96/// const bsl::size_t NUM_GUIDS = sizeof GUIDS / sizeof *GUIDS;
97///
98/// static bsl::size_t nextGuidIdx = 0;
99///
100/// int rval = -1;
101/// if (nextGuidIdx++ < NUM_GUIDS) {
102/// *guid = bdlb::Guid(GUIDS[nextGuidIdx]);
103/// rval = 0;
104/// }
105/// return rval;
106/// }
107/// @endcode
108/// Next, we create a utility to create unique strings.
109/// @code
110/// /// This struct provides methods to create globally unique strings.
111/// struct UniqueStringGenerator {
112///
113/// /// Create a globally unique string from the specified non-unique
114/// /// 'base' string, placing the result into the specified 'unique'
115/// /// string pointer.
116/// static int uniqueStringFromBase(bsl::string *unique,
117/// const bsl::string& base);
118/// };
119///
120/// int
121/// UniqueStringGenerator::uniqueStringFromBase(bsl::string *unique,
122/// const bsl::string& base,)
123/// {
124/// bdlb::Guid guid;
125///
126/// int rval = my_GuidGeneratorUtil::generate(&guid);
127/// if (rval == 0) {
128/// {
129/// ostringstream convert;
130/// convert << base << "-" << guid;
131/// *unique = convert.str();
132/// }
133/// return rval;
134/// }
135/// @endcode
136/// Finally, we implement a program to generate unique names for a code
137/// auto-generator.
138/// @code
139/// bsl::string baseFileName = "foo.cpp";
140/// bsl::string uniqueFileName;
141/// bsl::string previousFileName;
142///
143/// const bsl::size_t NUM_FILES = 5;
144/// for (bsl::size_t i = 0; i < NUM_FILES; ++i) {
145/// UniqueStringGenerator::uniqueStringFromBase(&uniqueFileName,
146/// baseFileName);
147/// assert(previousFileName != uniqueFileName);
148/// previousFileName = uniqueFileName;
149/// }
150/// @endcode
151/// @}
152/** @} */
153/** @} */
154
155/** @addtogroup bdl
156 * @{
157 */
158/** @addtogroup bdlb
159 * @{
160 */
161/** @addtogroup bdlb_guid
162 * @{
163 */
164
165#include <bslmf_assert.h>
169
170#include <bsls_alignedbuffer.h>
172#include <bsls_assert.h>
173#include <bsls_review.h>
174#include <bsls_types.h>
175
176#include <bsl_algorithm.h>
177#include <bsl_cstddef.h>
178#include <bsl_cstdint.h>
179#include <bsl_cstring.h>
180#include <bsl_iosfwd.h>
181#include <bsl_span.h>
182
183
184namespace bdlb {
185 // ==========
186 // bdlb::Guid
187 // ==========
188
189/// This class implements a value-semantic `Guid` type. Each object
190/// represents an unconstrained `Guid` object, but its uniqueness is *not*
191/// guaranteed, and this component provides no ability to generate a GUID.
192///
193/// This class provides a constructor and several accessors with names and
194/// parameters phrased using RFC 4122 field names. These names are used (by
195/// RFC 4122 and this component) as designators for parts of the GUID even
196/// when those names do not accurately describe the parts (for example,
197/// `time low` names bytes 0-3 of the GUID regardless of whether the values
198/// of those bytes come from a clock or are generated randomly).
199///
200/// See @ref bdlb_guid
201class Guid {
202
203 public:
204 // CLASS DATA
205 enum { k_GUID_NUM_BYTES = 16 }; // number of bytes in a guid
206 enum { k_GUID_NUM_32BITS = 4 }; // number of 32-bits in a guid
207 enum { k_GUID_NUM_CHARS = 36 }; // number of formatted chars
208
209 // TRAITS
212
213 private:
214 // DATA
215
216 // byte array to hold the guid
219 d_alignedBuffer;
220
221 // FRIENDS
222 friend bool operator==(const Guid& lhs, const Guid& rhs);
223 friend bool operator!=(const Guid& lhs, const Guid& rhs);
224
225 // PRIVATE MANIPULATORS
226
227 /// Return a pointer offering modifiable access to the most significant
228 /// byte of this guid object.
229 unsigned char *modifiableData();
230
231 public:
232 // CREATORS
233
234 /// Construct a zero-initialized guid object.
235 /// \note Note that a zero-
236 /// initialized guid object is not a GUID according to RFC 4122.
237 Guid();
238
239 /// Destroy this object
240 ~Guid() = default;
241
242 /// Construct a guid object with the internal buffer set equal to the
243 /// specified `buffer` with the first byte representing the most significant byte.
244 ///
245 /// \note Note that this method does guarantee that the
246 /// created guid object is a GUID.
247 explicit Guid(const unsigned char (&buffer)[k_GUID_NUM_BYTES]);
248
249 /// Construct a guid object with an internal buffer composed from the
250 /// specified `timeLow`, `timeMid`, `timeHiAndVersion`, `clockSeqHiRes`, `clockSeqLow`, and `node` as specified by RFC 4122.
251 ///
252 /// \note Note that only
253 /// the least significant 48 bits of `node` are used in constructing
254 /// the guid.
255 Guid(unsigned long timeLow,
256 unsigned short timeMid,
257 unsigned short timeHiAndVersion,
258 unsigned char clockSeqHiRes,
259 unsigned char clockSeqLow,
261
262 /// Construct a guid object having the same value as the specified
263 /// 'original' object.
264 Guid(const Guid& original) = default;
265
266 // MANIPULATORS
267
268 /// Assign to this guid object the value of the specified 'rhs' and
269 /// return a reference to this modifiable object.
270 Guid& operator=(const Guid& rhs) = default;
271
272 /// Assign to the buffer of this guid the byte sequence in the specified
273 /// `buffer`.
274 Guid& operator=(const unsigned char (&buffer)[k_GUID_NUM_BYTES]);
275
276 /// Assign to the buffer of this guid the byte sequence in the specified `buffer`.
277 ///
278 /// \note Note that `buffer` is treated as purely a sequence of
279 /// bytes, and no account is taken of endianness.
280 Guid& operator=(const bsl::uint32_t (&buffer)[k_GUID_NUM_32BITS]);
281
282 // ACCESSORS
283
284 /// Return a reference offering unmodifiable access to the byte at the
285 /// specified `offset` from the most significant byte of this guid object.
286 ///
287 /// \pre The behavior is undefined unless
288 /// `0 <= offset < k_GUID_NUM_BYTES`.
289 const unsigned char& operator[](bsl::size_t offset) const;
290
291 const unsigned char *begin() const;
292
293 /// Return a pointer offering unmodifiable access to the most
294 /// significant byte of this guid object.
295 const unsigned char *data() const;
296
297 /// Return a pointer one past the end of the least significant byte of
298 /// this guid object.
299 const unsigned char *end() const;
300
301 // RFC 4122 FIELD ACCESSORS
302
303 /// Return the 5-bit value of the @ref clk_seq_hi_res field of this guid as
304 /// specified in RFC 4122, excluding the variant bits.
305 unsigned char clockSeqHi() const;
306
307 /// Return the 8-bit @ref clk_seq_hi_res field of this guid as specified in
308 /// RFC 4122.
309 unsigned char clockSeqHiRes() const;
310
311 /// Return the 8-bit @ref clk_seq_low field of this guid as specified in
312 /// RFC 4122.
313 unsigned char clockSeqLow() const;
314
315 /// Return the 48-bit `node` field of this guid as specified in RFC
316 /// 4122.
318
319 /// Return the 12-bit value of the @ref time_hi_and_version field of this
320 /// guid as specified in RFC 4122, excluding the `version` bits.
321 unsigned short timeHi() const;
322
323 /// Return the 16-bit @ref time_hi_and_version field of this guid as
324 /// specified in RFC 4122.
325 unsigned short timeHiAndVersion() const;
326
327 /// Return the 32-bit `time_low` field of this guid as specified in RFC
328 /// 4122.
329 unsigned long timeLow() const;
330
331 /// Return the 16-bit `time_mid` field of this guid as specified in RFC
332 /// 4122.
333 unsigned short timeMid() const;
334
335 /// Return the 3-bit `variant` portion of the @ref clk_seq_hi_res field of
336 /// this guid as specified in RFC 4122.
337 unsigned char variant() const;
338
339 /// Return the four-bit `version` portion of the @ref time_hi_and_version
340 /// field of this guid as specified in RFC 4122.
341 unsigned char version() const;
342
343 /// Write the value of this object to the specified output `buffer` in a human-readable format.
344 ///
345 /// \note Note that this human-readable format is not
346 /// fully specified, and can change without notice (as can
347 /// `k_GUID_NUM_CHARS`). No trailing null terminator is written.
348 void format(bsl::span<char, k_GUID_NUM_CHARS> buffer) const;
349
350 // ASPECTS
351
352 /// Write the value of this object to the specified output `stream` in a
353 /// human-readable format, and return a reference to `stream`.
354 /// Optionally specify an initial indentation `level`, whose absolute
355 /// value is incremented recursively for nested objects. If `level` is
356 /// specified, optionally specify `spacesPerLevel`, whose absolute value
357 /// indicates the number of spaces per indentation level for this and
358 /// all of its nested objects. If `level` is negative, suppress
359 /// indentation of the first line. If `spacesPerLevel` is negative,
360 /// format the entire output on one line, suppressing all but the
361 /// initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect.
362 ///
363 /// \note Note that this
364 /// human-readable format is not fully specified, and can change without
365 /// notice.
366 bsl::ostream& print(bsl::ostream& stream,
367 int level = 0,
368 int spacesPerLevel = 4) const;
369};
370
371// FREE OPERATORS
372
373/// Return `true` if the specified `lhs` and specified `rhs` guid objects
374/// have the same value, and `false` otherwise. Two guid objects have the
375/// same value if each corresponding byte in their internal buffers are
376/// equal.
377bool operator==(const Guid& lhs, const Guid& rhs);
378
379/// Return `true` if the specified `lhs` and specified `rhs` guid objects
380/// have different values, and `false` otherwise. Two guid objects have
381/// different value if any of corresponding byte in their internal buffers
382/// differ.
383bool operator!=(const Guid& lhs, const Guid& rhs);
384
385/// Return `true` if the value of the specified `lhs` guid object is less
386/// than the value of the specified `rhs` guid object, and `false` otherwise.
387///
388/// \note Note that the comparison is accomplished using a
389/// lexicographic comparison of the internal representations.
390bool operator< (const Guid& lhs, const Guid& rhs);
391
392/// Return `true` if the value of the specified `lhs` guid object is less
393/// than or equal to the value of the specified `rhs` guid object, and `false` otherwise.
394///
395/// \note Note that the comparison is accomplished using a
396/// lexicographic comparison of the internal representations.
397bool operator<=(const Guid& lhs, const Guid& rhs);
398
399/// Return `true` if the value of the specified `lhs` guid object is greater
400/// than the value of the specified `rhs` guid object, and `false` otherwise.
401///
402/// \note Note that the comparison is accomplished using a
403/// lexicographic comparison of the internal representations.
404bool operator> (const Guid& lhs, const Guid& rhs);
405
406/// Return `true` if the value of the specified `lhs` guid object is greater
407/// than or equal to the value of the specified `rhs` guid object, and `false` otherwise.
408///
409/// \note Note that the comparison is accomplished using a
410/// lexicographic comparison of the internal representations.
411bool operator>=(const Guid& lhs, const Guid& rhs);
412
413/// Write the value of the specified `guid` object to the specified output
414/// `stream` in a single-line format, and return a reference to `stream`.
415/// If `stream` is not valid on entry, this operation has no effect.
416///
417/// \note Note that this human-readable format is not fully specified, can change
418/// without notice, and is logically equivalent to:
419/// @code
420/// print(stream, 0, -1);
421/// @endcode
422bsl::ostream& operator<<(bsl::ostream& stream, const Guid& guid);
423
424/// Invoke the specified `hashAlgorithm` on the underlying buffer held by
425/// the specified `guid` object.
426template <class HASH_ALGORITHM>
427void hashAppend(HASH_ALGORITHM& hashAlgorithm, const Guid& guid);
428
429// ============================================================================
430// INLINE DEFINITIONS
431// ============================================================================
432
433 // ----------
434 // bdlb::Guid
435 // ----------
436// CREATORS
437inline
439{
440 BSLMF_ASSERT(sizeof(d_alignedBuffer) >= k_GUID_NUM_BYTES);
441
442 bsl::fill(modifiableData(), modifiableData() + k_GUID_NUM_BYTES, 0);
443}
444
445inline
446Guid::Guid(const unsigned char (&buffer)[k_GUID_NUM_BYTES])
447{
448 BSLMF_ASSERT(sizeof(d_alignedBuffer) >= k_GUID_NUM_BYTES);
449
450 bsl::copy(buffer, buffer + k_GUID_NUM_BYTES, modifiableData());
451}
452
453inline Guid::Guid(unsigned long timeLow,
454 unsigned short timeMid,
455 unsigned short timeHiAndVersion,
456 unsigned char clockSeqHiRes,
457 unsigned char clockSeqLow,
459{
460 typedef unsigned char uc;
461
462 modifiableData()[ 0] = uc(timeLow >> 24);
463 modifiableData()[ 1] = uc(timeLow >> 16);
464 modifiableData()[ 2] = uc(timeLow >> 8);
465 modifiableData()[ 3] = uc(timeLow);
466
467 modifiableData()[ 4] = uc(timeMid >> 8);
468 modifiableData()[ 5] = uc(timeMid);
469
470 modifiableData()[ 6] = uc(timeHiAndVersion >> 8);
471 modifiableData()[ 7] = uc(timeHiAndVersion);
472
473 modifiableData()[ 8] = uc(clockSeqHiRes);
474
475 modifiableData()[ 9] = uc(clockSeqLow);
476
477 modifiableData()[10] = uc(node >> 40);
478 modifiableData()[11] = uc(node >> 32);
479 modifiableData()[12] = uc(node >> 24);
480 modifiableData()[13] = uc(node >> 16);
481 modifiableData()[14] = uc(node >> 8);
482 modifiableData()[15] = uc(node);
483}
484
485// PRIVATE MANIPULATORS
486inline
487unsigned char *Guid::modifiableData()
488{
489 return reinterpret_cast<unsigned char *>(d_alignedBuffer.buffer());
490}
491
492// MANIPULATORS
493inline
494Guid& Guid::operator=(const unsigned char (&buffer)[k_GUID_NUM_BYTES])
495{
496 BSLMF_ASSERT(sizeof(d_alignedBuffer) >= k_GUID_NUM_BYTES);
497
498 memcpy(modifiableData(), buffer, k_GUID_NUM_BYTES);
499 return *this;
500}
501
502inline
503Guid& Guid::operator=(const bsl::uint32_t (&buffer)[k_GUID_NUM_32BITS])
504{
505 BSLMF_ASSERT(sizeof(d_alignedBuffer) >= sizeof(uint32_t) *
507
508 memcpy(modifiableData(), buffer, k_GUID_NUM_BYTES);
509 return *this;
510}
511
512// ACCESSORS
513inline
514const unsigned char& Guid::operator[](bsl::size_t offset) const
515{
517 return data()[offset];
518}
519
520inline
521const unsigned char *Guid::begin() const
522{
523 return data();
524}
525
526inline
527const unsigned char *Guid::data() const
528{
529 return reinterpret_cast<const unsigned char *>(d_alignedBuffer.buffer());
530}
531
532inline
533const unsigned char *Guid::end() const
534{
535 return data() + k_GUID_NUM_BYTES;
536}
537
538 // RFC 4122 FIELD ACCESSORS
539
540inline
541unsigned char Guid::clockSeqHi() const
542{
543 return clockSeqHiRes() & 0x1F;
544}
545
546inline
547unsigned char Guid::clockSeqHiRes() const
548{
549 return data()[8];
550}
551
552inline
553unsigned char Guid::clockSeqLow() const
554{
555 return data()[9];
556}
557
558inline
560{
561 return bsls::Types::Uint64(data()[10]) << 40 |
562 bsls::Types::Uint64(data()[11]) << 32 |
563 bsls::Types::Uint64(data()[12]) << 24 |
564 bsls::Types::Uint64(data()[13]) << 16 |
565 bsls::Types::Uint64(data()[14]) << 8 |
566 data()[15];
567}
568
569inline
570unsigned short Guid::timeHi() const
571{
572 return timeHiAndVersion() & 0x0FFF;
573}
574
575inline
576unsigned short Guid::timeHiAndVersion() const
577{
578 typedef unsigned short us;
579 return us(data()[6] << 8 |
580 data()[7]);
581}
582
583inline
584unsigned long Guid::timeLow() const {
585 typedef unsigned long ul;
586 return ul(data()[0]) << 24 |
587 data()[1] << 16 |
588 data()[2] << 8 |
589 data()[3];
590}
591
592inline
593unsigned short Guid::timeMid() const {
594 typedef unsigned short us;
595 return us(data()[4] << 8 |
596 data()[5]);
597}
598
599inline
600unsigned char Guid::variant() const {
601 typedef unsigned char uc;
602 return uc(clockSeqHiRes() >> 5);
603}
604
605inline
606unsigned char Guid::version() const {
607 typedef unsigned char uc;
608 return uc(timeHiAndVersion() >> 12);
609}
610
611} // close package namespace
612
613// FREE OPERATORS
614inline
615bsl::ostream& bdlb::operator<<(bsl::ostream& stream, const bdlb::Guid& guid)
616{
617 return guid.print(stream, 0, -1);
618}
619
620inline
621bool bdlb::operator==(const bdlb::Guid& lhs, const bdlb::Guid& rhs)
622{
623 return bsl::equal(
624 lhs.data(), lhs.data() + lhs.k_GUID_NUM_BYTES, rhs.data());
625}
626
627inline
628bool bdlb::operator!=(const bdlb::Guid& lhs, const bdlb::Guid& rhs)
629{
630 return !bsl::equal(
631 lhs.data(), lhs.data() + lhs.k_GUID_NUM_BYTES, rhs.data());
632}
633
634template <class HASH_ALGORITHM>
635void bdlb::hashAppend(HASH_ALGORITHM& hashAlgorithm, const Guid& guid)
636{
637 hashAlgorithm(guid.data(), Guid::k_GUID_NUM_BYTES);
638}
639
640
641
642#endif
643
644// ----------------------------------------------------------------------------
645// Copyright 2015 Bloomberg Finance L.P.
646//
647// Licensed under the Apache License, Version 2.0 (the "License");
648// you may not use this file except in compliance with the License.
649// You may obtain a copy of the License at
650//
651// http://www.apache.org/licenses/LICENSE-2.0
652//
653// Unless required by applicable law or agreed to in writing, software
654// distributed under the License is distributed on an "AS IS" BASIS,
655// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
656// See the License for the specific language governing permissions and
657// limitations under the License.
658// ----------------------------- END-OF-FILE ----------------------------------
659
660/** @} */
661/** @} */
662/** @} */
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bdlb_guid.h:201
const unsigned char * data() const
Definition bdlb_guid.h:527
unsigned short timeMid() const
Definition bdlb_guid.h:593
unsigned char clockSeqHiRes() const
Definition bdlb_guid.h:547
@ k_GUID_NUM_BYTES
Definition bdlb_guid.h:205
const unsigned char * begin() const
Definition bdlb_guid.h:521
Guid()
Definition bdlb_guid.h:438
@ k_GUID_NUM_32BITS
Definition bdlb_guid.h:206
void format(bsl::span< char, k_GUID_NUM_CHARS > buffer) const
Guid & operator=(const Guid &rhs)=default
unsigned short timeHiAndVersion() const
Definition bdlb_guid.h:576
friend bool operator!=(const Guid &lhs, const Guid &rhs)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
unsigned char clockSeqHi() const
Definition bdlb_guid.h:541
friend bool operator==(const Guid &lhs, const Guid &rhs)
unsigned char clockSeqLow() const
Definition bdlb_guid.h:553
unsigned char variant() const
Definition bdlb_guid.h:600
unsigned long timeLow() const
Definition bdlb_guid.h:584
Guid(const Guid &original)=default
unsigned char version() const
Definition bdlb_guid.h:606
const unsigned char & operator[](bsl::size_t offset) const
Definition bdlb_guid.h:514
const unsigned char * end() const
Definition bdlb_guid.h:533
bsls::Types::Uint64 node() const
Definition bdlb_guid.h:559
unsigned short timeHi() const
Definition bdlb_guid.h:570
~Guid()=default
Destroy this object.
@ k_GUID_NUM_CHARS
Definition bdlb_guid.h:207
Definition bsls_alignedbuffer.h:262
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlb_algorithmworkaroundutil.h:74
bool operator!=(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const BigEndianInt16 &integer)
bool operator>=(const Guid &lhs, const Guid &rhs)
void hashAppend(HASH_ALGORITHM &hashAlgorithm, const BigEndianInt16 &object)
bool operator<=(const Guid &lhs, const Guid &rhs)
bool operator==(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
Definition bslmf_istriviallycopyable.h:324
Definition bslmf_isbitwiseequalitycomparable.h:500
Definition bsls_alignmentfromtype.h:378
unsigned long long Uint64
Definition bsls_types.h:139