File diff r15609:02b794721f9c → r15610:623a23fb6560
src/pathfinder/yapf/yapf_costcache.hpp
Show inline comments
 
@@ -14,7 +14,8 @@
 

	
 
#include "../../date_func.h"
 

	
 
/** CYapfSegmentCostCacheNoneT - the formal only yapf cost cache provider that implements
 
/**
 
 * CYapfSegmentCostCacheNoneT - the formal only yapf cost cache provider that implements
 
 * PfNodeCacheFetch() and PfNodeCacheFlush() callbacks. Used when nodes don't have CachedData
 
 * defined (they don't count with any segment cost caching).
 
 */
 
@@ -25,14 +26,16 @@ public:
 
	typedef typename Types::Tpf Tpf;              ///< the pathfinder class (derived from THIS class)
 
	typedef typename Types::NodeList::Titem Node; ///< this will be our node type
 

	
 
	/** Called by YAPF to attach cached or local segment cost data to the given node.
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
		return false;
 
	}
 

	
 
	/** Called by YAPF to flush the cached segment cost data back into cache storage.
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{
 
@@ -40,7 +43,8 @@ public:
 
};
 

	
 

	
 
/** CYapfSegmentCostCacheLocalT - the yapf cost cache provider that implements fake segment
 
/**
 
 * 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.
 
 */
 
@@ -65,7 +69,8 @@ protected:
 
	}
 

	
 
public:
 
	/** Called by YAPF to attach cached or local segment cost data to the given node.
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
@@ -74,7 +79,8 @@ public:
 
		return false;
 
	}
 

	
 
	/** Called by YAPF to flush the cached segment cost data back into cache storage.
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{
 
@@ -82,7 +88,8 @@ public:
 
};
 

	
 

	
 
/** Base class for segment cost cache providers. Contains global counter
 
/**
 
 * Base class for segment cost cache providers. Contains global counter
 
 *  of track layout changes and static notification function called whenever
 
 *  the track layout changes. It is implemented as base class because it needs
 
 *  to be shared between all rail YAPF types (one shared counter, one notification
 
@@ -98,7 +105,8 @@ struct CSegmentCostCacheBase
 
};
 

	
 

	
 
/** CSegmentCostCacheT - template class providing hash-map and storage (heap)
 
/**
 
 * CSegmentCostCacheT - template class providing hash-map and storage (heap)
 
 *  of Tsegment structures. Each rail node contains pointer to the segment
 
 *  that contains cached (or non-cached) segment cost information. Nodes can
 
 *  differ by key type, but they use the same segment type. Segment key should
 
@@ -142,7 +150,8 @@ struct CSegmentCostCacheT
 
	}
 
};
 

	
 
/** CYapfSegmentCostCacheGlobalT - the yapf cost cache provider that adds the segment cost
 
/**
 
 * 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.
 
 */
 
@@ -192,7 +201,8 @@ protected:
 
	}
 

	
 
public:
 
	/** Called by YAPF to attach cached or local segment cost data to the given node.
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
@@ -206,7 +216,8 @@ public:
 
		return found;
 
	}
 

	
 
	/** Called by YAPF to flush the cached segment cost data back into cache storage.
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{