Transaction participant that publishes one CardData play. 更多...
#include <CardPlay.h>
Public 成员函数 | |
| CardPlayParticipant (CardData &card) | |
| Bind one card effect whose state transition is played. | |
| std::string_view | name () const noexcept override |
| Stable transaction diagnostic name. | |
| eve::Result< void > | prepare (const eve::transaction::TransactionContext &context) override |
| Validate and stage local changes for the transaction. | |
| eve::Result< void > | commit (const eve::transaction::TransactionContext &context) override |
| Publish this participant's staged changes. | |
| eve::Result< void > | rollback (const eve::transaction::TransactionContext &context) override |
| Discard a prepared but not committed stage. | |
| eve::Result< void > | compensate (const eve::transaction::TransactionContext &context) override |
| Undo an already committed external effect by compensation. | |
Public 成员函数 继承自 eve::transaction::ITransactionParticipant | |
| virtual | ~ITransactionParticipant ()=default |
| Releases ITransactionParticipant resources. | |
详细描述
Transaction participant that publishes one CardData play.
The card state remains owned by CardData. This participant only stages the phase transition and restores it on rollback/compensation; it never owns a card or an account. The card is borrowed for the synchronous transaction call and must remain live on the owner thread.
在文件 CardPlay.h 第 111 行定义.
构造及析构函数说明
◆ CardPlayParticipant()
|
explicit |
Bind one card effect whose state transition is played.
在文件 CardPlay.cpp 第 263 行定义.
成员函数说明
◆ commit()
|
overridevirtual |
Publish this participant's staged changes.
- 参数
-
context Shared borrowed transaction context.
- 返回
- Success when the participant is committed, otherwise diagnostics.
Commits .
实现了 eve::transaction::ITransactionParticipant.
在文件 CardPlay.cpp 第 277 行定义.
引用了 eve::Applied, context, eve::card::Played, state, eve::Status::success() , 以及 eve::Result< T >::success().
◆ compensate()
|
overridevirtual |
Undo an already committed external effect by compensation.
- 参数
-
context Shared borrowed transaction context.
- 返回
- Success when compensation completes,
Unsupportedwhen impossible, or another failure with diagnostics.
Compensate.
实现了 eve::transaction::ITransactionParticipant.
在文件 CardPlay.cpp 第 298 行定义.
引用了 eve::Applied, context, state, eve::Status::success() , 以及 eve::Result< T >::success().
◆ name()
|
inlineoverridevirtualnoexcept |
Stable transaction diagnostic name.
重载 eve::transaction::ITransactionParticipant .
在文件 CardPlay.h 第 117 行定义.
◆ prepare()
|
overridevirtual |
Validate and stage local changes for the transaction.
- 参数
-
context Shared borrowed transaction context.
- 返回
- Success when this participant is prepared, otherwise diagnostics.
Prepare.
实现了 eve::transaction::ITransactionParticipant.
在文件 CardPlay.cpp 第 265 行定义.
引用了 eve::Applied, context, eve::card::Disabled, eve::card::Discarded, eve::card::Played, state, eve::Status::success() , 以及 eve::Result< T >::success().
◆ rollback()
|
overridevirtual |
Discard a prepared but not committed stage.
- 参数
-
context Shared borrowed transaction context.
- 返回
- Success when provisional state is discarded, otherwise diagnostics.
Rollback.
实现了 eve::transaction::ITransactionParticipant.
在文件 CardPlay.cpp 第 290 行定义.
引用了 eve::Applied, context, eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/card/CardPlay.h
- src/modules/card/CardPlay.cpp
Public 成员函数 继承自