6 #include "model/DevicePrefix.h"
19 static const unsigned int IDENT_WIDTH;
20 static const uint64_t IDENT_MASK;
21 static const uint64_t PREFIX_MASK;
47 operator unsigned long long()
const
49 return (
unsigned long long) m_value;
54 return DevicePrefix::fromRaw((uint8_t) (m_value >> (is32bit()? 24 : 56)));
57 uint64_t ident()
const
59 return m_value & (is32bit()?
60 0x0000000000ffffffUL :
61 0x00ffffffffffffffUL);
66 return (m_value >> 32) == 0;
69 static DeviceID parse(
const std::string &s);
70 std::string toString()
const;
72 bool operator !=(
const DeviceID &
id)
const
74 return m_value !=
id.m_value;
77 bool operator ==(
const DeviceID &
id)
const
79 return m_value ==
id.m_value;
82 bool operator <(
const DeviceID &
id)
const
84 return m_value <
id.m_value;
87 bool operator >(
const DeviceID &
id)
const
89 return m_value >
id.m_value;
92 bool operator <=(
const DeviceID &
id)
const
94 return m_value <=
id.m_value;
97 bool operator >=(
const DeviceID &
id)
const
99 return m_value >=
id.m_value;
107 = DevicePrefix::fromRaw(DevicePrefix::PREFIX_INVALID));
Definition: DeviceID.h:17
static DeviceID random(const DevicePrefix &prefix=DevicePrefix::fromRaw(DevicePrefix::PREFIX_INVALID))
Definition: DeviceID.cpp:68
DeviceID()
Definition: DeviceID.cpp:18