Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::UIDGenerator Class Reference

Generates unique identifier strings. More...

#include <mitkUIDGenerator.h>

Public Member Functions

 UIDGenerator (const char *prefix="")
 Construct a UID generator with an optional prefix. More...
 
std::string GetUID ()
 Generate and return a new unique ID string. More...
 

Detailed Description

Generates unique identifier strings.

Produces unique IDs based on the UUID specification (RFC 4122) using a random generator. The generator is thread-safe.

An optional prefix can be specified for human-readable context (e.g. to indicate the purpose of the UID), but it is not required for uniqueness.

See also
Identifiable

Definition at line 33 of file mitkUIDGenerator.h.

Constructor & Destructor Documentation

◆ UIDGenerator()

mitk::UIDGenerator::UIDGenerator ( const char *  prefix = "")
explicit

Construct a UID generator with an optional prefix.

Parameters
[in]prefixA string prepended to every generated UID. May be empty.

Member Function Documentation

◆ GetUID()

std::string mitk::UIDGenerator::GetUID ( )

Generate and return a new unique ID string.

Each call produces a different unique ID. The format is the optional prefix followed by a random UUID.

Returns
A unique ID string.

The documentation for this class was generated from the following file: