1
0
Fork 0

(svn r27363) -Codechange: Fix codestyle of one-line methods and header codestyle of derived structs.

release/1.6
alberth 2015-08-08 13:19:38 +00:00
parent b885d79f50
commit 1105b4d2c9
13 changed files with 302 additions and 121 deletions

View File

@ -42,9 +42,16 @@ protected:
public: public:
/** implicit constructor */ /** implicit constructor */
inline SmallArray() { } inline SmallArray()
{
}
/** Clear (destroy) all items */ /** Clear (destroy) all items */
inline void Clear() {data.Clear();} inline void Clear()
{
data.Clear();
}
/** Return actual number of items */ /** Return actual number of items */
inline uint Length() const inline uint Length() const
{ {
@ -54,13 +61,29 @@ public:
return (super_size - 1) * B + sub_size; return (super_size - 1) * B + sub_size;
} }
/** return true if array is empty */ /** return true if array is empty */
inline bool IsEmpty() { return data.IsEmpty(); } inline bool IsEmpty()
{
return data.IsEmpty();
}
/** return true if array is full */ /** return true if array is full */
inline bool IsFull() { return data.IsFull() && data[N - 1].IsFull(); } inline bool IsFull()
{
return data.IsFull() && data[N - 1].IsFull();
}
/** allocate but not construct new item */ /** allocate but not construct new item */
inline T *Append() { return FirstFreeSubArray().Append(); } inline T *Append()
{
return FirstFreeSubArray().Append();
}
/** allocate and construct new item */ /** allocate and construct new item */
inline T *AppendC() { return FirstFreeSubArray().AppendC(); } inline T *AppendC()
{
return FirstFreeSubArray().AppendC();
}
/** indexed access (non-const) */ /** indexed access (non-const) */
inline T& operator[](uint index) inline T& operator[](uint index)
{ {

View File

@ -157,21 +157,30 @@ public:
* *
* @return The number of items in the queue * @return The number of items in the queue
*/ */
inline uint Length() const { return this->items; } inline uint Length() const
{
return this->items;
}
/** /**
* Test if the priority queue is empty. * Test if the priority queue is empty.
* *
* @return True if empty * @return True if empty
*/ */
inline bool IsEmpty() const { return this->items == 0; } inline bool IsEmpty() const
{
return this->items == 0;
}
/** /**
* Test if the priority queue is full. * Test if the priority queue is full.
* *
* @return True if full. * @return True if full.
*/ */
inline bool IsFull() const { return this->items >= this->capacity; } inline bool IsFull() const
{
return this->items >= this->capacity;
}
/** /**
* Get the smallest item in the binary tree. * Get the smallest item in the binary tree.
@ -287,7 +296,10 @@ public:
* Make the priority queue empty. * Make the priority queue empty.
* All remaining items will remain untouched. * All remaining items will remain untouched.
*/ */
inline void Clear() { this->items = 0; } inline void Clear()
{
this->items = 0;
}
}; };
#endif /* BINARYHEAP_HPP */ #endif /* BINARYHEAP_HPP */

View File

@ -71,7 +71,10 @@ public:
static const size_t header_size = sizeof(BlobHeader); static const size_t header_size = sizeof(BlobHeader);
/** default constructor - initializes empty blob */ /** default constructor - initializes empty blob */
inline ByteBlob() { InitEmpty(); } inline ByteBlob()
{
InitEmpty();
}
/** copy constructor */ /** copy constructor */
inline ByteBlob(const ByteBlob &src) inline ByteBlob(const ByteBlob &src)
@ -311,9 +314,22 @@ public:
struct OnTransfer { struct OnTransfer {
typename base::BlobHeader *header; typename base::BlobHeader *header;
OnTransfer(const OnTransfer& src) : header(src.header) {assert(src.header != NULL); *const_cast<typename base::BlobHeader**>(&src.header) = NULL;}
OnTransfer(CBlobT& src) : header(src.header) {src.InitEmpty();} OnTransfer(const OnTransfer& src) : header(src.header)
~OnTransfer() {assert(header == NULL);} {
assert(src.header != NULL);
*const_cast<typename base::BlobHeader**>(&src.header) = NULL;
}
OnTransfer(CBlobT& src) : header(src.header)
{
src.InitEmpty();
}
~OnTransfer()
{
assert(header == NULL);
}
}; };
/** Default constructor - makes new Blob ready to accept any data */ /** Default constructor - makes new Blob ready to accept any data */

