17 #ifndef INCLUDED_BMQT_MESSAGEGUID
18 #define INCLUDED_BMQT_MESSAGEGUID
76 #include <bsl_cstring.h>
78 #include <bsl_iosfwd.h>
79 #include <bslh_hash.h>
80 #include <bslmf_isbitwiseequalitycomparable.h>
81 #include <bslmf_istriviallycopyable.h>
82 #include <bslmf_nestedtraitdeclaration.h>
83 #include <bsls_annotation.h>
84 #include <bsls_types.h>
100 template <
class HASH_ALGORITHM>
118 bslmf::IsBitwiseEqualityComparable)
119 BSLMF_NESTED_TRAIT_DECLARATION(
MessageGUID, bsl::is_trivially_copyable)
185 void toHex(
char* destination)
const;
200 print(bsl::ostream& stream,
int level = 0,
int spacesPerLevel = 4)
const;
260 bsls::Types::Uint64 d_result;
272 void operator()(
const void* data,
size_t numBytes);
294 #ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
302 return 0 == bsl::memcmp(d_buffer, k_UNSET_GUID,
e_SIZE_BINARY);
306 template <
class HASH_ALGORITHM>
337 BSLS_ANNOTATION_UNUSED
size_t numBytes)
352 inline static bsls::Types::Uint64 mix(bsls::Types::Uint64 x)
354 x *= 0xbf58476d1ce4e5b9ULL;
356 x *= 0x94d049bb133111ebULL;
361 inline static bsls::Types::Uint64 combine(bsls::Types::Uint64 lhs,
362 bsls::Types::Uint64 rhs)
364 lhs ^= rhs + 0x517cc1b727220a95 + (lhs << 6) + (lhs >> 2);
371 bsls::Types::Uint64 parts[2];
374 parts[0] = LocalFuncs::mix(parts[0]);
375 parts[1] = LocalFuncs::mix(parts[1]);
376 d_result = LocalFuncs::combine(parts[0], parts[1]);
395 bsl::memcmp(lhs.d_buffer, rhs.d_buffer, MessageGUID::e_SIZE_BINARY);
401 return !(lhs == rhs);
408 return less(lhs, rhs);
414 return rhs.
print(stream, 0, -1);
Definition: bmqt_messageguid.h:257
MessageGUIDHashAlgo()
Constructor.
Definition: bmqt_messageguid.h:329
void operator()(const void *data, size_t numBytes)
Definition: bmqt_messageguid.h:336
result_type computeHash()
Compute and return the hash for the GUID.
Definition: bmqt_messageguid.h:379
bsls::Types::Uint64 result_type
Definition: bmqt_messageguid.h:264
Definition: bmqt_messageguid.h:95
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
friend bool operator!=(const MessageGUID &lhs, const MessageGUID &rhs)
MessageGUID()
Definition: bmqt_messageguid.h:287
bool isUnset() const
Return true if the value of this object is not set.
Definition: bmqt_messageguid.h:300
MessageGUID & fromBinary(const unsigned char *buffer)
~MessageGUID()
Destructor.
Definition: bmqt_messageguid.h:292
friend void hashAppend(HASH_ALGORITHM &hashAlgo, const MessageGUID &guid)
Definition: bmqt_messageguid.h:307
static bool isValidHexRepresentation(const char *buffer)
friend bool operator==(const MessageGUID &lhs, const MessageGUID &rhs)
void toHex(char *destination) const
MessageGUID & fromHex(const char *buffer)
Enum
Enum representing the size of a buffer needed to represent a GUID.
Definition: bmqt_messageguid.h:107
@ e_SIZE_BINARY
Binary format of the GUID.
Definition: bmqt_messageguid.h:109
@ e_SIZE_HEX
Hexadecimal string representation of the GUID.
Definition: bmqt_messageguid.h:113
void toBinary(unsigned char *destination) const
void hashAppend(HASH_ALGORITHM &hashAlgo, const CorrelationId &value)
Definition: bmqt_correlationid.h:504
bsl::ostream & operator<<(bsl::ostream &stream, CompressionAlgorithmType::Enum value)
Definition: bmqt_compressionalgorithmtype.h:141
bool operator!=(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:582
bool operator==(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:576
bool operator<(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:588
void hashAppend(HASH_ALGORITHM &hashAlgo, const MessageGUID &guid)
Definition: bmqt_messageguid.h:307
Definition: bmqa_abstractsession.h:42
This struct provides a binary function for comparing 2 GUIDs.
Definition: bmqt_messageguid.h:240
bool operator()(const MessageGUID &lhs, const MessageGUID &rhs) const
Definition: bmqt_messageguid.h:317