ORE Studio 0.0.4
Loading...
Searching...
No Matches
Classes | Functions | Variables
ores::utility::uuid Namespace Reference

UUID generation and handling utilities. More...

Classes

class  tenant_id
 A strongly-typed wrapper around a UUID representing a tenant identifier. More...
 
class  uuid_v7_generator
 A generator for UUID version 7 (v7) based on RFC 9562. More...
 

Functions

std::ostream & operator<< (std::ostream &os, const tenant_id &id)
 Stream insertion operator for tenant_id.
 
std::ostream & operator<< (std::ostream &os, const std::optional< tenant_id > &id)
 Stream insertion operator for optional tenant_id.
 

Variables

constexpr char nil_uuid_str [] = "00000000-0000-0000-0000-000000000000"
 String representation of the nil UUID (all zeros).
 
constexpr char max_uuid_str [] = "ffffffff-ffff-ffff-ffff-ffffffffffff"
 String representation of the max UUID (all ones).
 

Detailed Description

UUID generation and handling utilities.

Contains utilities for generating and working with UUIDs including parsing, formatting, and random UUID generation.

Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  os,
const tenant_id id 
)

Stream insertion operator for tenant_id.

Parameters
osThe output stream.
idThe tenant_id to output.
Returns
The output stream.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  os,
const std::optional< tenant_id > &  id 
)

Stream insertion operator for optional tenant_id.

Parameters
osThe output stream.
idThe optional tenant_id to output.
Returns
The output stream.

Variable Documentation

◆ nil_uuid_str

constexpr char nil_uuid_str[] = "00000000-0000-0000-0000-000000000000"
constexpr

String representation of the nil UUID (all zeros).

The nil UUID is the default value for a default-constructed boost::uuids::uuid. This constant is used to detect uninitialized or legacy tenant IDs.

◆ max_uuid_str

constexpr char max_uuid_str[] = "ffffffff-ffff-ffff-ffff-ffffffffffff"
constexpr

String representation of the max UUID (all ones).

The max UUID is defined in RFC 9562 as a sentinel value. It is used as the system tenant identifier because it cannot be accidentally created through default construction.