We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 377264f commit 58f3d7bCopy full SHA for 58f3d7b
include/gromox/mapidefs.h
@@ -846,9 +846,14 @@ enum {
846
847
/* cf. glossary.rst "Internal Identifier" */
848
struct eid_t {
849
+ static constexpr uint64_t GCV_MASK = 0xFFFFFFFFFFFF;
850
eid_t() = default;
851
constexpr eid_t(uint64_t v) : m_value(v) {}
852
+ constexpr eid_t(uint16_t r, uint64_t v) : m_value(__builtin_bswap64(v & GCV_MASK) | r) {}
853
constexpr operator uint64_t() const { return m_value; }
854
+ constexpr uint64_t gcv() const { return __builtin_bswap64(m_value) & GCV_MASK; }
855
+ constexpr uint16_t replid() const { return m_value & 0xFFFF; }
856
+ constexpr uint64_t raw() const { return m_value; }
857
void operator=(uint64_t) = delete;
858
uint64_t m_value;
859
};
0 commit comments