载入中...
搜索中...
未找到
eve::UuidV7Generator类 参考

Injectable UUIDv7 generator. 更多...

#include <Identity.h>

Public 成员函数

 UuidV7Generator (UuidEntropySource entropy, UuidClock clock={})
 Creates a generator with an injected entropy source and optional clock.
 
std::optional< PersistentId > generate () const
 Generates a UUIDv7 using the injected clock.
 
std::optional< PersistentId > generate (std::chrono::system_clock::time_point timestamp) const
 Generates a UUIDv7 for an explicit timestamp.
 

详细描述

Injectable UUIDv7 generator.

UUIDv7 contains a Unix-millisecond timestamp and random bits. This class assembles the value but does not provide entropy itself. The caller owns the security and availability properties of the injected entropy source.

在文件 Identity.h 第 478 行定义.

构造及析构函数说明

◆ UuidV7Generator()

eve::UuidV7Generator::UuidV7Generator ( UuidEntropySource  entropy,
UuidClock  clock = {} 
)
explicit

Creates a generator with an injected entropy source and optional clock.

参数
entropySource for the UUID random portion; an empty source makes generation fail.
clockSource for the timestamp; an empty source uses system_clock at call time.

在文件 Identity.cpp 第 77 行定义.

成员函数说明

◆ generate() [1/2]

std::optional< PersistentId > eve::UuidV7Generator::generate ( ) const

Generates a UUIDv7 using the injected clock.

返回
A generated PersistentId, or empty when entropy/time is unavailable or out of range.

在文件 Identity.cpp 第 80 行定义.

引用了 generate().

被这些函数引用 generate().

◆ generate() [2/2]

std::optional< PersistentId > eve::UuidV7Generator::generate ( std::chrono::system_clock::time_point  timestamp) const

Generates a UUIDv7 for an explicit timestamp.

参数
timestampUnix time used for the UUIDv7 millisecond field.
返回
A generated PersistentId, or empty when entropy/time is unavailable or out of range.

在文件 Identity.cpp 第 85 行定义.

引用了 eve::generateUuidV7().


该类的文档由以下文件生成: