tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
tess::PathRequestRuntime Class Reference

#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_weighted_field_products (std::size_t count)
void reserve_weighted_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 try_result (PathTicket ticket) const noexcept -> std::optional< PathResult >
auto result (PathTicket ticket) const noexcept -> PathResult
auto route_cache () noexcept -> UnitRouteCache &
auto route_cache () const noexcept -> const UnitRouteCache &
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 ClassOrTag, typename Provider>
auto process_unit_cached (const World &world, PathRuntimeCachePolicy policy, const RegionGraphT< typename World::residency_type > *graph, const Provider &provider) -> 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 Class, std::uint32_t MaxCost, typename Provider>
auto process_weighted_batch (const World &world, PathRuntimeCachePolicy policy, const RegionGraphT< typename World::residency_type > *graph, const Provider &provider) -> std::span< const PathResult >

Detailed Description

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 content-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. Its caches retain process-local class/provider identities; do not share a runtime across a dynamic-library boundary.

Member Function Documentation

◆ clear_caches()

void tess::PathRequestRuntime::clear_caches ( )
inlinenoexcept

Clears all caches without removing submitted requests.

◆ clear_requests()

void tess::PathRequestRuntime::clear_requests ( )
inlinenoexcept

Clears requests and results and invalidates every outstanding ticket and result view. Cache contents are retained for reuse.

◆ portal_segment_cache() [1/2]

auto tess::PathRequestRuntime::portal_segment_cache ( ) const -> const WeightedPortalSegmentCache &
inlinenodiscardnoexcept

Const overload of portal_segment_cache().

◆ portal_segment_cache() [2/2]

auto tess::PathRequestRuntime::portal_segment_cache ( ) -> WeightedPortalSegmentCache &
inlinenodiscardnoexcept

Returns the runtime-owned weighted portal-segment cache.

◆ process_unit_cached() [1/2]

template<typename World, typename ClassOrTag, typename Provider>
auto tess::PathRequestRuntime::process_unit_cached ( const World & world,
PathRuntimeCachePolicy policy,
const RegionGraphT< typename World::residency_type > * graph,
const Provider & provider ) -> std::span< const PathResult >
inlinenodiscard

Processes unit requests composed with a special transition provider.

◆ process_unit_cached() [2/2]

template<typename World, typename ClassOrTag>
auto tess::PathRequestRuntime::process_unit_cached ( const World & world,
PathRuntimeCachePolicy policy = {},
const RegionGraphT< typename World::residency_type > * graph = nullptr ) -> std::span< const PathResult >
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.

◆ process_weighted_batch() [1/2]

template<typename World, typename Class, std::uint32_t MaxCost, typename Provider>
auto tess::PathRequestRuntime::process_weighted_batch ( const World & world,
PathRuntimeCachePolicy policy,
const RegionGraphT< typename World::residency_type > * graph,
const Provider & provider ) -> std::span< const PathResult >
inlinenodiscard

Processes a weighted batch composed with a special provider.

◆ process_weighted_batch() [2/2]

template<typename World, typename Class, std::uint32_t MaxCost>
auto tess::PathRequestRuntime::process_weighted_batch ( const World & world,
PathRuntimeCachePolicy policy = {},
const RegionGraphT< typename World::residency_type > * graph = nullptr ) -> std::span< const PathResult >
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().

◆ requests()

auto tess::PathRequestRuntime::requests ( ) const -> std::span< const PathRequest >
inlinenodiscardnoexcept

Borrows submitted requests until the next submission or clear operation.

◆ reserve_path_nodes()

void tess::PathRequestRuntime::reserve_path_nodes ( std::size_t count)
inline

Reserves result and cache path-node storage.

◆ reserve_portal_segments()

void tess::PathRequestRuntime::reserve_portal_segments ( std::size_t count)
inline

Reserves weighted portal-segment cache entries.

◆ reserve_requests()

void tess::PathRequestRuntime::reserve_requests ( std::size_t count)
inline

Reserves request/result batch storage to reduce later allocations.

◆ reserve_search_nodes()

void tess::PathRequestRuntime::reserve_search_nodes ( std::size_t count)
inline

Reserves node-search scratch across unit and weighted searches.

◆ reserve_unit_field_product_dependencies()

void tess::PathRequestRuntime::reserve_unit_field_product_dependencies ( std::size_t count)
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.

◆ reserve_unit_field_products()

void tess::PathRequestRuntime::reserve_unit_field_products ( std::size_t count)
inline

Reserves entries in the shared unit/weighted field-product cache.

◆ reserve_unit_routes()

void tess::PathRequestRuntime::reserve_unit_routes ( std::size_t count)
inline

Reserves unit-route cache entries.

◆ reserve_weighted_field_product_dependencies()

void tess::PathRequestRuntime::reserve_weighted_field_product_dependencies ( std::size_t count)
inline

Reserves dependency-key storage for weighted field products.

◆ reserve_weighted_field_products()

void tess::PathRequestRuntime::reserve_weighted_field_products ( std::size_t count)
inline

Reserves the same shared product cache as reserve_unit_field_products().

The two names describe the intended processing pass, not separate storage.

◆ result()

auto tess::PathRequestRuntime::result ( PathTicket ticket) const -> PathResult
inlinenodiscardnoexcept

Returns a published result by ticket.

The ticket must originate from this runtime. Detectable stale, out-of-range, and unpublished-result tickets terminate in every build; uncertain callers should use try_result(). The returned result's path view follows the runtime result lifetime documented on the class.

◆ results()

auto tess::PathRequestRuntime::results ( ) const -> std::span< const PathResult >
inlinenodiscardnoexcept

Borrows the current result array until the next process or clear operation.

◆ route_cache() [1/2]

auto tess::PathRequestRuntime::route_cache ( ) const -> const UnitRouteCache &
inlinenodiscardnoexcept

Const overload of route_cache().

◆ route_cache() [2/2]

auto tess::PathRequestRuntime::route_cache ( ) -> UnitRouteCache &
inlinenodiscardnoexcept

Returns the runtime-owned unit-route cache for tuning or inspection.

◆ stats()

auto tess::PathRequestRuntime::stats ( ) const -> PathRuntimeStats
inlinenodiscardnoexcept

Returns a by-value snapshot of current runtime and cache counters.

◆ submit()

auto tess::PathRequestRuntime::submit ( PathRequest request) -> PathTicket
inlinenodiscard

Appends a request and returns its generation-stamped ticket.

This may allocate unless request storage was reserved.

◆ try_result()

auto tess::PathRequestRuntime::try_result ( PathTicket ticket) const -> std::optional< PathResult >
inlinenodiscardnoexcept

Checks for a published result by ticket.

The ticket must originate from this runtime; the ticket representation cannot distinguish another runtime with a matching index and generation. Returns no value for a stale generation, an out-of-range index, or while the latest processing pass has not completed. A successful result follows the runtime result lifetime documented on the class.


The documentation for this class was generated from the following file: