Coordinates a resource debit with one domain effect participant. 更多...
#include <AtomicResourcePayment.h>
详细描述
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]
|
static |
Execute one canonical cost and one domain effect atomically.
- 参数
-
context Correlation metadata copied into the transaction receipt. account Borrowed authoritative resource account. cost Valid canonical positive cost borrowed for this call. effect Borrowed 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 行定义.
◆ execute() [2/5]
|
static |
Execute a resource debit and several domain participants atomically.
- 参数
-
context Correlation metadata copied into the receipt. account Borrowed authoritative account. cost Valid canonical positive cost borrowed for this call. participants Domain 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]
|
static |
Execute an effect without a resource cost.
- 参数
-
context Correlation metadata copied into the transaction receipt. effect Borrowed domain participant; it owns its staged state.
- 返回
- A committed receipt or structured lifecycle diagnostics.
在文件 AtomicResourcePayment.cpp 第 19 行定义.
◆ execute() [4/5]
|
static |
Execute already prepared domain participants as one transaction.
- 参数
-
context Correlation metadata copied into the receipt. participants Borrowed, 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]
|
static |
Convenience overload using a stable string transaction id.
- 参数
-
transactionId Non-empty transaction id owned by the call. account Borrowed authoritative resource account. cost Valid canonical positive cost borrowed for this call. effect Borrowed 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.
该类的文档由以下文件生成:
- src/modules/transaction/AtomicResourcePayment.h
- src/modules/transaction/AtomicResourcePayment.cpp