61 UUID16_SZ=2, UUID32_SZ=4, UUID128_SZ=16
77 static std::unique_ptr<uuid_t>
create(
const std::string& str);
96 bool operator==(
uuid_t const &o) const noexcept;
106 bool operator!=(
uuid_t const &o) const noexcept
107 {
return !(*
this == o); }
132 virtual const uint8_t *
data() const noexcept = 0;
168 const uint8_t *
data() const noexcept
override {
return static_cast<uint8_t*
>(
static_cast<void*
>(
const_cast<uint16_t*
>(&value))); }
169 std::string
toString() const noexcept override;
195 const uint8_t *
data() const noexcept
override {
return static_cast<uint8_t*
>(
static_cast<void*
>(
const_cast<uint32_t*
>(&value))); }
196 std::string
toString() const noexcept override;
228 const uint8_t *
data() const noexcept
override {
return value.
data; }
229 std::string
toString() const noexcept override;
232 (void)le_octet_index;
uuid128_t(jau::uint128dp_t const v) noexcept
jau::nsize_t put(uint8_t *const buffer, lb_endian_t const le_or_be) const noexcept override
uuid128_t(uint8_t const *const buffer, lb_endian_t const le_or_be) noexcept
uuid16_t & operator=(uuid16_t &&o) noexcept=default
uuid16_t(uint8_t const *const buffer, lb_endian_t const le_or_be) noexcept
const uint8_t * data() const noexcept override
returns the pointer to the uuid data of size getTypeSize()
uuid16_t(uuid16_t &&o) noexcept=default
uuid16_t & operator=(const uuid16_t &o) noexcept=default
uuid16_t(uint16_t const v) noexcept
uuid16_t(const uuid16_t &o) noexcept=default
uuid32_t & operator=(uuid32_t &&o) noexcept=default
uuid32_t(const uuid32_t &o) noexcept=default
uuid32_t(uint8_t const *const buffer, lb_endian_t const le_or_be) noexcept
uuid32_t(uuid32_t &&o) noexcept=default
uuid32_t & operator=(const uuid32_t &o) noexcept=default
uuid32_t(uint32_t const v) noexcept
const uint8_t * data() const noexcept override
returns the pointer to the uuid data of size getTypeSize()
static TypeSize toTypeSize(const jau::nsize_t size)
static constexpr jau::nsize_t number(const TypeSize rhs) noexcept
virtual jau::nsize_t put(uint8_t *const buffer, lb_endian_t const le_or_be) const noexcept=0
uuid128_t toUUID128(uuid128_t const &base_uuid=BT_BASE_UUID, jau::nsize_t const uuid32_le_octet_index=12) const noexcept
TypeSize getTypeSize() const noexcept
virtual const uint8_t * data() const noexcept=0
returns the pointer to the uuid data of size getTypeSize()
TypeSize
Underlying integer value present octet count.
uuid_t(TypeSize const type_)
std::string getTypeSizeString() const noexcept
virtual ~uuid_t() noexcept=default
virtual std::string toString() const noexcept=0
Returns the string representation in BE network order, i.e.
jau::nsize_t getTypeSizeInt() const noexcept
bool equivalent(uuid_t const &o) const noexcept
Relaxed equality operator.
static std::unique_ptr< uuid_t > create(TypeSize const t, uint8_t const *const buffer, lb_endian_t const le_or_be)
std::unique_ptr< uuid_t > clone() const noexcept
virtual std::string toUUID128String(uuid128_t const &base_uuid=BT_BASE_UUID, jau::nsize_t const le_octet_index=12) const noexcept=0
Returns the uuid128_t string representation in BE network order, i.e.
constexpr uint128dp_t get_uint128(uint8_t const *buffer) noexcept
See get_uint16() for reference.
constexpr uint16_t get_uint16(uint8_t const *buffer) noexcept
Returns a uint16_t value from the given byte address using packed_t to resolve a potential memory ali...
constexpr uint32_t get_uint32(uint8_t const *buffer) noexcept
See get_uint16() for reference.
constexpr void put_uint32(uint8_t *buffer, const uint32_t v) noexcept
See put_uint16() for reference.
lb_endian_t
Simplified reduced endian type only covering little- and big-endian.
std::string to_string(const endian_t v) noexcept
Return std::string representation of the given endian.
constexpr void put_uint16(uint8_t *buffer, const uint16_t v) noexcept
Put the given uint16_t value into the given byte address using packed_t to resolve a potential memory...
constexpr void put_uint128(uint8_t *buffer, const uint128dp_t &v) noexcept
See put_uint16() for reference.
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
uuid32_t get_uuid32(uint8_t const *buffer) noexcept
uuid128_t BT_BASE_UUID
Bluetooth UUID https://www.bluetooth.com/specifications/assigned-numbers/service-discovery/
uuid16_t get_uuid16(uint8_t const *buffer) noexcept
uuid128_t get_uuid128(uint8_t const *buffer) noexcept
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
A 128-bit packed uint8_t data array.