About
maxon::Uuid is a MAXON API class based on maxon::UuidInterface and used to create universally unique identifiers. IDs generated via maxon::Uuid are unique and persistent which makes them perfect to create Uniform Resource Names (URN)
Creation and initialization
A maxon::UUID can be created on the stack and initialized through the proper method:
const maxon::Uuid filledUuid {
"01234567-89AB-CDEF-FEDC-BA9876543210"_s };
A maxon::Uuid can also be initialized, after being created, using:
#define iferr_return
Definition: resultbase.h:1524
Content
The content of a maxon::Uuid can be managed with these functions:
const Bool uuidIsPopulated = uniqueid.IsPopulated();
if (uuidIsPopulated)
{
}
maxon::Bool Bool
Definition: ge_sys_math.h:51
A maxon::Uuid object's value can be set and retrieved using:
firstUuid.Set(
"AABBCCDD-EEFF-0123-4567-FFEEDDCCBBAA"_s)
iferr_return;
BaseArray<UChar> data;
Py_ssize_t size
Definition: bytesobject.h:86
maxon::Int Int
Definition: ge_sys_math.h:60
Comparison
A given maxon::Uuid can be compared to another using:
const maxon::Uuid uniqueIdZeroToFour {
"00000000-1111-2222-3333-444444444444"_s };
const maxon::Uuid uniqueIdFiveToNine {
"55555555-6666-7777-8888-999999999999"_s };
Py_UCS4 * res
Definition: unicodeobject.h:1113
COMPARERESULT
Data type for comparison results.
Definition: compare.h:21
Conversion
A given maxon::Uuid can be converted to a maxon::String using:
- Note
- The format will be "00000000-0000-0000-0000-000000000000" and the letters will be uppercase.
Definition: string.h:1237
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
Utility
A given maxon::Uuid can return the hash-code of the UUID using:
UInt64 UInt
unsigned 32/64 bit int, size depends on the platform
Definition: apibase.h:203
To generate a string containing a UUID it's available for immediate use:
A maxon::Uuid object can be read from and written to disk by serializing the data contained using the conventional functions.
const maxon::Uuid savedUuid {
"AABBCCDD-EEFF-0123-4567-FFEEDDCCBBAA"_s };
const maxon::Id fileID {
"net.maxonexample.uuid" };
Definition: apibaseid.h:243
std::enable_if< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, Result< void > >::type ReadDocument(const Url &url, const Id &id, T &object, const DataDictionary &dict=DataDictionary())
Definition: io.h:40
Result< void > WriteDocument(const Url &url, OPENSTREAMFLAGS flags, const Id &id, const T &object, IOFORMAT format=IOFORMAT::DEFAULT, const DataDictionary &dict=DataDictionary())
Definition: io.h:72
Further Reading