25 #ifndef TASKOLIB_UNIQUEID_H_
26 #define TASKOLIB_UNIQUEID_H_
31 #include <gul14/optional.h>
32 #include <gul14/string_view.h>
57 static gul14::optional<UniqueId>
from_string(gul14::string_view str);
84 inline ::task::UniqueId
operator""_uid(
unsigned long long id)
86 return ::task::UniqueId{
id };
An unsigned 64-bit integer for use as a unique ID.
Definition: UniqueId.h:40
ValueType id_
Definition: UniqueId.h:77
static gul14::optional< UniqueId > from_string(gul14::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
UniqueId()
Default-construct a random unique ID.
Definition: UniqueId.cc:36
static thread_local std::mt19937_64 random_number_generator_
Definition: UniqueId.h:75
friend bool operator==(UniqueId a, UniqueId b)
Determine if two unique IDs are equal.
Definition: UniqueId.h:60
std::uint64_t ValueType
Definition: UniqueId.h:42
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:66
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33