17 #ifndef HEADER_SUPERTUX_UTIL_UID_HPP 18 #define HEADER_SUPERTUX_UTIL_UID_HPP 32 size_t operator()(
const UID& uid)
const;
40 friend std::ostream& operator<<(std::ostream& os,
const UID& uid);
41 friend size_t std::hash<UID>::operator()(
const UID&)
const;
44 using Magic = uint8_t;
47 explicit UID(uint32_t value) :
55 UID(
const UID& other) =
default;
56 UID& operator=(
const UID& other) =
default;
58 inline operator bool()
const {
62 inline bool operator<(
const UID& other)
const {
63 return m_value < other.m_value;
66 inline bool operator==(
const UID& other)
const {
67 return m_value == other.m_value;
70 inline bool operator!=(
const UID& other)
const {
71 return m_value != other.m_value;
74 inline Magic get_magic()
const {
return static_cast<Magic
>((m_value & 0xffff0000u) >> 16); }
80 std::ostream& operator<<(std::ostream& os,
const UID& uid);
Definition: uid_generator.hpp:22