OpenTTD
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
CYapfSegmentCostCacheLocalT< Types > Class Template Reference

CYapfSegmentCostCacheLocalT - the yapf cost cache provider that implements fake segment cost caching functionality for yapf. More...

#include <yapf_costcache.hpp>

Inheritance diagram for CYapfSegmentCostCacheLocalT< Types >:
CYapfSegmentCostCacheGlobalT< Types > CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail1, CFollowTrackFreeRail, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail2, CFollowTrackFreeRailNo90, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfT< CYapfRail_TypesT< CYapfRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfAnyDepotRail1 CYapfAnyDepotRail2 CYapfAnySafeTileRail1 CYapfAnySafeTileRail2 CYapfRail1 CYapfRail2

Public Types

typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::NodeList::Titem Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
typedef Node::CachedData CachedData
typedef CachedData::Key CacheKey
typedef SmallArray< CachedData > LocalCache

Public Member Functions

bool PfNodeCacheFetch (Node &n)
 Called by YAPF to attach cached or local segment cost data to the given node.
void PfNodeCacheFlush (Node &n)
 Called by YAPF to flush the cached segment cost data back into cache storage.

Protected Member Functions

TpfYapf ()
 to access inherited path finder

Protected Attributes

LocalCache m_local_cache

Detailed Description

template<class Types>
class CYapfSegmentCostCacheLocalT< Types >

CYapfSegmentCostCacheLocalT - the yapf cost cache provider that implements fake segment cost caching functionality for yapf.

Used when node needs caching, but you don't want to cache the segment costs.

Definition at line 54 of file yapf_costcache.hpp.

Member Function Documentation

template<class Types >
bool CYapfSegmentCostCacheLocalT< Types >::PfNodeCacheFetch ( Node n)
inline

Called by YAPF to attach cached or local segment cost data to the given node.

Returns
true if globally cached data were used or false if local data was used

Reimplemented in CYapfSegmentCostCacheGlobalT< Types >.

Definition at line 78 of file yapf_costcache.hpp.

References SmallArray< T, B, N >::Append(), and CYapfSegmentCostCacheLocalT< Types >::Yapf().

Referenced by CYapfSegmentCostCacheGlobalT< Types >::PfNodeCacheFetch().

template<class Types >
void CYapfSegmentCostCacheLocalT< Types >::PfNodeCacheFlush ( Node n)
inline

Called by YAPF to flush the cached segment cost data back into cache storage.

Current cache implementation doesn't use that.

Reimplemented in CYapfSegmentCostCacheGlobalT< Types >.

Definition at line 89 of file yapf_costcache.hpp.


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