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

📄 ivu_hash.hxx

📁 hl2 source code. Do not use it illegal.
💻 HXX
字号:
#ifndef IVP_HASH_INCLUDED
#define IVP_HASH_INCLUDED

class IVP_Hash_Elem;

extern unsigned int IVP_Hash_crctab[];

class IVP_Hash {
    friend class IVP_U_String_Hash;
    int key_size;
    int	size;
    void *not_found_value;
    IVP_Hash_Elem **elems;
    
public:
    inline int hash_index(const char *key)const;
    
    IVP_Hash(int size, int key_size,void *not_found_value = 0);
    ~IVP_Hash();
    void add(const char *key,void *value);
    void remove(const char *key);
    void *find(const char *key)const;
};

/** class for looping through the Hash,
  if you want to delete current element, call next_element first,
  Note: not implemented */
class IVP_Hash_Enumerator {
    int index_pos;
    IVP_Hash *my_hash;
    IVP_Hash_Elem *el;
public:
    IVP_Hash_Enumerator(IVP_Hash *hash){ my_hash = hash; index_pos = -1; el = 0;};
    void *next_element();
};


/** typical usage:
 *	IVP_Hash_Enumerator en(hash);
 *	while  ( x = en.next_element()){
 *	}
*/

#endif

⌨️ 快捷键说明

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