// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Iwhashtable.pas' rev: 10.00

#ifndef IwhashtableHPP
#define IwhashtableHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Iwhashtable
{
//-- type declarations -------------------------------------------------------
typedef int __fastcall (*TCompareFunc)(AnsiString Val1, AnsiString Val2);

typedef Word __fastcall (*THashFunc)(AnsiString AKey);

typedef DynamicArray<Classes::TList* >  TArrayOfList;

class DELPHICLASS THashTable;
class PASCALIMPLEMENTATION THashTable : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	TCompareFunc fCompare;
	THashFunc fHash;
	int fSize;
	DynamicArray<Classes::TList* >  fBuckets;
	double __fastcall GetLoadFactor(void);
	
public:
	__fastcall THashTable(int size, TCompareFunc CmpFunc, THashFunc HashFunc);
	__fastcall virtual ~THashTable(void);
	void __fastcall Add(AnsiString AKey, System::TObject* AValue);
	System::TObject* __fastcall LookUp(AnsiString AKey);
	System::TObject* __fastcall LookUpAndRemove(AnsiString AKey);
	void __fastcall ResizeTable(int Size);
	__property double LoadFactor = {read=GetLoadFactor};
	__property int Size = {read=fSize, nodefault};
	__property TArrayOfList Buckets = {read=fBuckets};
};


class DELPHICLASS EHashTableException;
class PASCALIMPLEMENTATION EHashTableException : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall EHashTableException(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall EHashTableException(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall EHashTableException(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall EHashTableException(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall EHashTableException(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall EHashTableException(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall EHashTableException(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall EHashTableException(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~EHashTableException(void) { }
	#pragma option pop
	
};


class DELPHICLASS THashNode;
class PASCALIMPLEMENTATION THashNode : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	AnsiString Key;
	System::TObject* Value;
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall THashNode(void) : System::TObject() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~THashNode(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Iwhashtable */
using namespace Iwhashtable;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Iwhashtable
