NDEVR
API Documentation
UUID

A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. More...

Inheritance diagram for UUID:
[legend]
Collaboration diagram for UUID:
[legend]

Public Member Functions

constexpr UUID ()
 Constructs an invalid (default) UUID with all bytes set to the invalid constant.
 UUID (const fltp04 &other) noexcept
 Constructs a UUID by appending a fltp04 value to a zero-initialized UUID.
 UUID (const fltp08 &other) noexcept
 Constructs a UUID by appending a fltp08 value to a zero-initialized UUID.
 UUID (const sint01 &other) noexcept
 Constructs a UUID by appending a sint01 value to a zero-initialized UUID.
 UUID (const sint02 &other) noexcept
 Constructs a UUID by appending a sint02 value to a zero-initialized UUID.
 UUID (const sint04 &other) noexcept
 Constructs a UUID by appending a sint04 value to a zero-initialized UUID.
 UUID (const sint08 &other) noexcept
 Constructs a UUID by appending a sint08 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 (const uint02 &other) noexcept
 Constructs a UUID by appending a uint02 value to a zero-initialized UUID.
 UUID (const uint04 &other) noexcept
 Constructs a UUID by appending a uint04 value to a zero-initialized UUID.
 UUID (const uint08 &other) noexcept
 Constructs a UUID by appending a uint08 value to a zero-initialized UUID.
constexpr UUID (const Vector< 16, uint01 > &bytes) noexcept
 Constructs a UUID from a raw 16-byte vector.
UUID appendBoolUUID (bool offset) const
 Appends a boolean value to this UUID, producing a new derived UUID.
template<size_t t_size>
UUID appendUUID (const char(&value)[t_size])
 Appends a string literal to this UUID by converting it to a StringView first.
UUID appendUUID (const StringView &identifier) const
 Appends a string identifier to this UUID, producing a new derived UUID.
template<size_t t_size, class t_type>
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 appendUUID (const UUID &offset) const
 Appends another UUID to this UUID, producing a new derived UUID.
UUID appendUUID (const Vector< 3, fltp04 > &offset) const
 Appends a 3D float vector to this UUID, producing a new derived UUID.
template<uint01 t_size, class t_type>
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 (fltp04 offset) const
 Appends a fltp04 value to this UUID, producing a new derived UUID.
UUID appendUUID (fltp08 offset) const
 Appends a fltp08 value to this UUID, producing a new derived UUID.
UUID appendUUID (sint04 offset) const
 Appends a sint04 value to this UUID, producing a new derived UUID.
UUID appendUUID (sint08 offset) const
 Appends a sint08 value to this UUID, producing a new derived UUID.
UUID appendUUID (uint04 offset) const
 Appends a uint04 value to this UUID, producing a new derived UUID.
UUID appendUUID (uint08 offset) const
 Appends a uint08 value to this UUID, producing a new derived UUID.
uint01getUniquePointer () const
constexpr size_t hash () const
 Computes a hash value for this UUID by XOR-folding the upper and lower 8 bytes.
constexpr size_t operator() () const
 Function call operator that returns the hash of this UUID.
bool operator< (const UUID &other) const
 Less-than comparison operator using lexicographic byte ordering.
bool operator<= (const UUID &other) const
 Less-than-or-equal comparison operator using lexicographic byte ordering.
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.
Public Member Functions inherited from Vector< 16, uint01 >
constexpr decltype(auto) as () const
 Returns the vector as a new time of vector.
constexpr uint01 dimensionalIndex () const
 Used with template arguments MAX or MIN, Gets the dimensional index for the value that is either max or min.
constexpr uint01 dimensionalValue () const
 Used with template arguments MAX or MIN, Gets the dimensional value for the value that is either max or min.
constexpr t_magnitude_type magnitude () const
 Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism.
constexpr uint01 magnitudeSquared () const
 Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism.
constexpr Vector< t_dims, t_norm_type > normalized (Vector< t_dims, t_norm_type > value_if_nan=Constant< Vector< t_dims, t_norm_type > >::Invalid) const
 Gets the normalized, or unit length representation of this vector.
constexpr operator uint01 & ()
 For Single dimensional objects, they may also be considered a scaler, thus allow implicit conversion from a vector to a scaler when the dimension of the vector is 1.
constexpr Vector< t_dims, uint01operator- () const
 Negation operator.
constexpr Vector< t_dims, uint01 > & operator= (const uint01 &scaler)
 Assignment operator.
constexpr uint01operator[] (uint01 dimension_index)
 Accesses the value of a certain dimension.
constexpr uint01 product () const
 Returns the product, or value of each dimension multiplied together.
constexpr uint01 sum () const
 Returns the sum, or value of each dimension added together.

Static Public Member Functions

