libbmq
a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
|
Provide a value-semantic global unique identifier for BlazingMQ messages. More...
#include <bsl_cstring.h>
#include <bsl_iosfwd.h>
#include <bslh_hash.h>
#include <bslmf_isbitwiseequalitycomparable.h>
#include <bslmf_istriviallycopyable.h>
#include <bslmf_nestedtraitdeclaration.h>
#include <bsls_annotation.h>
#include <bsls_types.h>
Go to the source code of this file.
Classes | |
class | BloombergLP::bmqt::MessageGUID |
struct | BloombergLP::bmqt::MessageGUIDLess |
This struct provides a binary function for comparing 2 GUIDs. More... | |
class | BloombergLP::bmqt::MessageGUIDHashAlgo |
Namespaces | |
BloombergLP | |
BloombergLP::bmqt | |
Functions | |
bsl::ostream & | BloombergLP::bmqt::operator<< (bsl::ostream &stream, const MessageGUID &rhs) |
bool | BloombergLP::bmqt::operator== (const MessageGUID &lhs, const MessageGUID &rhs) |
bool | BloombergLP::bmqt::operator!= (const MessageGUID &lhs, const MessageGUID &rhs) |
bool | BloombergLP::bmqt::operator< (const MessageGUID &lhs, const MessageGUID &rhs) |
template<class HASH_ALGORITHM > | |
void | BloombergLP::bmqt::hashAppend (HASH_ALGORITHM &hashAlgo, const MessageGUID &guid) |
bmqt::MessageGUID provides a value-semantic global unique identifier for BlazingMQ messages. Each bmqa::Message delivered to BlazingMQ client from BlazingMQ broker contains a unique bmqt::MessageGUID. The binary functor bmqt::MessageGUIDLess can be used for comparing GUIDs, and an optimized custom hash function is provided with bmqt::MessageGUIDHashAlgo.
For convenience, this class provides toHex
method that can be used to externalize a bmqt::MessageGUID instance. Applications can persist the resultant buffer (on filesystem, in database) to keep track of last processed message ID across task instantiations. fromHex
method can be used to convert a valid externalized buffer back to a message ID.
This component also provides efficient comparison and hash functions for convenience, and thus, applications can use this component as a key in associative containers.
This section illustrates intended use of this component.