Hash.h 567 Bytes

#ifndef _AE_Hash_h
#define _AE_Hash_h

#include <libaudio.h>
#include "Assets.h"

#define HASH_MIN_SIZE    0x1000 // must be a number with only one bit set!!!
#define HASH_SLOT_EMPTY  0xFFFFFFFF

typedef struct {
    u32       bankOffset;
    AEAsset   *assetAddr;
} hashPair;

class HashTable
{
  protected:
    hashPair      *hashT;
    int           hashSize;
    unsigned int  hashMask;

  public:
    HashTable(int numItems);    
    ~HashTable();

    int      AddPair(u32 bankOffset, AEAsset* assetAddr);
    AEAsset* MatchPair(u32 bankOffset);
};


#endif