载入中...
搜索中...
未找到
eve::transaction::AtomicResourcePayment类 参考final

Coordinates a resource debit with one domain effect participant. 更多...

#include <AtomicResourcePayment.h>

静态 Public 成员函数

static eve::Result< TransactionReceipt > execute (const TransactionContext &context, std::span< ITransactionParticipant * > participants)
 Execute already prepared domain participants as one transaction.
 
static eve::Result< TransactionReceipt > execute (const TransactionContext &context, eve::resource::IResourceAccount &account, const eve::resource::CostSpec &cost, std::span< ITransactionParticipant * > participants)
 Execute a resource debit and several domain participants atomically.
 
static eve::Result< TransactionReceipt > execute (const TransactionContext &context, ITransactionParticipant &effect)
 Execute an effect without a resource cost.
 
static eve::Result< TransactionReceipt > execute (const TransactionContext &context, eve::resource::IResourceAccount &account, const eve::resource::CostSpec &cost, ITransactionParticipant &effect)
 Execute one canonical cost and one domain effect atomically.
 
static eve::Result< TransactionReceipt > execute (std::string transactionId, eve::resource::IResourceAccount &account, const eve::resource::CostSpec &cost, ITransactionParticipant &effect)
 Convenience overload using a stable string transaction id.
 

详细描述

Coordinates a resource debit with one domain effect participant.

The effect is prepared before the resource reservation is committed. A preparation failure therefore never charges the account. If a later commit fails after the effect became visible, Coordinator uses the participant's compensation contract to restore the effect and the account. This helper owns neither participant nor account; all references are borrowed for the synchronous call and must remain valid until it returns. The caller and both participants must use the same owner thread.

在文件 AtomicResourcePayment.h 第 29 行定义.

成员函数说明

◆ execute() [1/5]

eve::Result< TransactionReceipt > eve::transaction::AtomicResourcePayment::execute ( const TransactionContext &  context,
eve::resource::IResourceAccount &  account,
const eve::resource::CostSpec &  cost,
ITransactionParticipant &  effect 
)
static

Execute one canonical cost and one domain effect atomically.

参数
contextCorrelation metadata copied into the transaction receipt.
accountBorrowed authoritative resource account.
costValid canonical positive cost borrowed for this call.
effectBorrowed domain participant; it owns its staged state.
返回
A committed receipt, or a failure after rollback/compensation.
备注
The account is addressed by the reservation's AccountNonce; no current/default account lookup is performed.

在文件 AtomicResourcePayment.cpp 第 25 行定义.

引用了 account, context, cost, effect , 以及 execute().

◆ execute() [2/5]

eve::Result< TransactionReceipt > eve::transaction::AtomicResourcePayment::execute ( const TransactionContext &  context,
eve::resource::IResourceAccount &  account,
const eve::resource::CostSpec &  cost,
std::span< ITransactionParticipant * >  participants 
)
static

Execute a resource debit and several domain participants atomically.

参数
contextCorrelation metadata copied into the receipt.
accountBorrowed authoritative account.
costValid canonical positive cost borrowed for this call.
participantsDomain participants; the debit is committed last.
返回
A committed receipt or complete rollback/compensation diagnostics.
备注
All domain participants are prepared before the account is reserved. The debit participant is appended after the supplied participants so a failed debit compensates already-visible domain effects in reverse order.

在文件 AtomicResourcePayment.cpp 第 33 行定义.

引用了 account, context, cost, eve::Diagnostic::error(), eve::transaction::Coordinator::execute(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::resource::CostSpec::isValid().

◆ execute() [3/5]

eve::Result< TransactionReceipt > eve::transaction::AtomicResourcePayment::execute ( const TransactionContext &  context,
ITransactionParticipant &  effect 
)
static

Execute an effect without a resource cost.

参数
contextCorrelation metadata copied into the transaction receipt.
effectBorrowed domain participant; it owns its staged state.
返回
A committed receipt or structured lifecycle diagnostics.

在文件 AtomicResourcePayment.cpp 第 19 行定义.

引用了 context, effect , 以及 execute().

◆ execute() [4/5]

eve::Result< TransactionReceipt > eve::transaction::AtomicResourcePayment::execute ( const TransactionContext &  context,
std::span< ITransactionParticipant * >  participants 
)
static

Execute already prepared domain participants as one transaction.

参数
contextCorrelation metadata copied into the receipt.
participantsBorrowed, unique participants in commit order.
返回
A committed receipt or complete rollback/compensation diagnostics.
备注
This overload is the composition boundary for domain adapters which have more than one effect (for example Card movement plus card state plus a ruleset effect). The payment helper does not own the participants.

在文件 AtomicResourcePayment.cpp 第 13 行定义.

引用了 context , 以及 eve::transaction::Coordinator::execute().

被这些函数引用 eve::rpg::Crafting::begin(), eve::rts::RTSProductionActionAdapter::build(), execute(), execute(), execute(), eve::rts::RTSEconomyAdapter::pay() , 以及 eve::card::CardPlayPaymentAdapter::play().

◆ execute() [5/5]

eve::Result< TransactionReceipt > eve::transaction::AtomicResourcePayment::execute ( std::string  transactionId,
eve::resource::IResourceAccount &  account,
const eve::resource::CostSpec &  cost,
ITransactionParticipant &  effect 
)
static

Convenience overload using a stable string transaction id.

参数
transactionIdNon-empty transaction id owned by the call.
accountBorrowed authoritative resource account.
costValid canonical positive cost borrowed for this call.
effectBorrowed domain participant.
返回
A committed receipt or structured lifecycle diagnostics.

在文件 AtomicResourcePayment.cpp 第 53 行定义.

引用了 account, cost, effect, eve::Diagnostic::error(), execute(), eve::Result< T >::failure() , 以及 eve::InvalidArgument.


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