Restricts one AttributeSetResourceAccount to Mana or Stamina. 更多...
#include <AttributeResourceAccount.h>
静态 Public 成员函数 | |
| static eve::Result< eve::resource::CostSpec > | makeCost (AttributeResourceKind kind, std::int64_t amount) |
| Build a positive cost for this view's named resource. | |
详细描述
Restricts one AttributeSetResourceAccount to Mana or Stamina.
This is a non-owning view, not another balance store and not another account identity. The wrapped AttributeSetResourceAccount remains the sole nonce issuer and reservation owner, so a credential produced by this view follows the same AccountNonce rules as a direct attribute account. The wrapped account must outlive the view; calls are synchronous on the wrapped account's owner thread.
在文件 AttributeResourceAccount.h 第 32 行定义.
构造及析构函数说明
◆ AttributeResourceAccountAdapter() [1/3]
|
noexcept |
Bind a named view to an existing AttributeSet resource account.
在文件 AttributeResourceAccount.cpp 第 12 行定义.
◆ AttributeResourceAccountAdapter() [2/3]
|
delete |
◆ AttributeResourceAccountAdapter() [3/3]
|
delete |
◆ ~AttributeResourceAccountAdapter()
|
overridedefault |
Attribute resource account adapter.
成员函数说明
◆ 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.
在文件 AttributeResourceAccount.cpp 第 48 行定义.
引用了 eve::attributes::AttributeSetResourceAccount::canAfford(), cost, eve::Result< T >::failure() , 以及 valid.
◆ 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.
Commits .
实现了 eve::resource::IResourceAccount.
在文件 AttributeResourceAccount.cpp 第 73 行定义.
引用了 eve::attributes::AttributeSetResourceAccount::commit(), eve::resource::Reservation::cost, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::resource::Reservation::isValid(), eve::resource::CostSpec::items(), name , 以及 eve::resource::CostSpec::size().
◆ 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.
在文件 AttributeResourceAccount.cpp 第 67 行定义.
引用了 cost, eve::attributes::AttributeSetResourceAccount::credit(), eve::Result< T >::failure() , 以及 valid.
◆ 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.
在文件 AttributeResourceAccount.cpp 第 61 行定义.
引用了 cost, eve::attributes::AttributeSetResourceAccount::debit(), eve::Result< T >::failure() , 以及 valid.
◆ kind()
|
inlinenoexcept |
Return the resource exposed by this view.
在文件 AttributeResourceAccount.h 第 45 行定义.
被这些函数引用 makeCost().
◆ makeCost()
|
static |
Build a positive cost for this view's named resource.
- 参数
-
kind Mana or Stamina. amount Positive integer quantity.
- 返回
- Canonical CostSpec or a validation failure.
在文件 AttributeResourceAccount.cpp 第 24 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, kind(), name , 以及 eve::resource::CostSpec::single().
◆ 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.
在文件 AttributeResourceAccount.cpp 第 55 行定义.
引用了 cost, eve::Result< T >::failure(), eve::attributes::AttributeSetResourceAccount::reserve() , 以及 valid.
◆ 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.
在文件 AttributeResourceAccount.cpp 第 84 行定义.
引用了 eve::resource::Reservation::cost, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::resource::Reservation::isValid(), eve::resource::CostSpec::items(), name, eve::attributes::AttributeSetResourceAccount::rollback() , 以及 eve::resource::CostSpec::size().
该类的文档由以下文件生成:
- src/modules/attributes/AttributeResourceAccount.h
- src/modules/attributes/AttributeResourceAccount.cpp
Public 成员函数 继承自