static UUID CreateUUID ()
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 space.
Static Public Member Functions inherited from Vector< 16, uint01 >
static constexpr uint01 NumberOfDimensions ()
 Number of dimensions in this vector class.
static constexpr uint01 Type ()
 Returns the type of this class.

Additional Inherited Members

Protected Attributes inherited from Vector< 16, uint01 >
uint01 m_values [t_dims]
 The values[t dims].

Detailed Description

A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems.


The term globally unique identifier (GUID) is also used.

UUIDs are for practical purposes unique, without depending for their uniqueness on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicated is not zero, it is close enough to zero to be negligible.

Thus, anyone can create a UUID and use it to identify something with near certainty that the identifier does not duplicate one that has already been, or will be, created to identify something else. Information labeled with UUIDs by independent parties can therefore be later combined into a single database, or transmitted on the same channel, without needing to resolve conflicts between identifiers.

Author: Tyler Parke

Date: 2017-11-17

Definition at line 60 of file UUID.h.

Constructor & Destructor Documentation

◆ UUID() [1/11]

UUID::UUID ( const Vector< 16, uint01 > & bytes)
inlineexplicitconstexprnoexcept

Constructs a UUID from a raw 16-byte vector.

Parameters
[in]bytesThe 16-byte vector to initialize this UUID from.

Definition at line 74 of file UUID.h.

◆ UUID() [2/11]

