From f4b191f0ea396b58465bfba40749977780a3af58 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 11 Feb 2009 05:29:41 +0000 Subject: Just removing some things that are cluttering up the source tree. --- src/old/ordhash.h | 104 ------------------------------------------------------ 1 file changed, 104 deletions(-) delete mode 100644 src/old/ordhash.h (limited to 'src/old/ordhash.h') diff --git a/src/old/ordhash.h b/src/old/ordhash.h deleted file mode 100644 index e946f95..0000000 --- a/src/old/ordhash.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef ORD_HASH_H -#define ORD_HASH_H - -#include "hash.h" -#include "tqsort.h" - -template, typename valuealloc = std::allocator, typename challoc = std::allocator > -class OrdHash : public Hash -{ -public: - OrdHash() : - bSorted( false ), - aData( NULL ) - { - } - - virtual ~OrdHash() - { - } - -protected: - virtual void invalidate() - { - bSorted = false; - delete[] aData; - aData = NULL; - } - - virtual void onInsert() - { - invalidate(); - } - - virtual void onUpdate() - { - invalidate(); - } - - virtual void onDelete() - { - invalidate(); - } - - virtual void onReHash() - { - invalidate(); - } - - virtual std::pair getAtPos( uint32_t nPos ) - { - return Hash::getAtPos( aData[nPos].nIndex ); - } - - virtual void buildIndex() - { - aData = new struct ind[this->nFilled]; - uint32_t k = 0; - for( uint32_t j = 0; j < this->nCapacity; j++ ) - { - if( this->isFilled( j ) ) - { - if( !this->isDeleted( j ) ) - { - aData[k].pVal = &(this->aValues[j]); - aData[k].nIndex = j; - k++; - } - } - } - - tqsort::ind, cmpfnc, value **>( aData, this->nFilled ); - - bSorted = true; - } - - virtual uint32_t getFirstPos( bool &bFinished ) - { - if( bSorted == false ) - buildIndex(); - - return 0; - } - - virtual uint32_t getNextPos( uint32_t nPos, bool &bFinished ) - { - if( nPos+1 >= this->nFilled ) - { - bFinished = true; - return 0; - } - return ++nPos; - } -public: - typedef struct ind - { - value *pVal; - uint32_t nIndex; - } ind; -private: - bool bSorted; - ind *aData; -}; - -#endif -- cgit v1.2.3