Adapts one Bag or EquipmentSet without changing their legacy APIs. 更多...
#include <ContainerAdapters.h>
类 | |
| class | PreparedState |
详细描述
Adapts one Bag or EquipmentSet without changing their legacy APIs.
The Bag or EquipmentSet is borrowed and remains the sole owner of its slot data. Callers must serialize access to the owner for the full synchronous snapshot/prepare/commit operation; a prepared state must be committed or rolled back before the owner is destroyed. Restore recreates the Bag or EquipmentSet first, then binds a fresh adapter. The adapter never retains temporary pointers in a snapshot and never deletes inventory items.
在文件 ContainerAdapters.h 第 35 行定义.
构造及析构函数说明
◆ InventoryContainerAdapter() [1/2]
| eve::inventory::InventoryContainerAdapter::InventoryContainerAdapter | ( | eve::container::ContainerId | id, |
| Bag * | bag, | ||
| eve::container::Capacity | capacity = eve::container::Capacity::unlimited() |
||
| ) |
Bind a borrowed bag.
- 参数
-
id Stable container identity. bag Borrowed authoritative bag storage. capacity Optional capacity; an unlimited value uses bag slots.
在文件 ContainerAdapters.cpp 第 81 行定义.
◆ InventoryContainerAdapter() [2/2]
| eve::inventory::InventoryContainerAdapter::InventoryContainerAdapter | ( | eve::container::ContainerId | id, |
| EquipmentSet * | equipment | ||
| ) |
Bind a borrowed equipment set.
- 参数
-
id Stable container identity. equipment Borrowed authoritative equipment-slot storage.
在文件 ContainerAdapters.cpp 第 91 行定义.
成员函数说明
◆ descriptor()
|
inlineoverridevirtualnoexcept |
◆ prepare()
|
overridevirtual |
Prepare an exact replacement from expected to candidate.
- 参数
-
expected Snapshot observed during transfer preflight. candidate Fully constructed post-transfer snapshot.
- 返回
- A detached state whose commit and rollback operations cannot fail; no observable state may change before commit.
- 备注
- The adapter must reject a stale
expectedsnapshot. The adapter is borrowed and must outlive the returned state; the caller must externally serialize access to the adapter.
Prepare.
实现了 eve::container::IContainer.
在文件 ContainerAdapters.cpp 第 242 行定义.
引用了 eve::inventory::Bag, eve::container::ContainerDescriptor::capacity, eve::Conflict, eve::container::ContainerSnapshot::entries, eve::inventory::Equipment, eve::Diagnostic::error(), eve::inventory::Bag::getSlotCount(), eve::inventory::EquipmentSet::getSlotCount(), eve::container::ContainerSnapshot::id, eve::container::ContainerDescriptor::id, ids, eve::detail::StrongUint64< Tag >::incremented(), eve::InvalidArgument, eve::InvariantViolation, eve::container::Capacity::isUnlimited(), eve::container::ContainerId::isValid(), payload, eve::container::ContainerSnapshot::revision, second, slots, snapshot(), eve::StaleHandle , 以及 eve::container::Capacity::value().
◆ revision()
|
inlinenoexcept |
Return the adapter revision for optimistic transfer requests.
在文件 ContainerAdapters.h 第 68 行定义.
◆ snapshot()
|
overridevirtual |
Snapshot.
实现了 eve::container::IContainer.
在文件 ContainerAdapters.cpp 第 141 行定义.
引用了 eve::inventory::Bag, eve::container::ContainerDescriptor::capacity, eve::Conflict, count, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::inventory::Bag::getSlotCount(), eve::inventory::EquipmentSet::getSlotCount(), eve::container::ContainerDescriptor::id, id, ids, index, eve::InvalidArgument, eve::InvariantViolation, eve::container::Capacity::isUnlimited(), eve::container::ContainerId::isValid(), snapshot(), eve::Result< T >::success() , 以及 eve::container::Capacity::value().
被这些函数引用 prepare() , 以及 snapshot().
◆ validateInsert()
|
overridevirtual |
Validate insert.
实现了 eve::container::IContainer.
在文件 ContainerAdapters.cpp 第 176 行定义.
引用了 eve::inventory::EquipmentSet::allowedTags(), eve::inventory::Bag, eve::inventory::InventorySystem::canAdd(), eve::container::ContainerDescriptor::capacity, eve::Conflict, current, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::inventory::ItemRegistry::find(), eve::inventory::Bag::getSlotCount(), eve::inventory::EquipmentSet::getSlotCount(), eve::InvalidArgument, eve::container::Capacity::isUnlimited(), eve::NotFound, payload, eve::PreconditionViolation, eve::inventory::Bag::slots(), eve::inventory::EquipmentSet::stackAt(), eve::StaleHandle, eve::Result< T >::success(), tag, target, type , 以及 eve::container::Capacity::value().
该类的文档由以下文件生成:
- src/modules/inventory/ContainerAdapters.h
- src/modules/inventory/ContainerAdapters.cpp
Public 成员函数 继承自