载入中...
搜索中...
未找到
GameEvent.h
浏览该文件的文档.
379 [[nodiscard]] eve::Result<eve::SnapshotEnvelope> snapshot(const eve::SnapshotHashProvider& hashProvider) const;
389 [[nodiscard]] eve::Result<std::string> snapshotEnvelopeJson(const eve::SnapshotHashProvider& hashProvider) const;
426 [[nodiscard("event stream ownership must be retained or explicitly handled")]] static GameEventLog* newLog();
Stream-local event ordering value.
Strong identity values shared by persistence, content and logical-name APIs.
Move-only, checked operation results for the common layer.
Monotonic state revision for concurrency and change checks.
Persistent data-contract version identity.
Versioned, integrity-checked persistence envelopes.
Common time values and an injectable deterministic simulation clock.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
std::string format() const
Formats the ID in lower-case canonical UUID text.
Definition Identity.h:173
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
Tagged direct causation reference to an event or command.
Definition GameEvent.h:96
static CausationRef fromEventId(EventId value)
Creates a causation reference to an event.
Definition GameEvent.h:105
CausationRef()=default
Constructs an absent causation reference.
bool isCanonical() const noexcept
Returns whether this reference uses the canonical ID form.
Definition GameEvent.h:136
std::string format() const
Returns the stable UUID or compatibility text projection.
Definition GameEvent.h:139
friend bool operator==(const CausationRef &, const CausationRef &) noexcept=default
static CausationRef fromLegacy(std::string value)
Creates a compatibility-only arbitrary string causation.
Definition GameEvent.h:125
static CausationRef fromCommandId(CommandId value)
Creates a causation reference to a command.
Definition GameEvent.h:115
Strong business-workflow correlation identity.
Definition GameEvent.h:49
static CorrelationId fromLegacy(std::string value)
Creates a compatibility-only arbitrary string correlation.
Definition GameEvent.h:66
bool isCanonical() const noexcept
Returns whether this reference uses the canonical ID form.
Definition GameEvent.h:77
std::string format() const
Returns the stable ID or compatibility text projection.
Definition GameEvent.h:80
CorrelationId()=default
Constructs an absent correlation reference.
friend bool operator==(const CorrelationId &, const CorrelationId &) noexcept=default
static CorrelationId fromEventId(EventId value)
Creates a canonical correlation ID from an EventId.
Definition GameEvent.h:58
Independent sequence cursor used to consume an GameEventLog in batches.
Definition GameEvent.h:224
Deterministic in-memory stream of topic-neutral event envelopes.
Definition GameEvent.h:261
GameEventLog & operator=(GameEventLog &&)=default
Operator =.
GameEventLog()=default
Creates a stream without an implicit entropy source.
GameEventLog(eve::PersistentId instanceId)
Creates a stream with a persistent snapshot identity.
Definition GameEvent.h:278
eve::Result< EventSequence > appendTyped(GameEvent envelope, const Payload &payload, const std::function< eve::Result< std::string >(const Payload &)> &encode)
Encodes a strongly typed domain payload and appends its envelope.
Definition GameEvent.h:307
GameEventLog(const GameEventLog &)=delete
GameEventLog & operator=(const GameEventLog &)=delete
Script module factory for generic GameEventLog objects.
Definition GameEvent.h:409
Module_REG(GameEventModule)
~GameEventModule() override=default
Releases GameEventModule resources.
static GameEventLog * newLog()
Allocates a module-owned event stream. @ownership Borrowed from the manager-owned GameEvent module; t...
Definition GameEvent.cpp:587
GameEventModule()=default
Constructs a GameEventModule.
Definition Container.h:35
std::ostream & operator<<(std::ostream &stream, CorrelationId::Kind kind)
Writes a correlation representation tag for diagnostics.
Definition GameEvent.h:154
@ InvalidArgument
std::function< std::chrono::system_clock::time_point()> UuidClock
Clock callback used by the injectable UUIDv7 generator.
Definition Identity.h:469
StrongUuid< detail::CommandIdTag > CommandId
Stable command identity for causal references.
Definition Identity.h:288
detail::StrongUint64< detail::SchemaVersionTag > SchemaVersion
Persistent data-format version; not a runtime replacement generation.
Definition SchemaVersion.h:13
std::function< bool(std::span< std::uint8_t > bytes)> UuidEntropySource
Entropy callback used by UUIDv7 generation.
Definition Identity.h:466
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31
StrongUuid< detail::EventIdTag > EventId
Stable event identity for event envelopes and causal references.
Definition Identity.h:285
detail::StrongUint64< detail::EventSequenceTag > EventSequence
Stream-local event ordering value; it is not a global event identity.
Definition EventSequence.h:13
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46
EventSequence sequence
Sequence assigned by the owning stream; it is never global identity.
Definition GameEvent.h:187
EventId eventId
Stable event identity; nil is allowed only for legacy transient events.
Definition GameEvent.h:185
std::string payload
Canonical serialized payload at the stream persistence boundary.
Definition GameEvent.h:207
SchemaVersion schemaVersion
Version of the payload schema, not a stream or runtime generation.
Definition GameEvent.h:201
uint32_t flags
Domain-defined bit flags; their meanings belong to the schema.
Definition GameEvent.h:205
SimulationTick tick
Deterministic simulation time at which the event was emitted.
Definition GameEvent.h:203
CausationRef causation
Direct causation reference, normally an event or command ID.
Definition GameEvent.h:195
Strongly typed event value used before serialization into a stream.
Definition GameEvent.h:216