sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGXIdentifier;
part of SGEXTN module SG_Core
pseudo-GUID identifier
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGXIdentifier.h›
CMake target for BuildLah: SGEXTN::SG_Core
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
SGXIdentifier(const SGXString& s, bool ifValid, int* errCode);
SGXIdentifier(bool ifValid);
SGXIdentifier(unsigned int a, unsigned int b, unsigned int c, unsigned int d, bool ifValid, int* errCode);
[[nodiscard]] bool exists() const;
[[nodiscard]] SGXString getStringForPrinting() const;
[[nodiscard]] int hash() const;
[[nodiscard]] bool operator!=(SGXIdentifier x) const;
[[nodiscard]] bool operator‹(SGXIdentifier x) const;
[[nodiscard]] bool operator==(SGXIdentifier x) const;
[[nodiscard]] bool operator›(SGXIdentifier x) const;
static const SGXIdentifier nullIdentifier;
static bool registerIdentifier(SGXIdentifier x);
static bool unregisterIdentifier(SGXIdentifier x);
SGXIdentifier looks like a GUID and can function like a GUID in most scenarios. However, it technically is not a GUID because it does not comply with any GUID standard, and SGEXTN does not guarantee non collision when SGXIdentifier from different databases are merged. SGXIdentifier provides an internal registration system to make accidental collision impossible.
a sequence of 4 unsigned ints, randomly generated or read from file on initialisation.
Generates a SGXIdentifier from the string representation s, this can be used for generating SGXIdentifier objects consistently from a set of data. If ifValid is true, it is checked if the SGXIdentifier is already registered. In that case, if the constructed SGXIdentifier is the null identifier, the int pointed to by errCode is set to 2. If the constructed SGXIdentifier overlaps with an existing registered SGXIdentifier, the int pointed to by errCode is set to 1. Otherwise the int pointed to by errCode is set to 0. Pass errCode as nullptr if you do not need existence checking.
Setting ifValid to true does not register the generated SGXIdentifier, it has to be registered using SGXIdentifier::registerIdentifier separately.
This only works if s was generated using SGXIdentifier::getStringForPrinting. If s does not represent a valid SGXIdentifier in the defined format, a null identifier is constructed.
Generates a new random SGXIdentifier. If ifValid is true, it is guaranteed that the generated SGXIdentifier does not collide with any existing registered SGXIdentifier.
Setting ifValid to true does not register the generated SGXIdentifier, it has to be registered using SGXIdentifier::registerIdentifier separately.
Generates a SGXIdentifier storing information from a, b, c, d, this can be used for generating SGXIdentifier objects consistently from a set of data. If ifValid is true, it is checked if the SGXIdentifier is already registered. In that case, if the constructed SGXIdentifier is the null identifier, the int pointed to by errCode is set to 2. If the constructed SGXIdentifier overlaps with an existing registered SGXIdentifier, the int pointed to by errCode is set to 1. Otherwise the int pointed to by errCode is set to 0. Pass errCode as nullptr if you do not need existence checking.
Setting ifValid to true does not register the generated SGXIdentifier, it has to be registered using SGXIdentifier::registerIdentifier separately.
Returns if the SGXIdentifier has already been registered.
There is no need to use SGXIdentifier::exists before SGXIdentifier::registerIdentifier or SGXIdentifier::unregisterIdentifier as the check is done internally.
Converts the SGXIdentifier to text.
This can be used for file names
This is not really human readable. Do not make the user read SGXIdentifier values, instead get them to name whatever their data is.
Hash function defined for SGLHash.
Returns if this SGXIdentifier is not the same as x.
Lesser than operator with x defined for SGLLesserThan and SGLMoreThan.
Returns if this SGXIdentifier is the same as x.
More than operator with x defined for SGLLesserThan and SGLMoreThan.
Null identifier, or SGXIdentifier with all bits at zero.
Registers the SGXIdentifier x. The function returns false if the SGXIdentifier is already registered (nothing is done) and true otherwise.
Attempting to register a SGXIdentifier that is already registered does NOT cause a crash or undefined behaviour, it just gives a return value of false.
Unregisters the SGXIdentifier x. The function returns false if the SGXIdentifier was never registered (nothing is done) and true otherwise.
Attempting to deregister a SGXIdentifier that has never been registered does NOT cause a crash or undefined behaviour, it just gives a return value of false.
©2025 05524F.sg (Singapore)