17#ifndef INCLUDED_BMQT_MESSAGEGUID
18#define INCLUDED_BMQT_MESSAGEGUID
76#include <bsl_cstring.h>
78#include <bsl_iosfwd.h>
79#include <bsl_type_traits.h>
80#include <bsla_annotations.h>
82#include <bslmf_isbitwiseequalitycomparable.h>
83#include <bslmf_istriviallycopyable.h>
84#include <bslmf_nestedtraitdeclaration.h>
85#include <bsls_types.h>
101 template <
class HASH_ALGORITHM>
119 bslmf::IsBitwiseEqualityComparable)
120 BSLMF_NESTED_TRAIT_DECLARATION(
MessageGUID, bsl::is_trivially_copyable)
186 void toHex(
char* destination)
const;
201 print(bsl::ostream& stream,
int level = 0,
int spacesPerLevel = 4)
const;
261 bsls::Types::Uint64 d_result;
273 void operator()(
const void* data,
size_t numBytes);
295#ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
303 return 0 == bsl::memcmp(d_buffer, k_UNSET_GUID,
e_SIZE_BINARY);
307template <
class HASH_ALGORITHM>
310 using bslh::hashAppend;
337 BSLA_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:258
MessageGUIDHashAlgo()
Constructor.
Definition bmqt_messageguid.h:330
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:265
Definition bmqt_messageguid.h:96
MessageGUID & fromHex(const char *buffer)
friend bool operator!=(const MessageGUID &lhs, const MessageGUID &rhs)
MessageGUID()
Definition bmqt_messageguid.h:288
bool isUnset() const
Return true if the value of this object is not set.
Definition bmqt_messageguid.h:301
~MessageGUID()
Destructor.
Definition bmqt_messageguid.h:293
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
friend void hashAppend(HASH_ALGORITHM &hashAlgo, const MessageGUID &guid)
Definition bmqt_messageguid.h:308
static bool isValidHexRepresentation(const char *buffer)
friend bool operator==(const MessageGUID &lhs, const MessageGUID &rhs)
void toHex(char *destination) const
Enum
Enum representing the size of a buffer needed to represent a GUID.
Definition bmqt_messageguid.h:108
@ e_SIZE_BINARY
Binary format of the GUID.
Definition bmqt_messageguid.h:110
@ e_SIZE_HEX
Hexadecimal string representation of the GUID.
Definition bmqt_messageguid.h:114
void toBinary(unsigned char *destination) const
MessageGUID & fromBinary(const unsigned char *buffer)
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
Definition bmqa_abstractsession.h:42
This struct provides a binary function for comparing 2 GUIDs.
Definition bmqt_messageguid.h:241
bool operator()(const MessageGUID &lhs, const MessageGUID &rhs) const
Definition bmqt_messageguid.h:318