libbmq
a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
|
#include <bmqt_messageguid.h>
Public Types | |
enum | Enum { e_SIZE_BINARY = 16 , e_SIZE_HEX = 2 * e_SIZE_BINARY } |
Enum representing the size of a buffer needed to represent a GUID. More... | |
Public Member Functions | |
MessageGUID () | |
~MessageGUID () | |
Destructor. More... | |
MessageGUID & | fromBinary (const unsigned char *buffer) |
MessageGUID & | fromHex (const char *buffer) |
bool | isUnset () const |
Return true if the value of this object is not set. More... | |
void | toBinary (unsigned char *destination) const |
void | toHex (char *destination) const |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Static Public Member Functions | |
static bool | isValidHexRepresentation (const char *buffer) |
Friends | |
struct | MessageGUIDLess |
bool | operator== (const MessageGUID &lhs, const MessageGUID &rhs) |
bool | operator!= (const MessageGUID &lhs, const MessageGUID &rhs) |
template<class HASH_ALGORITHM > | |
void | hashAppend (HASH_ALGORITHM &hashAlgo, const MessageGUID &guid) |
This class provides a value-semantic type to represent a global unique ID for BlazingMQ messages.
|
inline |
Create an un-initialized MessageGUID. Note that isUnset()
would return true.
References e_SIZE_BINARY.
|
inline |
References e_SIZE_BINARY.
|
static |
Return true if the specified buffer
is a valid hex representation of a MessageGUID. The behavior is undefined unless buffer
is non-null and length of the buffer
is equal to e_SIZE_HEX
.
MessageGUID& BloombergLP::bmqt::MessageGUID::fromBinary | ( | const unsigned char * | buffer | ) |
Initialize this MessageGUID with the binary representation from the specified buffer
, in binary format. Behavior is undefined unless buffer
is non-null and of length e_SIZE_BINARY
. Return a reference offering modifiable access to this object.
MessageGUID& BloombergLP::bmqt::MessageGUID::fromHex | ( | const char * | buffer | ) |
Initialize this MessageGUID with the hexadecimal representation from the specified buffer
. Behavior is undefined unless isValidHexRepresentation()
returns true for the provided buffer
. Return a reference offering modifiable access to this object.
|
inline |
References e_SIZE_BINARY.
void BloombergLP::bmqt::MessageGUID::toBinary | ( | unsigned char * | destination | ) | const |
Write the binary representation of this object to the specified destination
. Behavior is undefined unless destination
is of length e_SIZE_BINARY
. Note that destination
can later be used to populate a MessageGUID object using fromBinary
method.
void BloombergLP::bmqt::MessageGUID::toHex | ( | char * | destination | ) | const |
Write the hex representation of this object to the specified destination
. Behavior is undefined unless destination
is of length e_SIZE_HEX
. Note that destination
can later be used to populate a MessageGUID object using fromHex
method.
bsl::ostream& BloombergLP::bmqt::MessageGUID::print | ( | bsl::ostream & | stream, |
int | level = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Write the value of this object to the specified output stream
in a human-readable format, and return a reference to stream
. Optionally specify an initial indentation level
. If level
is specified, optionally specify spacesPerLevel
, whose absolute value indicates the number of spaces per indentation level for this object. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
). If stream
is not valid on entry, this operation has no effect. Note that this human-readable format is not fully specified, and can change without notice. Applications relying on a fixed length format must use toHex
method.
Referenced by BloombergLP::bmqt::operator<<().
|
friend |
|
friend |
Return true
if rhs
object contains the value of the same type as contained in lhs
object and the value itself is the same in both objects, return false otherwise.
|
friend |
Return false
if rhs
object contains the value of the same type as contained in lhs
object and the value itself is the same in both objects, return true
otherwise.
|
friend |