载入中...
搜索中...
未找到
eve::inventory::InventoryContainerAdapter类 参考final

Adapts one Bag or EquipmentSet without changing their legacy APIs. 更多...

#include <ContainerAdapters.h>

类 eve::inventory::InventoryContainerAdapter 继承关系图:
eve::container::IContainer

类

class  PreparedState
 

Public 成员函数

 InventoryContainerAdapter (eve::container::ContainerId id, Bag *bag, eve::container::Capacity capacity=eve::container::Capacity::unlimited())
 Bind a borrowed bag.
 
 InventoryContainerAdapter (eve::container::ContainerId id, EquipmentSet *equipment)
 Bind a borrowed equipment set.
 
const eve::container::ContainerDescriptor & descriptor () const noexcept override
 Descriptor.
 
eve::Result< eve::container::ContainerSnapshot > snapshot () const override
 Snapshot.
 
eve::Result< void > validateInsert (const eve::container::ContainerObject &object, std::optional< eve::container::SlotIndex > destination, std::optional< eve::container::MembershipId > ignoredObject=std::nullopt) const override
 Validate insert.
 
eve::Result< std::unique_ptr< eve::container::IContainer::PreparedState > > prepare (const eve::container::ContainerSnapshot &expected, const eve::container::ContainerSnapshot &candidate) override
 Prepare an exact replacement from expected to candidate.
 
eve::Revision revision () const noexcept
 Return the adapter revision for optimistic transfer requests.
 
- Public 成员函数 继承自 eve::container::IContainer
virtual ~IContainer ()=default
 

详细描述

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.

参数
idStable container identity.
bagBorrowed authoritative bag storage.
capacityOptional 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.

参数
idStable container identity.
equipmentBorrowed authoritative equipment-slot storage.

在文件 ContainerAdapters.cpp 第 91 行定义.

成员函数说明

◆ descriptor()

const eve::container::ContainerDescriptor & eve::inventory::InventoryContainerAdapter::descriptor ( ) const
inlineoverridevirtualnoexcept

Descriptor.

实现了 eve::container::IContainer.

在文件 ContainerAdapters.h 第 53 行定义.

◆ prepare()

eve::Result< std::unique_ptr< eve::container::IContainer::PreparedState > > eve::inventory::InventoryContainerAdapter::prepare ( const eve::container::ContainerSnapshot &  expected,
const eve::container::ContainerSnapshot &  candidate 
)
overridevirtual

Prepare an exact replacement from expected to candidate.

参数
expectedSnapshot observed during transfer preflight.
candidateFully 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 expected snapshot. 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()

eve::Revision eve::inventory::InventoryContainerAdapter::revision ( ) const
inlinenoexcept

Return the adapter revision for optimistic transfer requests.

在文件 ContainerAdapters.h 第 68 行定义.

◆ snapshot()

◆ validateInsert()


该类的文档由以下文件生成: