/*******************************************************************************
 *
 *	Copyright (C) 2008 ITS Co., Ltd. All rights reserved.
 *
 *	SubSystem Name : 
 *	Initial Author : hsahn
 *	Description:
 *		CDblHash class created by tmpl_hash.py
 *		Key   : string(char *)
 *		Value : double, Set(double), Get(double), Get(CDblArray)
 *		if hash key collision, append as linked list
 *
 *		*** Don't edit this file manually ***
 ******************************************************************************/

#ifndef __DBL_HASH_H__
#define __DBL_HASH_H__

#include <stdio.h>
#include "cstream.h"
#include "cstring.h"
#include "str_array.h"
#include "dbl_array.h"


class V2_CLASS_API CDblHash
{
private:
	class CHashBag
	{
	public:
		int iHash;
		CString sKey;
		CDblArray vaData;
		CHashBag *pNext;
	};

	CHashBag **m_ppBag;
	int m_iBagSize;
	int m_iDataCnt;
	

public:
	CDblHash(int p_iBagSize=1024);
	~CDblHash();

	void Clear(void);
	int Set(const char *p_szKey, double p_szData, bool p_bOverwrite=false);
	int Get(const char *p_szKey, double *p_pVal);
	int Get(const char *p_szKey, CDblArray *p_pArr);
	
	void Remove(const char *p_szKey);
	void GetKeys(CStrArray &p_saKeys);

	void Dump(CStream *p_pBuffer);

	static int HashFunc(const char *p_sKey, int p_iLen);
};

#endif	// __DBL_HASH_H__

