命名空间 | |
| namespace | detail |
类 | |
| struct | DefinitionHandle |
| A generation-qualified reference to one definition incarnation. 更多... | |
| struct | InstanceIdentity |
| Canonical identity carried by every typed runtime instance. 更多... | |
| struct | ReloadOutcome |
| Identity transition emitted by a typed runtime reload operation. 更多... | |
| class | RuntimeInstance |
| Owns one strongly typed runtime state and its definition identity. 更多... | |
| class | RuntimeInstanceCore |
Type-erased bookkeeping shared by every RuntimeInstance<State>. 更多... | |
类型定义 | |
| template<class State > | |
| using | RuntimeStateEncoder = std::function< eve::Result< eve::Value >(const State &)> |
| Converts one domain-owned runtime state into an owning Value. | |
| template<class State > | |
| using | RuntimeStateDecoder = std::function< eve::Result< State >(const eve::Value &)> |
| Decodes one domain-owned runtime state from an owning Value. | |
枚举 | |
| enum class | ReloadPolicy : std::uint8_t { KeepInstanceValues , ReapplyDefaults , RebuildInstance , RejectWhileActive } |
| Policy used when a live definition is replaced. 更多... | |
| enum class | ReloadDisposition : std::uint8_t { Unchanged , Kept , DefaultsReapplied , Rebuilt } |
| Observable result of a successful or no-op definition reload. 更多... | |
函数 | |
| const char * | reloadPolicyName (ReloadPolicy policy) noexcept |
| Stable spelling for a runtime definition reload policy. | |
| template<class State > | |
| void * | cloneRuntimeState (const void *state) |
Payload operations for one state type; used by RuntimeInstance<State>. | |
| template<class State > | |
| void | assignRuntimeState (void *destination, const void *source) |
| Payload assignment for one state type. | |
| template<class State > | |
| void | destroyRuntimeState (void *state) noexcept |
| Payload destruction for one state type. | |
| template<class State > | |
| eve::Result< eve::SnapshotEnvelope > | snapshotRuntimeInstance (const RuntimeInstance< State > &runtime, std::string type, eve::LogicalId schema, eve::SchemaVersion schemaVersion, eve::Revision revision, eve::SimulationTick tick, const eve::SnapshotHashProvider &hashProvider, const RuntimeStateEncoder< State > &encode) |
| Capture a typed runtime instance in the common snapshot envelope. | |
| template<class State > | |
| eve::Result< void > | restoreRuntimeInstance (RuntimeInstance< State > &runtime, const eve::SnapshotEnvelope &snapshot, std::string_view expectedType, const eve::LogicalId &expectedSchema, eve::SchemaVersion expectedVersion, const eve::SnapshotHashProvider &hashProvider, const RuntimeStateDecoder< State > &decode) |
| Verify and atomically restore a typed runtime instance. | |
类型定义说明
◆ RuntimeStateDecoder
| using eve::definition::RuntimeStateDecoder = typedef std::function<eve::Result<State>(const eve::Value&)> |
Decodes one domain-owned runtime state from an owning Value.
在文件 RuntimeSnapshot.h 第 31 行定义.
◆ RuntimeStateEncoder
| using eve::definition::RuntimeStateEncoder = typedef std::function<eve::Result<eve::Value>(const State&)> |
Converts one domain-owned runtime state into an owning Value.
在文件 RuntimeSnapshot.h 第 27 行定义.
枚举类型说明
◆ ReloadDisposition
|
strong |
Observable result of a successful or no-op definition reload.
| 枚举值 | |
|---|---|
| Unchanged | |
| Kept | |
| DefaultsReapplied | |
| Rebuilt | |
在文件 DefinitionRuntime.h 第 132 行定义.
◆ ReloadPolicy
|
strong |
Policy used when a live definition is replaced.
在文件 DefinitionRuntime.h 第 30 行定义.
函数说明
◆ assignRuntimeState()
| void eve::definition::assignRuntimeState | ( | void * | destination, |
| const void * | source | ||
| ) |
Payload assignment for one state type.
Assign runtime state.
在文件 DefinitionRuntime.h 第 261 行定义.
引用了 source.
◆ cloneRuntimeState()
| void * eve::definition::cloneRuntimeState | ( | const void * | state | ) |
Payload operations for one state type; used by RuntimeInstance<State>.
Clones runtime state.
State.
在文件 DefinitionRuntime.h 第 253 行定义.
引用了 state.
◆ destroyRuntimeState()
|
noexcept |
Payload destruction for one state type.
Destroys runtime state.
在文件 DefinitionRuntime.h 第 268 行定义.
引用了 state.
◆ reloadPolicyName()
|
inlinenoexcept |
Stable spelling for a runtime definition reload policy.
- 返回
- A non-null borrowed pointer to immutable static text; the caller must not free or retain it as mutable storage. @ownership Borrowed from the program's static storage. @nullable No. @lifetime Static for the process lifetime. @thread Thread-safe and side-effect free. @reentrancy Does not invoke callbacks or access runtime-instance state.
在文件 DefinitionRuntime.h 第 51 行定义.
引用了 KeepInstanceValues, ReapplyDefaults, RebuildInstance , 以及 RejectWhileActive.
◆ restoreRuntimeInstance()
| eve::Result< void > eve::definition::restoreRuntimeInstance | ( | RuntimeInstance< State > & | runtime, |
| const eve::SnapshotEnvelope & | snapshot, | ||
| std::string_view | expectedType, | ||
| const eve::LogicalId & | expectedSchema, | ||
| eve::SchemaVersion | expectedVersion, | ||
| const eve::SnapshotHashProvider & | hashProvider, | ||
| const RuntimeStateDecoder< State > & | decode | ||
| ) |
Verify and atomically restore a typed runtime instance.
- 参数
-
runtime Destination instance; no state is changed on any failure. snapshot Candidate common envelope. expectedType Exact adapter-owned snapshot type. expectedSchema Exact adapter-owned payload schema. expectedVersion Only this version is accepted; migration belongs to the domain adapter and must happen before this function. hashProvider Explicit provider used to verify the envelope hash. decode Domain decoder; it must return a complete candidate state.
- 返回
- Success, or a schema/hash/identity/stale/decode failure.
Restore runtime instance.
Failure.
Failure.
Failure.
Failure.
Failure.
Error.
Generation.
Failure.
Failure.
Failure.
Failure.
在文件 RuntimeSnapshot.h 第 135 行定义.
引用了 active, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), generation, eve::Value::getIf(), eve::SnapshotEnvelope::instanceId, eve::InvalidArgument, object, eve::DefinitionRef::parse(), eve::detail::Id128< Tag >::parse(), eve::ParseError, eve::SnapshotEnvelope::payload, eve::SnapshotEnvelope::revision, eve::definition::detail::runtimeSnapshotShape(), eve::definition::detail::runtimeSnapshotUint(), eve::SnapshotEnvelope::schema, eve::SnapshotEnvelope::schemaVersion, shape, eve::StaleHandle, eve::SnapshotEnvelope::tick, eve::SnapshotEnvelope::type, eve::UnknownVersion, eve::Unsupported, eve::validateSnapshotPayloadMetadata() , 以及 eve::verifySnapshotEnvelope().
被这些函数引用 eve::card::CardDefinitionRuntime::restore(), eve::rpg::SkillDefinitionRuntime::restore(), eve::vehicle::VehicleDefinitionRuntime::restore() , 以及 eve::weapon::WeaponDefinitionRuntime::restore().
◆ snapshotRuntimeInstance()
| eve::Result< eve::SnapshotEnvelope > eve::definition::snapshotRuntimeInstance | ( | const RuntimeInstance< State > & | runtime, |
| std::string | type, | ||
| eve::LogicalId | schema, | ||
| eve::SchemaVersion | schemaVersion, | ||
| eve::Revision | revision, | ||
| eve::SimulationTick | tick, | ||
| const eve::SnapshotHashProvider & | hashProvider, | ||
| const RuntimeStateEncoder< State > & | encode | ||
| ) |
Capture a typed runtime instance in the common snapshot envelope.
- 参数
-
runtime Instance whose identity and state are captured. type Stable runtime type name, owned by the domain adapter. schema Stable payload schema identifier. schemaVersion Exact version emitted by the adapter. revision Domain revision associated with this capture. tick Deterministic simulation tick associated with this capture. hashProvider Explicit content-digest provider. encode Domain encoder; it must not retain the state reference.
- 返回
- A sealed envelope or a structured encoding/validation failure.
Snapshot runtime instance.
Failure.
Error.
Make snapshot envelope.
在文件 RuntimeSnapshot.h 第 96 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::makeSnapshotEnvelope(), payload, revision, tick , 以及 type.
被这些函数引用 eve::card::CardDefinitionRuntime::snapshot(), eve::rpg::SkillDefinitionRuntime::snapshot(), eve::vehicle::VehicleDefinitionRuntime::snapshot() , 以及 eve::weapon::WeaponDefinitionRuntime::snapshot().