UUID::UUID ( const uint01 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a uint01 value to a zero-initialized UUID.

Parameters
[in]otherThe uint01 value to derive the UUID from.

Definition at line 82 of file UUID.h.

References appendUUID().

◆ UUID() [3/11]

UUID::UUID ( const uint02 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a uint02 value to a zero-initialized UUID.

Parameters
[in]otherThe uint02 value to derive the UUID from.

Definition at line 92 of file UUID.h.

References appendUUID().

◆ UUID() [4/11]

UUID::UUID ( const uint04 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a uint04 value to a zero-initialized UUID.

Parameters
[in]otherThe uint04 value to derive the UUID from.

Definition at line 102 of file UUID.h.

References appendUUID().

◆ UUID() [5/11]

UUID::UUID ( const uint08 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a uint08 value to a zero-initialized UUID.

Parameters
[in]otherThe uint08 value to derive the UUID from.

Definition at line 112 of file UUID.h.

References appendUUID().

◆ UUID() [6/11]

UUID::UUID ( const sint01 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a sint01 value to a zero-initialized UUID.

Parameters
[in]otherThe sint01 value to derive the UUID from.

Definition at line 122 of file UUID.h.

References appendUUID().

◆ UUID() [7/11]

UUID::UUID ( const sint02 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a sint02 value to a zero-initialized UUID.

Parameters
[in]otherThe sint02 value to derive the UUID from.

Definition at line 132 of file UUID.h.

References appendUUID().

◆ UUID() [8/11]

UUID::UUID ( const sint04 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a sint04 value to a zero-initialized UUID.

Parameters
[in]otherThe sint04 value to derive the UUID from.

Definition at line 142 of file UUID.h.

References appendUUID().

◆ UUID() [9/11]

UUID::UUID ( const sint08 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a sint08 value to a zero-initialized UUID.

Parameters
[in]otherThe sint08 value to derive the UUID from.

Definition at line 152 of file UUID.h.

References appendUUID().

◆ UUID() [10/11]

UUID::UUID ( const fltp04 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a fltp04 value to a zero-initialized UUID.

Parameters
[in]otherThe fltp04 value to derive the UUID from.

Definition at line 162 of file UUID.h.

References appendUUID().

◆ UUID() [11/11]

UUID::UUID ( const fltp08 & other)
inlineexplicitnoexcept

Constructs a UUID by appending a fltp08 value to a zero-initialized UUID.

Parameters
[in]otherThe fltp08 value to derive the UUID from.

Definition at line 172 of file UUID.h.

References appendUUID().

Member Function Documentation

◆ appendBoolUUID()

UUID UUID::appendBoolUUID ( bool offset) const
nodiscard

Appends a boolean value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe boolean value to append.
Returns
A new UUID derived from this UUID and the given boolean.

References UUID().

◆ appendUUID() [1/12]

template<size_t t_size>
UUID UUID::appendUUID ( const char(&) value[t_size])
inlinenodiscard

Appends a string literal to this UUID by converting it to a StringView first.

Parameters
[in]valueThe string literal to append.
Returns
A new UUID derived from this UUID and the given string.

Definition at line 324 of file UUID.h.

References UUID(), and appendUUID().

◆ appendUUID() [2/12]

◆ appendUUID() [3/12]

template<size_t t_size, class t_type>
UUID UUID::appendUUID ( const t_type(&) value[t_size])
inlinenodiscard

Appends each element of a C-style array to this UUID sequentially, producing a new derived UUID.

Parameters
[in]valueThe array whose elements are appended.
Returns
A new UUID derived from this UUID and each element of the array.

Definition at line 310 of file UUID.h.

References UUID(), and appendUUID().

◆ appendUUID() [4/12]

UUID UUID::appendUUID ( const UUID & offset) const
nodiscard

Appends another UUID to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe UUID to append.
Returns
A new UUID derived from combining this UUID and the given UUID.

References UUID().

◆ appendUUID() [5/12]

UUID UUID::appendUUID ( const Vector< 3, fltp04 > & offset) const
nodiscard

Appends a 3D float vector to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe 3D vector to append.
Returns
A new UUID derived from this UUID and the given vector.

References UUID().

◆ appendUUID() [6/12]

template<uint01 t_size, class t_type>
UUID UUID::appendUUID ( const Vector< t_size, t_type > & offset) const
inlinenodiscard

Appends each element of a vector to this UUID sequentially, producing a new derived UUID.

Parameters
[in]offsetThe vector whose elements are appended.
Returns
A new UUID derived from this UUID and each element of the vector.

Definition at line 296 of file UUID.h.

References UUID(), and appendUUID().

◆ appendUUID() [7/12]

UUID UUID::appendUUID ( fltp04 offset) const
nodiscard

Appends a fltp04 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe fltp04 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ appendUUID() [8/12]

UUID UUID::appendUUID ( fltp08 offset) const
nodiscard

Appends a fltp08 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe fltp08 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ appendUUID() [9/12]

UUID UUID::appendUUID ( sint04 offset) const
nodiscard

Appends a sint04 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe sint04 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ appendUUID() [10/12]

UUID UUID::appendUUID ( sint08 offset) const
nodiscard

Appends a sint08 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe sint08 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ appendUUID() [11/12]

UUID UUID::appendUUID ( uint04 offset) const
nodiscard

Appends a uint04 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe uint04 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ appendUUID() [12/12]

UUID UUID::appendUUID ( uint08 offset) const
nodiscard

Appends a uint08 value to this UUID, producing a new derived UUID.

Parameters
[in]offsetThe uint08 value to append.
Returns
A new UUID derived from this UUID and the given value.

References UUID().

◆ CreateUUID() [1/2]

◆ CreateUUID() [2/2]

constexpr UUID UUID::CreateUUID ( const StringView & identifier)
inlinestaticconstexpr

Creates a deterministic UUID from a string identifier by XOR-folding its characters into the 16-byte UUID space.

Parameters
[in]identifierThe string to derive a deterministic UUID from.
Returns
A UUID uniquely determined by the given string.

Definition at line 208 of file UUID.h.

References UUID(), and StringView::size().

◆ getUniquePointer()

uint01 * UUID::getUniquePointer ( ) const

Gets unique pointer.

Author: Tyler Parke

Date: 2017-11-17

Returns
Null if it fails, else the unique pointer.

◆ hash()

size_t UUID::hash ( ) const
inlineconstexpr

Computes a hash value for this UUID by XOR-folding the upper and lower 8 bytes.

Returns
A size_t hash suitable for use in hash-based containers.

Definition at line 333 of file UUID.h.

Referenced by operator()().

◆ operator()()

size_t UUID::operator() ( ) const
inlineconstexpr

Function call operator that returns the hash of this UUID.

Returns
The hash value of this UUID.

Definition at line 347 of file UUID.h.

References hash().

◆ operator<()

bool UUID::operator< ( const UUID & other) const
inline

Less-than comparison operator using lexicographic byte ordering.

Parameters
[in]otherThe UUID to compare against.
Returns
True if this UUID is lexicographically less than the other.

Definition at line 357 of file UUID.h.

References UUID().

◆ operator<=()

bool UUID::operator<= ( const UUID & other) const
inline

Less-than-or-equal comparison operator using lexicographic byte ordering.

Parameters
[in]otherThe UUID to compare against.
Returns
True if this UUID is lexicographically less than or equal to the other.

Definition at line 373 of file UUID.h.

References UUID().

◆ operator>()

bool UUID::operator> ( const UUID & other) const
inline

Greater-than comparison operator using lexicographic byte ordering.

Parameters
[in]otherThe UUID to compare against.
Returns
True if this UUID is lexicographically greater than the other.

Definition at line 389 of file UUID.h.

References UUID().

◆ operator>=()

bool UUID::operator>= ( const UUID & other) const
inline

Greater-than-or-equal comparison operator using lexicographic byte ordering.

Parameters
[in]otherThe UUID to compare against.
Returns
True if this UUID is lexicographically greater than or equal to the other.

Definition at line 405 of file UUID.h.

References UUID().


The documentation for this class was generated from the following file: