载入中...
搜索中...
未找到
CrowdFlowCache.cpp
浏览该文件的文档.
13Result<std::vector<int>> canonicalFlowCoordinates(std::span<const FlowGoal> goals, const CrowdField& field) {
40 sizeof(float) * (value.cost_.capacity() + value.navigationCost_.capacity() + value.integ_.capacity() +
53Result<std::vector<Crowd::Impl::FlowCacheEntry>> Crowd::Impl::stageFlowCache(std::uint64_t budget,
106 return cacheFailure<FlowLease>(DiagnosticCode::NotFound, "No ready field for complete navigation key");
111 if (!plan.field_ || plan.owner_ != impl_->owner || plan.revision_ != impl_->field.inputRevision() ||
113 return cacheFailure<FlowLease>(DiagnosticCode::Conflict, "Incomplete, stale or foreign field publication");
116 if (entry.input == plan.revision_ && entry.surface == surface && entry.algorithm == flowBuildAlgorithmVersion &&
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Move-only navigation workstate; contains no borrowed provider pointers.
Definition Crowd.h:309
FieldObservation getFieldStatus() const noexcept
Observe current field readiness and owner-local revision without rebuilding.
Definition Crowd.cpp:62
@ Unreachable
@ Committed
Result< FlowLease > acquireFlowField(std::span< const FlowGoal > goals)
Acquire an existing field for a canonical goal set without graph work.
Definition CrowdFlowCache.cpp:98
Result< void > configureFlowCache(std::uint64_t budgetBytes)
Set retained-storage budget, evicting only unleased fields with atomic pressure failure.
Definition CrowdFlowCache.cpp:146
FlowCacheObservation getFlowCacheStatus() const noexcept
Read retained-storage accounting without copying fields; owner thread only.
Definition CrowdFlowCache.cpp:157
Result< FlowSample > sampleFlowField(const FlowLease &lease, float x, float y) const
Sample a current lease; stale/foreign leases fail, unreachable locations return zero....
Definition CrowdFlowCache.cpp:164
Owning immutable field lease; copies pin storage, never the Crowd provider. @thread Copy/release/quer...
Definition CrowdTypes.h:48
Definition Crowd.cpp:14
constexpr std::uint32_t flowBuildAlgorithmVersion
Increment when the navigation construction algorithm changes its observable output.
Definition CrowdTypes.h:41
Result< std::vector< int > > canonicalFlowCoordinates(std::span< const FlowGoal > goals, const CrowdField &field)
Copy validated goals into their unique canonical coordinates.
Definition CrowdFlowCache.cpp:13
bool isFlowPointReachable(const CrowdField &field, float x, float y) noexcept
Observe exact containing-cell reachability, independent of interpolation across blocked cells....
Definition CrowdFlowCache.cpp:31
@ Reachable
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ Failed
@ Conflict
std::shared_ptr< const CrowdField > field
Definition CrowdInternal.h:100
std::uint64_t generation
Definition CrowdInternal.h:103
std::weak_ptr< const void > pins
Definition CrowdInternal.h:101
std::uint32_t algorithm
Definition CrowdInternal.h:105
FlowLease leaseFor(FlowCacheEntry &entry)
Definition CrowdFlowCache.cpp:84
Result< std::vector< FlowCacheEntry > > stageFlowCache(std::uint64_t budget, std::uint64_t bytes, size_t count) const
Stage cache metadata and deterministic unleased evictions without live mutation. @ownership Returns o...
Definition CrowdFlowCache.cpp:53
static bool isFlowKeyBefore(const FlowCacheEntry &a, const FlowCacheEntry &b)
Definition CrowdFlowCache.cpp:44
static std::uint64_t retainedFlowBytes(const CrowdField &value)
Definition CrowdFlowCache.cpp:38
Retained navigation-storage accounting; excludes allocator bookkeeping and pending builds.
Definition CrowdTypes.h:62