载入中...
搜索中...
未找到
eve::statepatch::StoreTransactionParticipant类 参考final

Transaction participant that atomically applies one StatePatch batch. 更多...

#include <StatePatch.h>

类 eve::statepatch::StoreTransactionParticipant 继承关系图:
eve::transaction::ITransactionParticipant

Public 成员函数

 StoreTransactionParticipant (Store &store, PatchBatch &batch)
 Bind one patch batch to a Store transaction.
 
 ~StoreTransactionParticipant () override=default
 Store transaction participant.
 
std::string_view name () const noexcept override
 Stable participant name used in transaction diagnostics.
 
eve::Result< void > prepare (const transaction::TransactionContext &context) override
 Validate and privately stage the batch.
 
eve::Result< void > commit (const transaction::TransactionContext &context) override
 Publish the staged batch as one Store state swap.
 
eve::Result< void > rollback (const transaction::TransactionContext &context) override
 Discard an unpublished candidate state.
 
eve::Result< void > compensate (const transaction::TransactionContext &context) override
 Restore the state captured before this participant committed.
 
- Public 成员函数 继承自 eve::transaction::ITransactionParticipant
virtual ~ITransactionParticipant ()=default
 Releases ITransactionParticipant resources.
 

详细描述

Transaction participant that atomically applies one StatePatch batch.

The participant owns neither store nor batch; both are borrowed and must remain alive and unchanged by other writers until the coordinator finishes. prepare validates against a private complete-state candidate, commit swaps that candidate into the store, rollback discards it, and compensate swaps the pre-commit state back after a later participant has failed. Compensation is not a rollback: it is an explicit undo of an effect that was already made observable.

This class is synchronous and not thread-safe. It must be used on the same thread as its Store, and must not be retained for a later frame or task.

在文件 StatePatch.h 第 230 行定义.

构造及析构函数说明

◆ StoreTransactionParticipant()

eve::statepatch::StoreTransactionParticipant::StoreTransactionParticipant ( Store &  store,
PatchBatch &  batch 
)
inline

Bind one patch batch to a Store transaction.

参数
storeBorrowed authoritative Store to mutate on commit.
batchBorrowed batch whose operations are staged and validated.

在文件 StatePatch.h 第 237 行定义.

◆ ~StoreTransactionParticipant()

eve::statepatch::StoreTransactionParticipant::~StoreTransactionParticipant ( )
overridedefault

Store transaction participant.

成员函数说明

◆ commit()

eve::Result< void > eve::statepatch::StoreTransactionParticipant::commit ( const transaction::TransactionContext &  context)
overridevirtual

◆ compensate()

eve::Result< void > eve::statepatch::StoreTransactionParticipant::compensate ( const transaction::TransactionContext &  context)
overridevirtual

Restore the state captured before this participant committed.

实现了 eve::transaction::ITransactionParticipant.

在文件 StatePatch.cpp 第 628 行定义.

引用了 eve::Applied, eve::Conflict, context, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().

◆ name()

std::string_view eve::statepatch::StoreTransactionParticipant::name ( ) const
inlineoverridevirtualnoexcept

Stable participant name used in transaction diagnostics.

重载 eve::transaction::ITransactionParticipant .

在文件 StatePatch.h 第 242 行定义.

◆ prepare()

eve::Result< void > eve::statepatch::StoreTransactionParticipant::prepare ( const transaction::TransactionContext &  context)
overridevirtual

◆ rollback()

eve::Result< void > eve::statepatch::StoreTransactionParticipant::rollback ( const transaction::TransactionContext &  context)
overridevirtual

Discard an unpublished candidate state.

实现了 eve::transaction::ITransactionParticipant.

在文件 StatePatch.cpp 第 618 行定义.

引用了 eve::Applied, context, eve::Status::success() , 以及 eve::Result< T >::success().


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