Class SBCContainerUUID#
This class describes a universally unique identifier (UUID). More...
#include <SBCContainerUUID.hpp>
Public Attributes#
| Type | Name |
|---|---|
| std::array< uint8_t, 16 > | data |
Public Static Attributes#
| Type | Name |
|---|---|
| SBCContainerUUID | invalid An empty invalid UUID object (equal to SBCContainerUUID() ) |
Public Functions#
| Type | Name |
|---|---|
| SBCContainerUUID (const std::array< uint8_t, 16 > & data) Constructs a UUID from internal data. |
|
| SBCContainerUUID (const std::string & uuid) Constructs a UUID from a std::string. |
|
| SBCContainerUUID (const SBCContainerUUID & other) Copy constructor. |
|
| SBCContainerUUID (SBCContainerUUID && other) noexcept Move constructor. |
|
| SBCContainerUUID () noexcept Constructs an invalid UUID. |
|
| bool | isValid () noexcept const Returns true if and only if the UUID is valid. |
| bool | operator!= (const SBCContainerUUID & other) const Inequality operator. |
| std::string | operator() () const Returns the UUID in string format. |
| SBCContainerUUID & | operator++ () Prefix increment operator. |
| SBCContainerUUID | operator++ (int) Postfix increment operator. |
| SBCContainerUUID & | operator-- () Prefix decrement operator. |
| SBCContainerUUID | operator-- (int) Postfix decrement operator. |
| bool | operator< (const SBCContainerUUID & other) const Lexicographic comparison with another UUID. |
| SBCContainerUUID & | operator= (const SBCContainerUUID & other) Copy assignment operator. |
| SBCContainerUUID & | operator= (SBCContainerUUID && other) noexcept Move assignment operator. |
| bool | operator== (const SBCContainerUUID & other) const Equality operator. |
| virtual | ~SBCContainerUUID () Destructs the UUID. |
Detailed Description#
SBCContainerUUID objects can hold Universally Unique IDs (UUIDs), which are used to identify classes and SAMSON Extensions. In many cases, UUIDs are automatically generated thanks to the SAMSON Extension Generator.
UUIDs may be used e.g. to retrieve class proxies:
SBCClassProxy* classProxy = nullptr;
std::string className("ClassName");
std::string elementName("ElementName");
SBUUID elementUUID("0CE16BE8-8AA1-75C4-31A8-B3FA1CE93A94");
// retrieve a class proxy
classProxy = SAMSON::getProxy(className, elementName, elementUUID);
When necessary, SBDTypeRandom can be used to generate UUIDs :
Short name: SBUUID
See also: Identifiers, SAMSON Extension Generator, SBDTypeRandom
Public Attributes Documentation#
variable data#
Public Static Attributes Documentation#
variable invalid#
An empty invalid UUID object (equal to SBCContainerUUID() )
Public Functions Documentation#
function SBCContainerUUID [1/5]#
Constructs a UUID from internal data.
Initializes the UUID with the provided 16-byte array representing the UUID value.
Parameters:
dataA 16-element array containing the raw UUID bytes.
function SBCContainerUUID [2/5]#
Constructs a UUID from a std::string.
Constructs a UUID from a string representation.
Parses a UUID string in the standard 36-character format (e.g., "123e4567-e89b-12d3-a456-426614174000"). If the string is not a valid UUID, the resulting object is set to an invalid state.
Parameters:
uuidThe string containing the UUID.
function SBCContainerUUID [3/5]#
Copy constructor.
Constructs a new UUID as a copy of an existing UUID.
Parameters:
otherThe UUID to copy.
function SBCContainerUUID [4/5]#
Move constructor.
Constructs a new UUID by moving the data from another UUID.
Parameters:
otherThe UUID to move.
function SBCContainerUUID [5/5]#
Constructs an invalid UUID.
Creates a UUID object that is considered invalid. It can be used as a sentinel value.
function isValid#
Returns true if and only if the UUID is valid.
Checks whether the UUID is valid.
Determines if the UUID holds a valid value (i.e., not the sentinel invalid UUID).
Returns:
true if the UUID is valid, false otherwise.
function operator!=#
Inequality operator.
Checks whether this UUID is not equal to another UUID.
Parameters:
otherThe UUID to compare with.
Returns:
true if the UUIDs are different, false otherwise.
function operator()#
Returns the UUID in string format.
Returns the string representation of the UUID.
Formats the UUID as a 36-character string in the standard representation.
Returns:
The UUID as a string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
function operator++#
Prefix increment operator.
Increments the UUID lexicographically.
Returns:
Reference to this UUID after increment.
function operator++#
Postfix increment operator.
Returns a copy of the UUID before it is incremented lexicographically.
Returns:
The original UUID value before increment.
function operator--#
Prefix decrement operator.
Decrements the UUID lexicographically.
Returns:
Reference to this UUID after decrement.
function operator--#
Postfix decrement operator.
Returns a copy of the UUID before it is decremented lexicographically.
Returns:
The original UUID value before decrement.
function operator<#
Lexicographic comparison with another UUID.
Less-than operator.
Performs a lexicographic comparison between this UUID and another.
Parameters:
otherThe UUID to compare with.
Returns:
true if this UUID is lexicographically less than other, false otherwise.
function operator=#
Copy assignment operator.
Assigns the value of another UUID to this one.
Parameters:
otherThe UUID to assign from.
Returns:
Reference to this UUID after assignment.
function operator=#
Move assignment operator.
Moves the value of another UUID into this one.
Parameters:
otherThe UUID to move from.
Returns:
Reference to this UUID after assignment.
function operator==#
Equality operator.
Checks whether this UUID is equal to another UUID.
Parameters:
otherThe UUID to compare with.
Returns:
true if the UUIDs are equal, false otherwise.
function ~SBCContainerUUID#
Destructs the UUID.
Destructor.
Destroys the UUID object.