载入中...
搜索中...
未找到
eve::UuidV7Generator类 参考
Injectable UUIDv7 generator. 更多...
#include <UuidV7.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.
构造及析构函数说明
◆ UuidV7Generator()
|
explicit |
Creates a generator with an injected entropy source and optional clock.
- 参数
-
entropy Source for the UUID random portion; an empty source makes generation fail. clock Source for the timestamp; an empty source uses system_clock at call time.
在文件 Identity.cpp 第 78 行定义.
成员函数说明
◆ 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 第 81 行定义.
引用了 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.
- 参数
-
timestamp Unix time used for the UUIDv7 millisecond field.
- 返回
- A generated PersistentId, or empty when entropy/time is unavailable or out of range.
在文件 Identity.cpp 第 86 行定义.
该类的文档由以下文件生成:
- src/engine/common/UuidV7.h
- src/engine/common/Identity.cpp