载入中...
搜索中...
未找到
Container.h
浏览该文件的文档.
95 [[nodiscard]] static constexpr Capacity fixed(std::size_t value) noexcept { return Capacity(value, false); }
257[[nodiscard]] inline EventId deterministicContainerEventId(const ContainerId& container, const MembershipId& object,
329 [[nodiscard]] virtual Result<std::unique_ptr<PreparedState>> prepare(const ContainerSnapshot& expected,
496 Diagnostic::error(DiagnosticCode::InvalidArgument, "zone shape must have positive dimensions"));
508 [[nodiscard]] static Result<Zone> create(ZoneShape<Space> shape, Capacity capacity = Capacity::unlimited(),
554 [[nodiscard]] Result<void> accepts(const ContainerObject& object) const { return accepted_.evaluate(object); }
607 size_t operator()(const eve::container::ContainerId& value) const noexcept { return hash<string>{}(value.value()); }
Runtime replacement generation for stale-handle rejection.
Strong identity values shared by persistence, content and logical-name APIs.
Move-only, checked operation results for the common layer.
Monotonic state revision for concurrency and change checks.
Non-negative capacity measured in membership slots.
Definition Container.h:92
static constexpr Capacity fixed(std::size_t value) noexcept
Construct a fixed capacity.
Definition Container.h:95
constexpr std::size_t value() const noexcept
Definition Container.h:99
constexpr bool isUnlimited() const noexcept
Definition Container.h:98
static constexpr Capacity unlimited() noexcept
Construct an unbounded capacity.
Definition Container.h:97
Strong identity of one runtime or persistent container.
Definition Container.h:44
friend bool operator==(const ContainerId &, const ContainerId &) noexcept=default
static std::optional< ContainerId > from(std::string_view value)
Construct a valid ID, rejecting an empty value.
Definition Container.h:52
bool isValid() const noexcept
Return whether this ID is usable by a transfer request.
Definition Container.h:58
const std::string & value() const noexcept
Return the owned stable spelling.
Definition Container.h:60
Extensible filter result used by container and zone acceptance rules.
Definition Container.h:139
std::function< Result< void >(const ContainerObject &)> Predicate
Definition Container.h:141
Result< void > evaluate(const struct ContainerObject &object) const
Evaluate the filter; an empty filter accepts every object.
Definition Container.h:149
Detached state prepared for an atomic container replacement.
Definition Container.h:296
virtual ~PreparedState()=default
Releases PreparedState resources.
virtual void rollback() noexcept=0
Abandon an unpublished stage; the operation is non-throwing.
virtual void commit() noexcept=0
Publish the staged state; the operation is non-throwing.
Borrowed container implementation owned by a domain adapter.
Definition Container.h:287
virtual const ContainerDescriptor & descriptor() const noexcept=0
Return immutable container metadata.
virtual Result< std::unique_ptr< PreparedState > > prepare(const ContainerSnapshot &expected, const ContainerSnapshot &candidate)=0
Prepare an exact replacement from expected to candidate.
virtual Result< void > validateInsert(const ContainerObject &object, std::optional< SlotIndex > destination, std::optional< MembershipId > ignoredObject=std::nullopt) const =0
Validate insertion while optionally ignoring one moved object.
virtual Result< ContainerSnapshot > snapshot() const =0
Return current lossless state without retaining adapter pointers.
Strong identity of an object which can have one container membership.
Definition Container.h:68
static std::optional< MembershipId > from(std::string_view value)
Construct a valid membership ID, rejecting an empty value.
Definition Container.h:76
friend bool operator==(const MembershipId &, const MembershipId &) noexcept=default
const std::string & value() const noexcept
Return the owned stable spelling.
Definition Container.h:84
Explicit slot number; it never implicitly converts to an integer.
Definition Container.h:117
friend constexpr bool operator==(const SlotIndex &, const SlotIndex &) noexcept=default
Operator ==.
friend constexpr auto operator<=>(const SlotIndex &, const SlotIndex &) noexcept=default
Operator <=>.
Atomic preflight/prepare/commit coordinator for one or two adapters.
Definition Container.h:380
Shape-bounded, capacity-limited zone in one compile-time coordinate space.
Definition Container.h:473
bool contains(Coordinate< Space > point) const noexcept
Test a point from exactly this zone's coordinate space.
Definition Container.h:524
const ZoneShape< Space > & shape() const noexcept
Return the immutable shape in this zone's coordinate space.
Definition Container.h:560
Capacity capacity() const noexcept
Return the maximum number of memberships accepted by this zone.
Definition Container.h:558
static Result< Zone > create(ZoneShape< Space > shape, Capacity capacity=Capacity::unlimited(), AcceptedCondition accepted={})
Validate and construct an anonymous compatibility zone.
Definition Container.h:508
static Result< Zone > create(ContainerId id, ZoneShape< Space > shape, Capacity capacity=Capacity::unlimited(), AcceptedCondition accepted={})
Validate and construct a named zone.
Definition Container.h:483
const ContainerId & id() const noexcept
Return the stable identity supplied at construction.
Definition Container.h:518
bool isValid() const noexcept
Return whether this factory-created zone contains valid geometry.
Definition Container.h:515
const AcceptedCondition & acceptedCondition() const noexcept
Return the side-effect-free accepted condition.
Definition Container.h:556
bool hasIdentity() const noexcept
Return whether this zone has a usable stable identity.
Definition Container.h:521
Result< void > accepts(const ContainerObject &object) const
Test the zone's accepted-condition without mutating membership.
Definition Container.h:554
Definition Container.cpp:9
typename ZoneShapeTraits< Space >::type ZoneShape
Definition Container.h:462
constexpr std::string_view containerEventSchemaName
Canonical schema name for container lifecycle envelopes.
Definition Container.h:232
std::function< void(const TransferEvent &)> TransferEventSink
Synchronous callback receiving a committed transfer payload.
Definition Container.h:351
Filter AcceptedCondition
Accepted-condition callback for a zone, shared with container filters.
Definition Container.h:465
ContainerEventKind
Lifecycle outcome represented by every container-domain event.
Definition Container.h:205
const char * containerEventTypeName(ContainerEventKind kind) noexcept
Stable event type spelling shared by all container adapters.
Definition Container.h:221
@ Unordered
@ Insertion
@ ExplicitSlots
std::function< void(const game_event::GameEvent &)> GameEventSink
Callback receiving a canonical game_event envelope.
Definition Container.h:245
EventId deterministicContainerEventId(const ContainerId &container, const MembershipId &object, ContainerEventKind kind, std::uint64_t serial) noexcept
Derives a deterministic event identity for an adapter lifecycle event.
Definition Container.h:257
Definition Container.h:35
detail::StrongUint64< detail::GenerationTag > Generation
Registry/object replacement generation used to reject stale handles.
Definition Generation.h:13
detail::StrongUint64< detail::RevisionTag > Revision
Monotonic content/state revision used for optimistic-concurrency checks.
Definition Revision.h:13
StrongUuid< detail::EventIdTag > EventId
Stable event identity for event envelopes and causal references.
Definition Identity.h:285
Definition Container.h:602
Static metadata and acceptance policy of a container.
Definition Container.h:197
Opaque, owning payload supplied by a domain adapter during transfer.
Definition Container.h:162
virtual ~ContainerObjectPayload()=default
Releases ContainerObjectPayload resources.
Generic object facts used by filters and transfer diagnostics.
Definition Container.h:168
std::shared_ptr< const ContainerObjectPayload > payload
Definition Container.h:173
Lossless snapshot of one container at one revision.
Definition Container.h:190
std::vector< MembershipEntry > entries
Definition Container.h:193
Complete adapter-owned state used to build a candidate replacement.
Definition Container.h:184
One object-to-slot relationship, including the observed generation.
Definition Container.h:177
Coordinate-space tags; distinct types prevent accidental mixing.
Definition Container.h:396
Strong event payload emitted only after a transfer is fully committed.
Definition Container.h:334
Revision destinationRevision
Definition Container.h:341
Observable receipt for one committed or explicit no-op transfer.
Definition Container.h:365
Revision destinationRevision
Definition Container.h:372
Requested optimistic-concurrency transfer. All pointers are borrowed.
Definition Container.h:354
std::optional< Revision > expectedDestinationRevision
Definition Container.h:361
std::optional< SlotIndex > destinationSlot
Definition Container.h:359
std::optional< Revision > expectedSourceRevision
Definition Container.h:360
std::optional< SlotIndex > sourceSlot
Definition Container.h:358
std::variant< Box3D, Sphere3D > type
Definition Container.h:458
std::variant< Rectangle< Space >, Circle< Space > > type
Definition Container.h:452