OpenTTD Source 20241224-master-gf74b0cf984
CYapfSegmentCostCacheGlobalT< Types > Class Template Reference

CYapfSegmentCostCacheGlobalT - the yapf cost cache provider that adds the segment cost caching functionality to yapf. More...

#include <yapf_costcache.hpp>

Public Types

typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
 
typedef Types::NodeList::Item Node
 this will be our node type
 
typedef Node::Key Key
 key to hash tables
 
typedef Node::CachedData CachedData
 
typedef CachedData::Key CacheKey
 
typedef CSegmentCostCacheT< CachedData > Cache
 
using LocalCache = std::deque< CachedData >
 

Public Member Functions

bool PfNodeCacheFetch (Node &n)
 Called by YAPF to attach cached or local segment cost data to the given node.
 

Protected Member Functions

TpfYapf ()
 to access inherited path finder
 

Static Protected Member Functions

static CachestGetGlobalCache ()
 

Protected Attributes

Cacheglobal_cache
 
LocalCache local_cache
 

Detailed Description

template<class Types>
class CYapfSegmentCostCacheGlobalT< Types >

CYapfSegmentCostCacheGlobalT - the yapf cost cache provider that adds the segment cost caching functionality to yapf.

Using this class as base of your will provide the global segment cost caching services for your Nodes.

Definition at line 105 of file yapf_costcache.hpp.

Member Typedef Documentation

◆ Cache

template<class Types >
typedef CSegmentCostCacheT<CachedData> CYapfSegmentCostCacheGlobalT< Types >::Cache

Definition at line 112 of file yapf_costcache.hpp.

◆ CachedData

template<class Types >
typedef Node::CachedData CYapfSegmentCostCacheGlobalT< Types >::CachedData

Definition at line 110 of file yapf_costcache.hpp.

◆ CacheKey

template<class Types >
typedef CachedData::Key CYapfSegmentCostCacheGlobalT< Types >::CacheKey

Definition at line 111 of file yapf_costcache.hpp.

◆ Key

template<class Types >
typedef Node::Key CYapfSegmentCostCacheGlobalT< Types >::Key

key to hash tables

Definition at line 109 of file yapf_costcache.hpp.

◆ LocalCache

template<class Types >
using CYapfSegmentCostCacheGlobalT< Types >::LocalCache = std::deque<CachedData>

Definition at line 113 of file yapf_costcache.hpp.

◆ Node

template<class Types >
typedef Types::NodeList::Item CYapfSegmentCostCacheGlobalT< Types >::Node

this will be our node type

Definition at line 108 of file yapf_costcache.hpp.

◆ Tpf

template<class Types >
typedef Types::Tpf CYapfSegmentCostCacheGlobalT< Types >::Tpf

the pathfinder class (derived from THIS class)

Definition at line 107 of file yapf_costcache.hpp.

Constructor & Destructor Documentation

◆ CYapfSegmentCostCacheGlobalT()

template<class Types >
CYapfSegmentCostCacheGlobalT< Types >::CYapfSegmentCostCacheGlobalT ( )
inlineprotected

Definition at line 119 of file yapf_costcache.hpp.

Member Function Documentation

◆ PfNodeCacheFetch()

template<class Types >
bool CYapfSegmentCostCacheGlobalT< 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

Definition at line 145 of file yapf_costcache.hpp.

References CYapfSegmentCostCacheGlobalT< Types >::Yapf().

◆ stGetGlobalCache()

template<class Types >
static Cache & CYapfSegmentCostCacheGlobalT< Types >::stGetGlobalCache ( )
inlinestaticprotected

Definition at line 127 of file yapf_costcache.hpp.

◆ Yapf()

template<class Types >
Tpf & CYapfSegmentCostCacheGlobalT< Types >::Yapf ( )
inlineprotected

to access inherited path finder

Definition at line 122 of file yapf_costcache.hpp.

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

Field Documentation

◆ global_cache

template<class Types >
Cache& CYapfSegmentCostCacheGlobalT< Types >::global_cache
protected

Definition at line 116 of file yapf_costcache.hpp.

◆ local_cache

template<class Types >
LocalCache CYapfSegmentCostCacheGlobalT< Types >::local_cache
protected

Definition at line 117 of file yapf_costcache.hpp.


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