(svn r20283) -Codechange: Unify start of doygen comments.

This commit is contained in:
frosch
2010-08-01 19:22:34 +00:00
parent 4871baf44d
commit ed4f806f1d
162 changed files with 1304 additions and 652 deletions

View File

@@ -16,7 +16,8 @@
#include "../../misc/hashtable.hpp"
#include "../../misc/binaryheap.hpp"
/** Hash table based node list multi-container class.
/**
* Hash table based node list multi-container class.
* Implements open list, closed list and priority queue for A-star
* path finder. */
template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>

View File

@@ -17,7 +17,8 @@
extern int _total_pf_time_us;
/** CYapfBaseT - A-star type path finder base class.
/**
* CYapfBaseT - A-star type path finder base class.
* Derive your own pathfinder from it. You must provide the following template argument:
* Types - used as collection of local types used in pathfinder
*
@@ -108,7 +109,8 @@ public:
return *m_settings;
}
/** Main pathfinder routine:
/**
* Main pathfinder routine:
* - set startup node(s)
* - main loop that stops if:
* - the destination was found
@@ -174,7 +176,8 @@ public:
return bDestFound;
}
/** If path was found return the best node that has reached the destination. Otherwise
/**
* If path was found return the best node that has reached the destination. Otherwise
* return the best visited node (which was nearest to the destination).
*/
FORCEINLINE Node *GetBestNode()
@@ -182,7 +185,8 @@ public:
return (m_pBestDestNode != NULL) ? m_pBestDestNode : m_pBestIntermediateNode;
}
/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
/**
* Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
* as argument for AddStartupNode() or AddNewNode()
*/
FORCEINLINE Node& CreateNewNode()
@@ -217,7 +221,8 @@ public:
}
}
/** AddNewNode() - called by Tderived::PfFollowNode() for each child node.
/**
* AddNewNode() - called by Tderived::PfFollowNode() for each child node.
* Nodes are evaluated here and added into open list */
void AddNewNode(Node &n, const TrackFollower &tf)
{

View File

@@ -146,7 +146,8 @@ public:
return bDest;
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
inline bool PfCalcEstimate(Node& n)
{
@@ -174,7 +175,8 @@ public:
}
};
/** YAPF template that uses Ttypes template argument to determine all YAPF
/**
* YAPF template that uses Ttypes template argument to determine all YAPF
* components (base classes) from which the actual YAPF is composed.
* For example classes consult: CYapfRail_TypesT template and its instantiations:
* CYapfRail1, CYapfRail2, CYapfRail3, CYapfAnyDepotRail1, CYapfAnyDepotRail2, CYapfAnyDepotRail3 */

View File

@@ -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)
{

View File

@@ -276,7 +276,8 @@ public:
m_max_cost = max_cost;
}
/** Called by YAPF to calculate the cost from the origin to the given node.
/**
* Called by YAPF to calculate the cost from the origin to the given node.
* Calculates only the cost of given node, adds it to the parent node cost
* and stores the result into Node::m_cost member */
FORCEINLINE bool PfCalcCost(Node &n, const TrackFollower *tf)

View File

@@ -63,7 +63,8 @@ public:
return bDest;
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
FORCEINLINE bool PfCalcEstimate(Node& n)
{
@@ -102,7 +103,8 @@ public:
IsWaitingPositionFree(Yapf().GetVehicle(), tile, td, !TrackFollower::Allow90degTurns());
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate. */
FORCEINLINE bool PfCalcEstimate(Node& n)
{
@@ -181,7 +183,8 @@ public:
return bDest;
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
FORCEINLINE bool PfCalcEstimate(Node& n)
{

View File

@@ -201,7 +201,8 @@ protected:
}
public:
/** Called by YAPF to move from the given node to the next tile. For each
/**
* Called by YAPF to move from the given node to the next tile. For each
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n) */
inline void PfFollowNode(Node& old_node)
@@ -295,7 +296,8 @@ protected:
}
public:
/** Called by YAPF to move from the given node to the next tile. For each
/**
* Called by YAPF to move from the given node to the next tile. For each
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n) */
inline void PfFollowNode(Node& old_node)
@@ -376,7 +378,8 @@ protected:
}
public:
/** Called by YAPF to move from the given node to the next tile. For each
/**
* Called by YAPF to move from the given node to the next tile. For each
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n) */
inline void PfFollowNode(Node& old_node)

View File

@@ -95,7 +95,8 @@ protected:
}
public:
/** Called by YAPF to calculate the cost from the origin to the given node.
/**
* Called by YAPF to calculate the cost from the origin to the given node.
* Calculates only the cost of given node, adds it to the parent node cost
* and stores the result into Node::m_cost member */
FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
@@ -186,7 +187,8 @@ public:
return IsRoadDepotTile(tile);
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
FORCEINLINE bool PfCalcEstimate(Node& n)
{
@@ -254,7 +256,8 @@ public:
return tile == m_destTile && ((m_destTrackdirs & TrackdirToTrackdirBits(trackdir)) != TRACKDIR_BIT_NONE);
}
/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
/**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
inline bool PfCalcEstimate(Node& n)
{
@@ -302,7 +305,8 @@ protected:
public:
/** Called by YAPF to move from the given node to the next tile. For each
/**
* Called by YAPF to move from the given node to the next tile. For each
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n) */
inline void PfFollowNode(Node& old_node)

View File

@@ -32,7 +32,8 @@ protected:
}
public:
/** Called by YAPF to move from the given node to the next tile. For each
/**
* Called by YAPF to move from the given node to the next tile. For each
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n) */
inline void PfFollowNode(Node& old_node)
@@ -115,7 +116,8 @@ protected:
}
public:
/** Called by YAPF to calculate the cost from the origin to the given node.
/**
* Called by YAPF to calculate the cost from the origin to the given node.
* Calculates only the cost of given node, adds it to the parent node cost
* and stores the result into Node::m_cost member */
FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
@@ -136,7 +138,8 @@ public:
}
};
/** Config struct of YAPF for ships.
/**
* Config struct of YAPF for ships.
* Defines all 6 base YAPF modules as classes providing services for CYapfBaseT.
*/
template <class Tpf_, class Ttrack_follower, class Tnode_list>