Loading...
Searching...
No Matches
SBCContainerUUID Class Reference

This class describes a universally unique identifier (UUID). More...

Constructors and destructors

 SBCContainerUUID (const std::string &u)
 Constructs a UUID from a std::string.
 
 SBCContainerUUID (const SBCContainerUUID &u)
 Copy constructor.
 
 SBCContainerUUID (SBCContainerUUID &&u)
 Move constructor.
 
 SBCContainerUUID ()
 Constructs an invalid UUID.
 
virtual ~SBCContainerUUID ()
 Destructs the UUID.
 

Operators

SBCContainerUUIDoperator= (const SBCContainerUUID &u)
 Copy assignment operator.
 
SBCContainerUUIDoperator= (SBCContainerUUID &&u)
 Move assignment operator.
 
bool operator== (const SBCContainerUUID &u) const
 Equality operator.
 
bool operator!= (const SBCContainerUUID &u) const
 Non-equality operator.
 
bool operator< (const SBCContainerUUID &u) const
 Lexicographic comparison with another UUID.
 
std::string operator() () const
 Returns the UUID in string format

 
SBCContainerUUIDoperator++ ()
 Prefix increment operator.
 
SBCContainerUUID operator++ (int)
 Postfix increment operator.
 
SBCContainerUUIDoperator-- ()
 Prefix decrement operator.
 
SBCContainerUUID operator-- (int)
 Postfix decrement operator.
 

Validity

bool isValid () const
 Returns true if and only if the UUID is valid.
 

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 = 0;
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);
static SBProxy * getProxy(const std::string &className, const SBUUID &elementUUID=SBUUID())
Returns the proxy of a class.
Definition: SAMSON.cpp:2153
This class describes a class proxy.
Definition: SBCClassProxy.hpp:27
This class describes a universally unique identifier (UUID).
Definition: SBCContainerUUID.hpp:45

When necessary, SBRandom can be used to generate UUIDs :

SBRandom randomGenerator;
SBUUID randomUUID = randomGenerator.randUUID();
This class implements a random number generator.
Definition: SBDTypeRandom.hpp:17
SBCContainerUUID randUUID()
Generates a random 32-character hexadecimal chain with the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX...
Definition: SBDTypeRandom.cpp:162

Short name: SBUUID

See also
Identifiers
Generating a SAMSON Extension
SBRandom