View File

@ -35,48 +35,97 @@ protected:
public: public:
/** default (NULL) construct or construct from a raw pointer */ /** default (NULL) construct or construct from a raw pointer */
inline CCountedPtr(Tcls *pObj = NULL) : m_pT(pObj) {AddRef();} inline CCountedPtr(Tcls *pObj = NULL) : m_pT(pObj)
{
AddRef();
}
/** copy constructor (invoked also when initializing from another smart ptr) */ /** copy constructor (invoked also when initializing from another smart ptr) */
inline CCountedPtr(const CCountedPtr &src) : m_pT(src.m_pT) {AddRef();} inline CCountedPtr(const CCountedPtr &src) : m_pT(src.m_pT)
{
AddRef();
}
/** destructor releasing the reference */ /** destructor releasing the reference */
inline ~CCountedPtr() {Release();} inline ~CCountedPtr()
{
Release();
}
protected: protected:
/** add one ref to the underlaying object */ /** add one ref to the underlaying object */
inline void AddRef() {if (m_pT != NULL) m_pT->AddRef();} inline void AddRef()
{
if (m_pT != NULL) m_pT->AddRef();
}
public: public:
/** release smart pointer (and decrement ref count) if not null */ /** release smart pointer (and decrement ref count) if not null */
inline void Release() {if (m_pT != NULL) {Tcls *pT = m_pT; m_pT = NULL; pT->Release();}} inline void Release()
{
if (m_pT != NULL) {
Tcls *pT = m_pT;
m_pT = NULL;
pT->Release();
}
}
/** dereference of smart pointer - const way */ /** dereference of smart pointer - const way */
inline const Tcls *operator->() const {assert(m_pT != NULL); return m_pT;} inline const Tcls *operator->() const
{
assert(m_pT != NULL);
return m_pT;
}
/** dereference of smart pointer - non const way */ /** dereference of smart pointer - non const way */
inline Tcls *operator->() {assert(m_pT != NULL); return m_pT;} inline Tcls *operator->()
{
assert(m_pT != NULL);
return m_pT;
}
/** raw pointer casting operator - const way */ /** raw pointer casting operator - const way */
inline operator const Tcls*() const {assert(m_pT == NULL); return m_pT;} inline operator const Tcls*() const
{
assert(m_pT == NULL);
return m_pT;
}
/** raw pointer casting operator - non-const way */ /** raw pointer casting operator - non-const way */
inline operator Tcls*() {return m_pT;} inline operator Tcls*()
{
return m_pT;
}
/** operator & to support output arguments */ /** operator & to support output arguments */
inline Tcls** operator&() {assert(m_pT == NULL); return &m_pT;} inline Tcls** operator&()
{
assert(m_pT == NULL);
return &m_pT;
}
/** assignment operator from raw ptr */ /** assignment operator from raw ptr */
inline CCountedPtr& operator=(Tcls *pT) {Assign(pT); return *this;} inline CCountedPtr& operator=(Tcls *pT)
{
Assign(pT);
return *this;
}
/** assignment operator from another smart ptr */ /** assignment operator from another smart ptr */
inline CCountedPtr& operator=(const CCountedPtr &src) {Assign(src.m_pT); return *this;} inline CCountedPtr& operator=(const CCountedPtr &src)
{
Assign(src.m_pT);
return *this;
}
/** assignment operator helper */ /** assignment operator helper */
inline void Assign(Tcls *pT); inline void Assign(Tcls *pT);
/** one way how to test for NULL value */ /** one way how to test for NULL value */
inline bool IsNull() const {return m_pT == NULL;} inline bool IsNull() const
{
return m_pT == NULL;
}
/** another way how to test for NULL value */ /** another way how to test for NULL value */
//inline bool operator == (const CCountedPtr &sp) const {return m_pT == sp.m_pT;} //inline bool operator == (const CCountedPtr &sp) const {return m_pT == sp.m_pT;}
@ -85,10 +134,19 @@ public:
//inline bool operator != (const CCountedPtr &sp) const {return m_pT != sp.m_pT;} //inline bool operator != (const CCountedPtr &sp) const {return m_pT != sp.m_pT;}
/** assign pointer w/o incrementing ref count */ /** assign pointer w/o incrementing ref count */
inline void Attach(Tcls *pT) {Release(); m_pT = pT;} inline void Attach(Tcls *pT)
{
Release();
m_pT = pT;
}
/** detach pointer w/o decrementing ref count */ /** detach pointer w/o decrementing ref count */
inline Tcls *Detach() {Tcls *pT = m_pT; m_pT = NULL; return pT;} inline Tcls *Detach()
{
Tcls *pT = m_pT;
m_pT = NULL;
return pT;
}
}; };
template <class Tcls_> template <class Tcls_>
@ -136,7 +194,6 @@ template <class T> struct AdaptT {
} }
}; };
/** /**
* Simple counted object. Use it as base of your struct/class if you want to use * Simple counted object. Use it as base of your struct/class if you want to use
* basic reference counting. Your struct/class will destroy and free itself when * basic reference counting. Your struct/class will destroy and free itself when
@ -161,7 +218,4 @@ struct SimpleCountedObject {
virtual void FinalRelease() {}; virtual void FinalRelease() {};
}; };
#endif /* COUNTEDPTR_HPP */ #endif /* COUNTEDPTR_HPP */

View File

@ -41,13 +41,28 @@ protected:
T *data; T *data;
/** return reference to the array header (non-const) */ /** return reference to the array header (non-const) */
inline ArrayHeader& Hdr() { return *(ArrayHeader*)(((byte*)data) - HeaderSize); } inline ArrayHeader& Hdr()
{
return *(ArrayHeader*)(((byte*)data) - HeaderSize);
}
/** return reference to the array header (const) */ /** return reference to the array header (const) */
inline const ArrayHeader& Hdr() const { return *(ArrayHeader*)(((byte*)data) - HeaderSize); } inline const ArrayHeader& Hdr() const
{
return *(ArrayHeader*)(((byte*)data) - HeaderSize);
}
/** return reference to the block reference counter */ /** return reference to the block reference counter */
inline uint& RefCnt() { return Hdr().reference_count; } inline uint& RefCnt()
{
return Hdr().reference_count;
}
/** return reference to number of used items */ /** return reference to number of used items */
inline uint& SizeRef() { return Hdr().items; } inline uint& SizeRef()
{
return Hdr().items;
}
public: public:
/** Default constructor. Preallocate space for items and header, then initialize header. */ /** Default constructor. Preallocate space for items and header, then initialize header. */
@ -96,19 +111,50 @@ public:
} }
/** return number of used items */ /** return number of used items */
inline uint Length() const { return Hdr().items; } inline uint Length() const
{
return Hdr().items;
}
/** return true if array is full */ /** return true if array is full */
inline bool IsFull() const { return Length() >= C; } inline bool IsFull() const
{
return Length() >= C;
}
/** return true if array is empty */ /** return true if array is empty */
inline bool IsEmpty() const { return Length() <= 0; } inline bool IsEmpty() const
{
return Length() <= 0;
}
/** add (allocate), but don't construct item */ /** add (allocate), but don't construct item */
inline T *Append() { assert(!IsFull()); return &data[SizeRef()++]; } inline T *Append()
{
assert(!IsFull());
return &data[SizeRef()++];
}
/** add and construct item using default constructor */ /** add and construct item using default constructor */
inline T *AppendC() { T *item = Append(); new(item)T; return item; } inline T *AppendC()
{
T *item = Append();
new(item)T;
return item;
}
/** return item by index (non-const version) */ /** return item by index (non-const version) */
inline T& operator[](uint index) { assert(index < Length()); return data[index]; } inline T& operator[](uint index)
{
assert(index < Length());
return data[index];
}
/** return item by index (const version) */ /** return item by index (const version) */
inline const T& operator[](uint index) const { assert(index < Length()); return data[index]; } inline const T& operator[](uint index) const
{
assert(index < Length());
return data[index];
}
}; };
#endif /* FIXEDSIZEARRAY_HPP */ #endif /* FIXEDSIZEARRAY_HPP */

View File

@ -24,7 +24,10 @@ struct CHashTableSlotT
inline CHashTableSlotT() : m_pFirst(NULL) {} inline CHashTableSlotT() : m_pFirst(NULL) {}
/** hash table slot helper - clears the slot by simple forgetting its items */ /** hash table slot helper - clears the slot by simple forgetting its items */
inline void Clear() {m_pFirst = NULL;} inline void Clear()
{
m_pFirst = NULL;
}
/** hash table slot helper - linear search for item with given key through the given blob - const version */ /** hash table slot helper - linear search for item with given key through the given blob - const version */
inline const Titem_ *Find(const Key &key) const inline const Titem_ *Find(const Key &key) const
@ -168,14 +171,23 @@ protected:
} }
/** static helper - return hash for the given item modulo number of slots */ /** static helper - return hash for the given item modulo number of slots */
inline static int CalcHash(const Titem_ &item) {return CalcHash(item.GetKey());} inline static int CalcHash(const Titem_ &item)
{
return CalcHash(item.GetKey());
}
public: public:
/** item count */ /** item count */
inline int Count() const {return m_num_items;} inline int Count() const
{
return m_num_items;
}
/** simple clear - forget all items - used by CSegmentCostCacheT.Flush() */ /** simple clear - forget all items - used by CSegmentCostCacheT.Flush() */
inline void Clear() {for (int i = 0; i < Tcapacity; i++) m_slots[i].Clear();} inline void Clear()
{
for (int i = 0; i < Tcapacity; i++) m_slots[i].Clear();
}
/** const item search */ /** const item search */
const Titem_ *Find(const Tkey &key) const const Titem_ *Find(const Tkey &key) const

View File

@ -24,34 +24,23 @@
template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_> template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
class CNodeList_HashTableT { class CNodeList_HashTableT {
public: public:
/** make Titem_ visible from outside of class */ typedef Titem_ Titem; ///< Make #Titem_ visible from outside of class.
typedef Titem_ Titem; typedef typename Titem_::Key Key; ///< Make Titem_::Key a property of #HashTable.
/** make Titem_::Key a property of HashTable */ typedef SmallArray<Titem_, 65536, 256> CItemArray; ///< Type that we will use as item container.
typedef typename Titem_::Key Key; typedef CHashTableT<Titem_, Thash_bits_open_ > COpenList; ///< How pointers to open nodes will be stored.
/** type that we will use as item container */ typedef CHashTableT<Titem_, Thash_bits_closed_> CClosedList; ///< How pointers to closed nodes will be stored.
typedef SmallArray<Titem_, 65536, 256> CItemArray; typedef CBinaryHeapT<Titem_> CPriorityQueue; ///< How the priority queue will be managed.
/** how pointers to open nodes will be stored */
typedef CHashTableT<Titem_, Thash_bits_open_ > COpenList;
/** how pointers to closed nodes will be stored */
typedef CHashTableT<Titem_, Thash_bits_closed_> CClosedList;
/** how the priority queue will be managed */
typedef CBinaryHeapT<Titem_> CPriorityQueue;
protected: protected:
/** here we store full item data (Titem_) */ CItemArray m_arr; ///< Here we store full item data (Titem_).
CItemArray m_arr; COpenList m_open; ///< Hash table of pointers to open item data.
/** hash table of pointers to open item data */ CClosedList m_closed; ///< Hash table of pointers to closed item data.
COpenList m_open; CPriorityQueue m_open_queue; ///< Priority queue of pointers to open item data.
/** hash table of pointers to closed item data */ Titem *m_new_node; ///< New open node under construction.
CClosedList m_closed;
/** priority queue of pointers to open item data */
CPriorityQueue m_open_queue;
/** new open node under construction */
Titem *m_new_node;
public: public:
/** default constructor */ /** default constructor */
CNodeList_HashTableT() CNodeList_HashTableT() : m_open_queue(2048)
: m_open_queue(2048)
{ {
m_new_node = NULL; m_new_node = NULL;
} }
@ -152,9 +141,16 @@ public:
} }
/** The number of items. */ /** The number of items. */
inline int TotalCount() {return m_arr.Length();} inline int TotalCount()
{
return m_arr.Length();
}
/** Get a particular item. */ /** Get a particular item. */
inline Titem_& ItemAt(int idx) {return m_arr[idx];} inline Titem_& ItemAt(int idx)
{
return m_arr[idx];
}
/** Helper for creating output of this array. */ /** Helper for creating output of this array. */
template <class D> void Dump(D &dmp) const template <class D> void Dump(D &dmp) const

View File

@ -121,9 +121,7 @@ struct CSegmentCostCacheBase
* Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example * Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example
*/ */
template <class Tsegment> template <class Tsegment>
struct CSegmentCostCacheT struct CSegmentCostCacheT : public CSegmentCostCacheBase {
: public CSegmentCostCacheBase
{
static const int C_HASH_BITS = 14; static const int C_HASH_BITS = 14;
typedef CHashTableT<Tsegment, C_HASH_BITS> HashTable; typedef CHashTableT<Tsegment, C_HASH_BITS> HashTable;
@ -162,9 +160,7 @@ struct CSegmentCostCacheT
* segment cost caching services for your Nodes. * segment cost caching services for your Nodes.
*/ */
template <class Types> template <class Types>
class CYapfSegmentCostCacheGlobalT class CYapfSegmentCostCacheGlobalT : public CYapfSegmentCostCacheLocalT<Types> {
: public CYapfSegmentCostCacheLocalT<Types>
{
public: public:
typedef CYapfSegmentCostCacheLocalT<Types> Tlocal; typedef CYapfSegmentCostCacheLocalT<Types> Tlocal;
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)

View File

@ -15,9 +15,7 @@
#include "../../pbs.h" #include "../../pbs.h"
template <class Types> template <class Types>
class CYapfCostRailT class CYapfCostRailT : public CYapfCostBase {
: public CYapfCostBase
{
public: public:
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
typedef typename Types::TrackFollower TrackFollower; typedef typename Types::TrackFollower TrackFollower;
@ -74,10 +72,7 @@ protected:
static const int s_max_segment_cost = 10000; static const int s_max_segment_cost = 10000;
CYapfCostRailT() CYapfCostRailT() : m_max_cost(0), m_disable_cache(false), m_stopped_on_first_two_way_signal(false)
: m_max_cost(0)
, m_disable_cache(false)
, m_stopped_on_first_two_way_signal(false)
{ {
/* pre-compute look-ahead penalties into array */ /* pre-compute look-ahead penalties into array */
int p0 = Yapf().PfGetSettings().rail_look_ahead_signal_p0; int p0 = Yapf().PfGetSettings().rail_look_ahead_signal_p0;

View File

@ -12,8 +12,7 @@
#ifndef YAPF_DESTRAIL_HPP #ifndef YAPF_DESTRAIL_HPP
#define YAPF_DESTRAIL_HPP #define YAPF_DESTRAIL_HPP
class CYapfDestinationRailBase class CYapfDestinationRailBase {
{
protected: protected:
RailTypes m_compatible_railtypes; RailTypes m_compatible_railtypes;
@ -36,9 +35,7 @@ public:
}; };
template <class Types> template <class Types>
class CYapfDestinationAnyDepotRailT class CYapfDestinationAnyDepotRailT : public CYapfDestinationRailBase {
: public CYapfDestinationRailBase
{
public: public:
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
typedef typename Types::NodeList::Titem Node; ///< this will be our node type typedef typename Types::NodeList::Titem Node; ///< this will be our node type
@ -75,9 +72,7 @@ public:
}; };
template <class Types> template <class Types>
class CYapfDestinationAnySafeTileRailT class CYapfDestinationAnySafeTileRailT : public CYapfDestinationRailBase {
: public CYapfDestinationRailBase
{
public: public:
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
typedef typename Types::NodeList::Titem Node; ///< this will be our node type typedef typename Types::NodeList::Titem Node; ///< this will be our node type
@ -115,9 +110,7 @@ public:
}; };
template <class Types> template <class Types>
class CYapfDestinationTileOrStationRailT class CYapfDestinationTileOrStationRailT : public CYapfDestinationRailBase {
: public CYapfDestinationRailBase
{
public: public:
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
typedef typename Types::NodeList::Titem Node; ///< this will be our node type typedef typename Types::NodeList::Titem Node; ///< this will be our node type

View File

@ -25,8 +25,15 @@ struct CYapfNodeKeyExitDir {
m_exitdir = (m_td == INVALID_TRACKDIR) ? INVALID_DIAGDIR : TrackdirToExitdir(m_td); m_exitdir = (m_td == INVALID_TRACKDIR) ? INVALID_DIAGDIR : TrackdirToExitdir(m_td);
} }
inline int CalcHash() const {return m_exitdir | (m_tile << 2);} inline int CalcHash() const
inline bool operator==(const CYapfNodeKeyExitDir &other) const {return (m_tile == other.m_tile) && (m_exitdir == other.m_exitdir);} {
return m_exitdir | (m_tile << 2);
}
inline bool operator==(const CYapfNodeKeyExitDir &other) const
{
return m_tile == other.m_tile && m_exitdir == other.m_exitdir;
}
void Dump(DumpTarget &dmp) const void Dump(DumpTarget &dmp) const
{ {
@ -38,8 +45,15 @@ struct CYapfNodeKeyExitDir {
struct CYapfNodeKeyTrackDir : public CYapfNodeKeyExitDir struct CYapfNodeKeyTrackDir : public CYapfNodeKeyExitDir
{ {
inline int CalcHash() const {return m_td | (m_tile << 4);} inline int CalcHash() const
inline bool operator==(const CYapfNodeKeyTrackDir &other) const {return (m_tile == other.m_tile) && (m_td == other.m_td);} {
return m_td | (m_tile << 4);
}
inline bool operator==(const CYapfNodeKeyTrackDir &other) const
{
return m_tile == other.m_tile && m_td == other.m_td;
}
}; };
/** Yapf Node base */ /** Yapf Node base */
@ -63,14 +77,45 @@ struct CYapfNodeT {
m_estimate = 0; m_estimate = 0;
} }
inline Node *GetHashNext() {return m_hash_next;} inline Node *GetHashNext()
inline void SetHashNext(Node *pNext) {m_hash_next = pNext;} {
inline TileIndex GetTile() const {return m_key.m_tile;} return m_hash_next;
inline Trackdir GetTrackdir() const {return m_key.m_td;} }
inline const Tkey_& GetKey() const {return m_key;}
inline int GetCost() const {return m_cost;} inline void SetHashNext(Node *pNext)
inline int GetCostEstimate() const {return m_estimate;} {
inline bool operator<(const Node &other) const {return m_estimate < other.m_estimate;} m_hash_next = pNext;
}
inline TileIndex GetTile() const
{
return m_key.m_tile;
}
inline Trackdir GetTrackdir() const
{
return m_key.m_td;
}
inline const Tkey_& GetKey() const
{
return m_key;
}
inline int GetCost() const
{
return m_cost;
}
inline int GetCostEstimate() const
{
return m_estimate;
}
inline bool operator<(const Node &other) const
{
return m_estimate < other.m_estimate;
}
void Dump(DumpTarget &dmp) const void Dump(DumpTarget &dmp) const
{ {

View File

@ -14,9 +14,7 @@
/** Yapf Node for road YAPF */ /** Yapf Node for road YAPF */
template <class Tkey_> template <class Tkey_>
struct CYapfRoadNodeT struct CYapfRoadNodeT : CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > {
: CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> >
{
typedef CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > base; typedef CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > base;
TileIndex m_segment_last_tile; TileIndex m_segment_last_tile;

View File

@ -14,11 +14,7 @@
/** Yapf Node for ships */ /** Yapf Node for ships */
template <class Tkey_> template <class Tkey_>
struct CYapfShipNodeT struct CYapfShipNodeT : CYapfNodeT<Tkey_, CYapfShipNodeT<Tkey_> > { };
: CYapfNodeT<Tkey_, CYapfShipNodeT<Tkey_> >
{
};
/* now define two major node types (that differ by key type) */ /* now define two major node types (that differ by key type) */
typedef CYapfShipNodeT<CYapfNodeKeyExitDir> CYapfShipNodeExitDir; typedef CYapfShipNodeT<CYapfNodeKeyExitDir> CYapfShipNodeExitDir;
@ -28,5 +24,4 @@ typedef CYapfShipNodeT<CYapfNodeKeyTrackDir> CYapfShipNodeTrackDir;
typedef CNodeList_HashTableT<CYapfShipNodeExitDir , 10, 12> CShipNodeListExitDir; typedef CNodeList_HashTableT<CYapfShipNodeExitDir , 10, 12> CShipNodeListExitDir;
typedef CNodeList_HashTableT<CYapfShipNodeTrackDir, 10, 12> CShipNodeListTrackDir; typedef CNodeList_HashTableT<CYapfShipNodeTrackDir, 10, 12> CShipNodeListTrackDir;
#endif /* YAPF_NODE_SHIP_HPP */ #endif /* YAPF_NODE_SHIP_HPP */