Struct Id

Struct Documentation

struct Id

A unique, immutable identifier for a Channel.

Each Channel is assigned an Id on creation that never changes for its lifetime (notably, it survives copies and is distinct from the channel’s name). Ids are cheap value types and can be used as keys in both ordered (std::map / std::set, via operator<) and unordered (std::unordered_map / std::unordered_set, via the std::hash specialization below) containers.

Public Functions

inline explicit operator uint64_t() const

Explicit conversion back to the underlying integer value.

inline bool operator==(const Id &other) const

True if the two Ids share the same underlying value.

inline bool operator!=(const Id &other) const

Negation of operator==.

inline bool operator<(const Id &other) const

Orders Ids by their underlying value (for use as a std::map / std::set key).

inline bool is_valid() const

True unless this Id equals the invalid() sentinel.

Public Members

const uint64_t id

The underlying identifier value (immutable).

Public Static Functions

static inline Id invalid()

Returns the sentinel “invalid” Id (the maximum uint64_t value).

Returns:

An Id for which is_valid() is false.