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.
 
SBCContainerUUIDoperator++ (int)
 Postfix increment 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 Elements. In many cases, UUIDs are automatically generated thanks to the SAMSON Element 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);

When necessary, SBRandom can be used to generate UUIDs :

SBRandom randomGenerator;
SBUUID randomUUID = randomGenerator.randUUID();

Short name: SBUUID

See also
Identifiers
Generating a SAMSON Extension
SBRandom
This class implements a random number generator.
Definition: SBDTypeRandom.hpp:17
static SBProxy * getProxy(const std::string &className, const SBUUID &elementUUID=SBUUID())
Returns the proxy of a class.
Definition: SAMSON.cpp:1787
This class describes a universally unique identifier (UUID).
Definition: SBCContainerUUID.hpp:45
This class describes a class proxy.
Definition: SBCClassProxy.hpp:27
SBCContainerUUID randUUID()
Generates a random 32-character hexadecimal chain with the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX...
Definition: SBDTypeRandom.cpp:162