
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Christian Fremuth-Paeger, July 2000.
**  
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/             


#if !defined(_HASHTBL_H_)

#define _HASHTBL_H_

#include <absobj.h>


template <class TItem,class TKey>
class goblinHashTable : public goblinDataObject
{
private:

    TItem*          first;
    TItem*          next;
    TItem*          index;
    TKey*           key;         

    TItem           range;
    TItem           nHash;
    TItem           nMax;
	TItem 			UNDEFINED;
    TKey            defaultKey;
    TItem           free;
    TItem           nz;

public:

    goblinHashTable(TItem rr,TItem nn,TKey alpha,
        goblinController& thisContext) throw();
    ~goblinHashTable() throw();
    
    void            Init() throw();
    unsigned long   Size() throw();
    unsigned long   Allocated() throw();

    char*           Display() throw();
    
    TItem           NMax() throw() {return nMax;};
    TItem           NZ() throw() {return nz;};

    TKey            Key(TItem w) throw(ERRange);
    void            ChangeKey(TItem w,TKey alpha) throw(ERRange,ERRejected);

};


#endif
