Adapts one caller-owned EconomyLedger to IResourceAccount. 更多...
#include <EconomyLedgerResourceAccount.h>
详细描述
Adapts one caller-owned EconomyLedger to IResourceAccount.
Resource ids map directly to EconomyLedger type ids. The protocol adapter gives credit/debit strict all-or-nothing semantics for multi-resource operations; the legacy EconomyLedger::credit API remains available for gather overflow accounting and may still accept a partial credit at its compatibility boundary. The ledger owns balance, income, expense and capacity facts; this adapter owns only reservation state.
The referenced ledger is borrowed and must outlive this adapter. Operations are synchronous and must be called on the owner thread.
在文件 EconomyLedgerResourceAccount.h 第 31 行定义.
构造及析构函数说明
◆ EconomyLedgerResourceAccount() [1/3]
|
explicit |
Bind an account adapter to an existing caller-owned ledger.
在文件 EconomyLedgerResourceAccount.cpp 第 94 行定义.
◆ EconomyLedgerResourceAccount() [2/3]
|
delete |
◆ EconomyLedgerResourceAccount() [3/3]
|
delete |
◆ ~EconomyLedgerResourceAccount()
|
overridedefault |
Economy ledger resource account.
成员函数说明
◆ canAfford()
|
overridevirtual |
Query whether a cost can be paid from currently available funds.
- 参数
-
cost Valid canonical cost borrowed for the call.
- 返回
- Structured affordability, or a failed Result for invalid input/provider failure.
Can afford.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 153 行定义.
引用了 cost, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::resource::AccountNonce::isZero(), eve::resource::CostSpec::items() , 以及 eve::Result< T >::success().
◆ commit()
|
overridevirtual |
Commit one active reservation as an atomic debit.
- 参数
-
reservation Credential borrowed for the call.
- 返回
- A debit receipt, or Conflict/NotFound without partial mutation.
Commit.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 332 行定义.
引用了 eve::Applied, covered, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::resource::AccountNonce::isZero(), eve::Status::success(), eve::Result< T >::success() , 以及 eve::detail::StrongUint64< Tag >::value().
◆ credit()
|
overridevirtual |
Atomically credit all items immediately.
- 参数
-
cost Valid canonical positive quantities borrowed for the call.
- 返回
- A credit receipt, or a failure with no state mutation.
Credit.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 276 行定义.
引用了 eve::Applied, cost, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::resource::AccountNonce::isZero(), eve::Status::success(), eve::Result< T >::success() , 以及 eve::detail::StrongUint64< Tag >::value().
◆ debit()
|
overridevirtual |
Atomically debit all items immediately.
- 参数
-
cost Valid canonical cost borrowed for the call.
- 返回
- A debit receipt, or a failure with no state mutation.
Debit.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 250 行定义.
引用了 eve::Applied, canAfford(), cost, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::success(), eve::Result< T >::success() , 以及 eve::detail::StrongUint64< Tag >::value().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
delete |
◆ reserve()
|
overridevirtual |
Reserve all items of a cost without changing visible balances.
- 参数
-
cost Valid canonical cost borrowed for the call.
- 返回
- A reservation credential, or a failure with no state mutation.
Reserve.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 186 行定义.
引用了 eve::Applied, canAfford(), eve::Conflict, cost, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::failure(), id, eve::Status::success(), eve::Result< T >::success(), eve::detail::StrongUint64< Tag >::value() , 以及 value.
◆ rollback()
|
overridevirtual |
Release one active reservation without changing balances.
- 参数
-
reservation Credential borrowed for the call.
- 返回
- Applied on the first rollback; duplicate/foreign credentials fail explicitly.
Rollback.
实现了 eve::resource::IResourceAccount.
在文件 EconomyLedgerResourceAccount.cpp 第 369 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::resource::AccountNonce::isZero(), eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/economy/EconomyLedgerResourceAccount.h
- src/modules/economy/EconomyLedgerResourceAccount.cpp
Public 成员函数 继承自