C++ Actor Framework 0.19
|
A universally unique identifier according to RFC 4122. More...
#include <uuid.hpp>
Public Types | |
enum | variant_field { reserved , rfc4122 , microsoft } |
Denotes the variant (type) that determines the layout of the UUID. More... | |
enum | version_field { time_based = 1 , dce_compatible = 2 , md5_based = 3 , randomized = 4 , sha1_based = 5 } |
Denotes the version, i.e., which algorithm was used to create this UUID. More... | |
using | array_type = std::array< std::byte, 16 > |
Public Member Functions | |
uuid () noexcept | |
Creates the nil UUID with all 128 bits set to zero. | |
uuid (const uuid &) noexcept=default | |
uuid & | operator= (const uuid &) noexcept=default |
uuid (const array_type &bytes) noexcept | |
const array_type & | bytes () const noexcept |
array_type & | bytes () noexcept |
operator bool () const noexcept | |
Returns true if this UUID is not nil , false otherwise. | |
bool | operator! () const noexcept |
Returns true if this UUID is nil , false otherwise. | |
variant_field | variant () const noexcept |
Returns the variant (type) that determines the layout of the UUID. | |
version_field | version () const noexcept |
Returns the version (sub type) that identifies the algorithm used to generate this UUID. | |
uint64_t | timestamp () const noexcept |
The 60-bit timestamp of a time-based UUID. | |
uint16_t | clock_sequence () const noexcept |
The 14-bit unsigned integer helps to avoid duplicates that could arise when the clock is set backwards in time or if the node ID changes. | |
uint64_t | node () const noexcept |
48-bit value, representing a network address (time_based UUIDs), a hash (md5_based and sha1_based UUIDs), or a random bit sequence (randomized UUIDs). | |
size_t | hash () const noexcept |
Returns a platform-specific hash value for this UUID. | |
int | compare (const uuid &other) const noexcept |
Lexicographically compares this and other . | |
Static Public Member Functions | |
static uuid | random () noexcept |
Creates a random UUID. | |
static uuid | random (unsigned seed) noexcept |
Creates a random UUID with a predefined seed. | |
static uuid | nil () noexcept |
Convenience function for creating an UUID with all 128 bits set to zero. | |
static bool | can_parse (std::string_view str) noexcept |
Returns whether parse would produce a valid UUID. | |
Related Symbols | |
(Note that these are not member symbols.) | |
CAF_CORE_EXPORT error | parse (std::string_view str, uuid &dest) |
CAF_CORE_EXPORT std::string | to_string (const uuid &x) |
CAF_CORE_EXPORT expected< uuid > | make_uuid (std::string_view str) |
template<class Inspector > | |
bool | inspect (Inspector &f, uuid &x) |
A universally unique identifier according to RFC 4122.
While this implementation can read all UUID versions, it can only create random-generated ones.
Denotes the variant (type) that determines the layout of the UUID.
The interpretation of all other bits in a UUID depend on this field.
Denotes the version, i.e., which algorithm was used to create this UUID.
|
noexcept |
The 14-bit unsigned integer helps to avoid duplicates that could arise when the clock is set backwards in time or if the node ID changes.
version() == time_based
|
noexcept |
Lexicographically compares this
and other
.
*this < other
, zero if *this == other
and a positive number if *this > other
.
|
noexcept |
Returns true
if this UUID is not nil
, false
otherwise.
A UUID is nil
if all bits are 0.
|
noexcept |
The 60-bit timestamp of a time-based UUID.
Usually represents a count of 100- nanosecond intervals since 00:00:00.00, 15 October 1582 in UTC.
version() == time_based
|
noexcept |
Returns the variant (type) that determines the layout of the UUID.
not nil()
|
noexcept |
Returns the version (sub type) that identifies the algorithm used to generate this UUID.
The algorithms defined in RFC 4122 are:
not nil()