25 #ifndef TASKOLIB_UNIQUEID_H_
26 #define TASKOLIB_UNIQUEID_H_
30 #include <string_view>
56 static std::optional<UniqueId>
from_string(std::string_view str);
83 inline ::task::UniqueId
operator""_uid(
unsigned long long id)
85 return ::task::UniqueId{
id };
An unsigned 64-bit integer for use as a unique ID.
Definition: UniqueId.h:39
ValueType id_
Definition: UniqueId.h:76
UniqueId()
Default-construct a random unique ID.
Definition: UniqueId.cc:36
static std::optional< UniqueId > from_string(std::string_view str)
Create a unique ID from the given string, returning an empty optional if the string does not represen...
Definition: UniqueId.cc:48
static thread_local std::mt19937_64 random_number_generator_
Definition: UniqueId.h:74
friend bool operator==(UniqueId a, UniqueId b)
Determine if two unique IDs are equal.
Definition: UniqueId.h:59
std::uint64_t ValueType
Definition: UniqueId.h:41
friend std::string to_string(UniqueId uid)
Return a hexadecimal string representation of the given unique ID.
Definition: UniqueId.cc:64
friend bool operator!=(UniqueId a, UniqueId b)
Determine if two unique IDs are different.
Definition: UniqueId.h:65
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33