34#include <NDEVR/Vector.h>
35#include <NDEVR/BufferBase.h>
36#include <NDEVR/StringView.h>
60 class UUID :
public Vector<16, uint01>
74 constexpr explicit UUID(
const Vector<16, uint01>& bytes) noexcept
75 : Vector<16, uint01>(bytes)
83 : Vector<16, uint01>(0)
93 : Vector<16, uint01>(0)
103 : Vector<16, uint01>(0)
113 : Vector<16, uint01>(0)
123 : Vector<16, uint01>(0)
133 : Vector<16, uint01>(0)
143 : Vector<16, uint01>(0)
153 : Vector<16, uint01>(0)
163 : Vector<16, uint01>(0)
173 : Vector<16, uint01>(0)
212 for (
uint04 n = 0; n < identifier.
size(); n++)
214 id[i] =
id[i] ^ identifier[n];
274 [[nodiscard]] NDEVR_BASE_API
UUID appendUUID(
const Vector<3, fltp04>& offset)
const;
295 template<u
int01 t_size,
class t_type>
299 for (
uint01 i = 0; i < t_size; i++)
309 template<
size_t t_size,
class t_type>
313 for (
uint01 i = 0; i < t_size; i++)
323 template<
size_t t_size>
335 std::size_t value = 0;
336 for (
uint01 i = 0; i < 8; i++)
338 value = value * 256 + ((*this)[i + 0] ^ (*this)[i + 8]);
359 for (
uint01 i = 0; i < 16; i++)
361 if ((*
this)[i] == other[i])
363 return (*
this)[i] < other[i];
375 for (
uint01 i = 0; i < 16; i++)
377 if ((*
this)[i] == other[i])
379 return (*
this)[i] < other[i];
391 for (
uint01 i = 0; i < 16; i++)
393 if ((*
this)[i] == other[i])
395 return (*
this)[i] > other[i];
407 for (
uint01 i = 0; i < 16; i++)
409 if ((*
this)[i] == other[i])
411 return (*
this)[i] > other[i];
433 static const bool Enum =
false;
455 struct hash<
NDEVR::UUID>
462 std::size_t operator()(
const UUID& s)
const noexcept
464 std::size_t value = 0;
465 for (
uint01 i = 0; i < 8; i++)
467 value = value * 256 + (s[i + 0U] ^ s[i + 8U]);
480 struct x4lo {
unsigned __int8 v : 4;
unsigned __int8 _ : 4; };
481 struct x4hi {
unsigned __int8 _ : 4;
unsigned __int8 v : 4; };
482 struct x8 {
unsigned __int8 _; };
483 struct x32 { __int32 _; };
The core String View class for the NDEVR API.
constexpr uint04 size() const
Returns the byte size of this string view.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
UUID(const sint08 &other) noexcept
Constructs a UUID by appending a sint08 value to a zero-initialized UUID.
UUID appendUUID(sint08 offset) const
Appends a sint08 value to this UUID, producing a new derived UUID.
UUID(const uint04 &other) noexcept
Constructs a UUID by appending a uint04 value to a zero-initialized UUID.
bool operator<(const UUID &other) const
Less-than comparison operator using lexicographic byte ordering.
constexpr UUID()
Constructs an invalid (default) UUID with all bytes set to the invalid constant.
UUID(const sint02 &other) noexcept
Constructs a UUID by appending a sint02 value to a zero-initialized UUID.
UUID appendUUID(uint04 offset) const
Appends a uint04 value to this UUID, producing a new derived UUID.
UUID(const sint01 &other) noexcept
Constructs a UUID by appending a sint01 value to a zero-initialized UUID.
constexpr size_t hash() const
Computes a hash value for this UUID by XOR-folding the upper and lower 8 bytes.
UUID(const fltp04 &other) noexcept
Constructs a UUID by appending a fltp04 value to a zero-initialized UUID.
static constexpr UUID CreateUUID(const StringView &identifier)
Creates a deterministic UUID from a string identifier by XOR-folding its characters into the 16-byte ...
UUID appendBoolUUID(bool offset) const
Appends a boolean value to this UUID, producing a new derived UUID.
uint01 * getUniquePointer() const
constexpr UUID(const Vector< 16, uint01 > &bytes) noexcept
Constructs a UUID from a raw 16-byte vector.
UUID(const uint08 &other) noexcept
Constructs a UUID by appending a uint08 value to a zero-initialized UUID.
UUID(const uint01 &other) noexcept
Constructs a UUID by appending a uint01 value to a zero-initialized UUID.
UUID appendUUID(const Vector< t_size, t_type > &offset) const
Appends each element of a vector to this UUID sequentially, producing a new derived UUID.
UUID appendUUID(uint08 offset) const
Appends a uint08 value to this UUID, producing a new derived UUID.
UUID(const uint02 &other) noexcept
Constructs a UUID by appending a uint02 value to a zero-initialized UUID.
UUID appendUUID(const char(&value)[t_size])
Appends a string literal to this UUID by converting it to a StringView first.
UUID appendUUID(const Vector< 3, fltp04 > &offset) const
Appends a 3D float vector to this UUID, producing a new derived UUID.
UUID appendUUID(const UUID &offset) const
Appends another UUID to this UUID, producing a new derived UUID.
constexpr size_t operator()() const
Function call operator that returns the hash of this UUID.
UUID appendUUID(sint04 offset) const
Appends a sint04 value to this UUID, producing a new derived UUID.
bool operator<=(const UUID &other) const
Less-than-or-equal comparison operator using lexicographic byte ordering.
UUID(const fltp08 &other) noexcept
Constructs a UUID by appending a fltp08 value to a zero-initialized UUID.
UUID appendUUID(fltp08 offset) const
Appends a fltp08 value to this UUID, producing a new derived UUID.
UUID appendUUID(const t_type(&value)[t_size])
Appends each element of a C-style array to this UUID sequentially, producing a new derived UUID.
UUID(const sint04 &other) noexcept
Constructs a UUID by appending a sint04 value to a zero-initialized UUID.
UUID appendUUID(fltp04 offset) const
Appends a fltp04 value to this UUID, producing a new derived UUID.
UUID appendUUID(const StringView &identifier) const
Appends a string identifier to this UUID, producing a new derived UUID.
bool operator>(const UUID &other) const
Greater-than comparison operator using lexicographic byte ordering.
bool operator>=(const UUID &other) const
Greater-than-or-equal comparison operator using lexicographic byte ordering.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
int16_t sint02
-Defines an alias representing a 2 byte, signed integer.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
int8_t sint01
-Defines an alias representing a 1 byte, signed integer.
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
static const bool Primitive
Whether this type is a primitive type.
static const bool Pointer
Whether this type is a pointer type.
static const bool String
Whether this type has string-like behavior.
static const bool Number
Whether this type is a numeric type.
static const bool Boolean
Whether this type is a boolean.
static const bool Unsigned
Whether this type is unsigned.
static constexpr ObjectInfo< uint01, false, false > VectorSub()
Returns the ObjectInfo for the underlying uint01 vector element type.
static const bool Vector
Whether this type is a vector type.
static const bool Enum
Whether this type is an enumeration.
static const bool Buffer
Whether this type is a buffer type.
static const bool Integer
Whether this type is an integer type.
static const bool Float
Whether this type is a floating-point type.
static const uint01 Dimensions
Number of byte dimensions in the UUID.
static const bool Color
Whether this type represents a color.
Information about the object.