|
tess 0.4.0
Performance-first tile and path simulation substrate
|
#include <tess/path/path_runtime.h>
Public Member Functions | |
| void | reserve_requests (std::size_t count) |
| void | reserve_path_nodes (std::size_t count) |
| void | reserve_search_nodes (std::size_t count) |
| void | reserve_unit_routes (std::size_t count) |
| void | reserve_unit_field_products (std::size_t count) |
| void | reserve_unit_field_product_dependencies (std::size_t count) |
| void | reserve_portal_segments (std::size_t count) |
| void | clear_requests () noexcept |
| void | clear_caches () noexcept |
| auto | submit (PathRequest request) -> PathTicket |
| auto | requests () const noexcept -> std::span< const PathRequest > |
| auto | results () const noexcept -> std::span< const PathResult > |
| auto | result (PathTicket ticket) const noexcept -> PathResult |
| auto | route_cache () noexcept -> RouteCacheScratch & |
| auto | route_cache () const noexcept -> const RouteCacheScratch & |
| auto | portal_segment_cache () noexcept -> WeightedPortalSegmentCache & |
| auto | portal_segment_cache () const noexcept -> const WeightedPortalSegmentCache & |
| auto | stats () const noexcept -> PathRuntimeStats |
| template<typename World, typename ClassOrTag> | |
| auto | process_unit_cached (const World &world, PathRuntimeCachePolicy policy={}, const RegionGraphT< typename World::residency_type > *graph=nullptr) -> std::span< const PathResult > |
| template<typename World, typename Class, std::uint32_t MaxCost> | |
| auto | process_weighted_batch (const World &world, PathRuntimeCachePolicy policy={}, const RegionGraphT< typename World::residency_type > *graph=nullptr) -> std::span< const PathResult > |
| template<typename World, typename PassableTag, typename CostTag, std::uint32_t MaxCost> | |
| auto | process_weighted_batch (const World &world, PathRuntimeCachePolicy policy={}, const RegionGraphT< typename World::residency_type > *graph=nullptr) -> std::span< const PathResult > |
Owns a reusable batch of path requests, results, scratch, and caches.
Bind one runtime to one world. Cache fingerprints describe world content, not object identity, so sharing a runtime between worlds with matching version counters can serve stale routes. Results and their PathView data are borrowed from runtime-owned buffers and are invalidated by the next process call or clear_requests().
Submission and processing may allocate unless the matching reserve_*() methods have provisioned sufficient capacity. The runtime is not internally synchronized; confine it to one thread or externally synchronize every use.
|
inlinenoexcept |
Clears all caches without removing submitted requests.
|
inlinenoexcept |
Clears requests and results and invalidates every outstanding ticket and result view. Cache contents are retained for reuse.
|
inlinenodiscardnoexcept |
Const overload of portal_segment_cache().
|
inlinenodiscardnoexcept |
Returns the runtime-owned weighted portal-segment cache.
|
inlinenodiscard |
Processes all submitted requests with cached unit-cost A*.
An optional graph enables a topology precheck. A graph built for another movement class degrades to no pruning rather than rejecting a valid path. The runtime binds its unit caches to ClassOrTag; changing class clears those caches. The returned span and every result path are borrowed and are invalidated by the next process or clear operation. Processing may allocate unless all relevant runtime and cache capacities were reserved.
|
inlinenodiscard |
Processes a legacy passability/cost-tag pair as a weighted batch.
The precheck uses the passability tag's identity class. Result lifetime and allocation behavior match process_unit_cached().
|
inlinenodiscard |
Processes the batch with one movement class for weighted search and precheck. A mismatched graph disables pruning. Result lifetime and allocation behavior match process_unit_cached().
|
inlinenodiscardnoexcept |
Borrows submitted requests until the next submission or clear operation.
|
inline |
Reserves result and cache path-node storage.
|
inline |
Reserves weighted portal-segment cache entries.
|
inline |
Reserves request/result batch storage to reduce later allocations.
|
inline |
Reserves node-search scratch across unit and weighted searches.
|
inline |
Reserves dependency-key storage for unit field products.
Reserve World::chunk_count: dependency sets are bounded by, and failed products can equal, that count.
|
inline |
Reserves unit distance-field product cache entries.
|
inline |
Reserves unit-route cache entries.
|
inlinenodiscardnoexcept |
Returns a result by ticket.
The ticket must originate from this runtime. Stale and out-of-range tickets assert in debug builds and return PathStatus::NoPath in release builds. The returned result's path view follows the runtime result lifetime documented on the class.
|
inlinenodiscardnoexcept |
Borrows the current result array until the next process or clear operation.
|
inlinenodiscardnoexcept |
Const overload of route_cache().
|
inlinenodiscardnoexcept |
Returns the runtime-owned unit-route cache for tuning or inspection.
|
inlinenodiscardnoexcept |
Returns a by-value snapshot of current runtime and cache counters.
|
inlinenodiscard |
Appends a request and returns its generation-stamped ticket.
This may allocate unless request storage was reserved.