60 return memcmp(
this, &r,
sizeof(
UUID)) == 0;
65 return memcmp(
this, &r,
sizeof(
UUID)) < 0;
77 , uint16_t time_hi_and_version_
79 , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
87 strncpy(m_name, name,
sizeof(m_name)-1);
88 m_name[
sizeof(m_name)-1] =
'\0';
94 strncpy(m_name, copied.m_name,
sizeof(m_name)-1);
95 m_name[
sizeof(m_name)-1] =
'\0';
100 static_cast<UUID&
>(*this) = copied;
107 return static_cast<const UUID&
>(*this) == compared;
112 return !(
static_cast<const UUID&
>(*this) == compared);
115 const char*
getName()
const {
return m_name; }
124 #define DEFINE_UUID(TYPE, NAME, l, s0, s1, s2, c0,c1,c2,c3,c4,c5) \
125 static const TYPE NAME(0x##l, 0x##s0, 0x##s1, 0x##s2, \
126 0x##c0, 0x##c1, 0x##c2, 0x##c3, 0x##c4, 0x##c5, #NAME);
128 #define DEFINE_NAMED_UUID_CLASS(NAME) \
129 class NAME : public NamedUUID \
132 NAME(uint32_t time_low_ \
133 , uint16_t time_mid_ \
134 , uint16_t time_hi_and_version_ \
135 , uint16_t clock_seq_ \
136 , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5 \
137 , const char* name) \
138 : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_, \
139 c0, c1, c2, c3, c4, c5, name) \
147 #endif // _ARGUS_UUID_H
bool operator<(const UUID &r) const
NamedUUID(const NamedUUID &copied)
bool operator==(const UUID &r) const
uint16_t time_hi_and_version
A universally unique identifier.
bool operator==(const NamedUUID &compared) const
NamedUUID(uint32_t time_low_, uint16_t time_mid_, uint16_t time_hi_and_version_, uint16_t clock_seq_, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, const char *name)
const char * getName() const
const uint32_t MAX_UUID_NAME_SIZE
A universally unique identifier with a name (used for debugging purposes).
bool operator!=(const NamedUUID &compared) const
NamedUUID & operator=(const NamedUUID &copied)