⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashtable.h

📁 联通的短信网关平台。 sp 使用。 如果想自己用vc 开发短信业务
💻 H
字号:
// HashTable.h: interface for the CHashTable class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HASHTABLE_H__652ACC49_4112_4642_9B77_68A08C4371A2__INCLUDED_)
#define AFX_HASHTABLE_H__652ACC49_4112_4642_9B77_68A08C4371A2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//class CTableData io:
class CTableData
{
public:
	CTableData();
	virtual ~CTableData();
	
	bool DataCmp(char *pData);
	bool DatanCmp(char *pData, int nLen);
	
public:
	char m_cData[21];
	unsigned long m_ulHashKey;
	CTableData *m_pNext;
	
private:
	
};


//class CHashTable IO:
class CHashTable  
{
public:
	CHashTable();
	~CHashTable();

public:
	/*	
		set Hash table size
		return the size
	*/
	unsigned long SetHashSize(unsigned long nTableSize);
	/*	
		Insert Data into the table
		return the index
	*/ 
	unsigned long InsData(char *pData);
	/*	
		Locate the data in the Table
		return true if it is exist
	*/
	bool LocateData(char *pData, int nLen);
	/*	
		Delete the data in the Table
		return true if del succeed
	*/
	bool DelData(char *pData, int nLen);

private:
	/* htable_hash - hash a string 
	* char *s,the string
	* size: length of string
	*/
	unsigned long CreateHashKey(const char *s, unsigned size=0);
	void DestoryHashTable(void);

private:
	unsigned long m_nTableSize;	
	CTableData *m_pDataList;
};



#endif // !defined(AFX_HASHTABLE_H__652ACC49_4112_4642_9B77_68A08C4371A2__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -