diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index c01b30cc..e734697d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -62,24 +62,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Define a field inside an object that is used to link it into a hash table #define HASHLINK(object) THashLink< object > -// Define a POINTER to a hash table, not a hash table -#define HASHTABLE(object,key) THashTable< object, key > - // Define a hash table: // - starts with kSlotMinCount rows // - can grow to kDefaultSlotMaxCount rows // (hash table grows when a row contains more than kGrowOnListSize entries #define HASHTABLEDECL(object,key,link) THashTableDecl< object, key, offsetof(object,link), 0 > -// Define a hash table in situations when a forward reference prevents use of HASHTABLEDECL -// - Size characteristics are identical to HASHTABLEDECL -#define HASHTABLEDYN(object,key) THashTableDyn< object, key > - -// Define a hash table with: -// - starts with -// - row table never grows -#define HASHTABLEDECLSIZE(object,key,link,size) THashTableDecl - #if defined(_MSC_VER) #define forceinline __forceinline @@ -595,28 +583,6 @@ THashTableDecl::THashTableDecl () { } -/**************************************************************************** -* -* THashTableDyn -* -***/ - -template -class THashTableDyn : public THashTable { - -public: - void Initialize (int linkOffset, unsigned maxSize = 0); - -}; - -//=========================================================================== -template -void THashTableDyn::Initialize (int linkOffset, unsigned maxSize) { - this->SetLinkOffset(linkOffset, maxSize); - this->SetSlotMaxCount(maxSize); -} - - /**************************************************************************** * * THashKeyVal diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index 862970bd..3ca71606 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -57,11 +57,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #define PRIORITY_TIME(class) TPriorityTime< class > -#define PRIORITY_NUMERIC(class,type) TPriorityNumeric< class,type > #define PRIQ(class,priority) TPriorityQueue< class,priority > #define PRIQDECL(class,priority,field) TPriorityQueueDecl< class,priority,offsetof(class,field) > -#define PRIQDYN(class,priority) TPriorityQueueDyn< class,priority > /**************************************************************************** @@ -351,19 +349,6 @@ public: }; -/**************************************************************************** -* -* TPriorityQueueDyn -* -***/ - -template -class TPriorityQueueDyn : public TPriorityQueue { -public: - void Initialize (int linkOffset) { this->SetLinkOffset(linkOffset); } -}; - - /**************************************************************************** * * class TBasePriority @@ -419,39 +404,6 @@ void TBasePriority::Relink () { queue->Enqueue(object); } - -/**************************************************************************** -* -* class TPriorityNumeric -* -***/ - -template -class TPriorityNumeric : public TBasePriority< C, TPriorityNumeric > { - -public: - TPriorityNumeric () : m_value(0) { } - TPriorityNumeric (T value) : m_value(value) { } - void Set (T value) { - if (value == m_value) - return; - m_value = value; - this->Relink(); - } - T Get () const { - return m_value; - } - bool IsPriorityHigher (const TPriorityNumeric & source) { - return m_value > source.m_value; - } - bool IsPriorityHigher (T value) const { - return m_value > value; - } - -private: - T m_value; -}; - /**************************************************************************** * * class TPriorityTime diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h index bd1752ec..dd20e76c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h @@ -191,50 +191,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com } \ } \ } - - -/**************************************************************************** -* -* BSEARCH -* -* This macro binary searches a sorted array to find an existing entry or -* the position where a new entry should be placed. It returns the index of -* the first entry for which the expression is false (zero or negative), or -* count if the expression is true (positive) for all entries. -* -* Typically the expression will return: -* > 0 if (sortKey > elem) -* <= 0 if (sortKey <= elem) -* -* The final parameter to the macro is the address of a variable which is -* filled with the resulting index. -* -***/ - -//=========================================================================== -#define BSEARCH(T, ptr, count, expr, addrOfIndex) { \ - \ - const T * low = (ptr); \ - const T * high = (ptr) + (count); /* first entry for which */ \ - /* expr is false */ \ - \ - if (low != high) \ - for (;;) { \ - const T & elem = *(low + (high - low) / 2); \ - int result = (expr); \ - if (result > 0) { \ - if (&elem == low) \ - break; \ - low = &elem; \ - } \ - else { \ - high = &elem; \ - if (&elem == low) \ - break; \ - } \ - } \ - \ - *(addrOfIndex) = high - (ptr); \ - \ -} #endif