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

One directed payload migration step. 更多...

#include <Snapshot.h>

Public 类型

using Migration = std::function< Result< Value >(const Value &payload)>
 

Public 成员函数

Result< void > add (LogicalId schema, SchemaVersion from, SchemaVersion to, Migration migration)
 Register one schema-local migration edge.
 
Result< SnapshotEnvelope > migrate (SnapshotEnvelope snapshot, SchemaVersion targetVersion, const SnapshotHashProvider &hashProvider) const
 Migrate and reseal an envelope to an exact target version.
 

详细描述

One directed payload migration step.

Steps must move forward to a larger version. The chain never guesses a missing step and never accepts an envelope newer than the requested target.

在文件 Snapshot.h 第 145 行定义.

成员类型定义说明

◆ Migration

在文件 Snapshot.h 第 147 行定义.

成员函数说明

◆ add()

Result< void > eve::SnapshotMigrationChain::add ( LogicalId  schema,
SchemaVersion  from,
SchemaVersion  to,
Migration  migration 
)

Register one schema-local migration edge.

参数
schemaSchema whose payload is transformed.
fromVersion accepted by migration.
toVersion produced by migration; must be greater than from.
migrationPure function that returns a new owning payload.
返回
Success, or Conflict/InvalidArgument when the edge is invalid or duplicated.

在文件 Snapshot.cpp 第 196 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::LogicalId::format(), from, eve::InvalidArgument, eve::LogicalId::isValid(), key, eve::Result< T >::success() , 以及 to.

◆ migrate()

Result< SnapshotEnvelope > eve::SnapshotMigrationChain::migrate ( SnapshotEnvelope  snapshot,
SchemaVersion  targetVersion,
const SnapshotHashProvider &  hashProvider 
) const

Migrate and reseal an envelope to an exact target version.

参数
snapshotVerified source envelope; it is consumed on success.
targetVersionRequired current version.
hashProviderProvider used to verify source and seal migrated output.
返回
Migrated envelope, or UnknownVersion/Unsupported/failure.
备注
If source is newer than target, it is rejected as an unknown new version.

在文件 Snapshot.cpp 第 208 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::LogicalId::format(), eve::SnapshotEnvelope::instanceId, key, eve::makeSnapshotEnvelope(), eve::SnapshotEnvelope::payload, payload, eve::SnapshotEnvelope::revision, eve::SnapshotEnvelope::schema, eve::SnapshotEnvelope::schemaVersion, step, eve::Result< T >::success(), eve::SnapshotEnvelope::tick, eve::SnapshotEnvelope::type, eve::UnknownVersion, eve::Unsupported, eve::detail::StrongUint64< Tag >::value() , 以及 eve::verifySnapshotEnvelope().


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