Templates -- Meow  1.2.9
A C++ template contains kinds of interesting classes and functions
meow::HashTableList< Data, HashFunc > Class Template Reference

一個當key相撞時會用list解決的hash_table More...

#include "HashTable.h"

Public Member Functions

 HashTableList ()
 constructor More...
 
 HashTableList (size_t size, HashFunc const &func)
 constructor More...
 
 ~HashTableList ()
 destructor More...
 
HashTableListcopyFrom (HashTableList const &b)
 copy More...
 
void clear ()
 清除資料 More...
 
void reset (size_t size, HashFunc const &func)
 清除資料, 指定新的size與hash function More...
 
size_t tableSize () const
 回傳table size More...
 
size_t size () const
 回傳目前有多少element在其中 More...
 
HashFunc const & func () const
 回傳hash function More...
 
bool add (Data const &e)
 加入新的element More...
 
bool add (HashTableList const &h)
 把給定的HashTableList中所有的element全加進來 More...
 
bool del (Data const &e)
 刪除element More...
 
bool del (HashTableList const &h)
 刪除有出現在給定的的HashTableList中的element More...
 
bool exist (Data const &e) const
 查看某element是否已經擁有 More...
 
std::vector< Data > all () const
 回傳所有存下來的資料 More...
 
std::vector< Data > all (size_t index) const
 回傳所有存下來且key為index的資料 More...
 
HashTableListoperator= (HashTableList const &h)
 same as copyFrom(h) More...
 
HashTableListoperator+= (HashTableList const &h)
 same as add(h) More...
 
HashTableListoperator-= (HashTableList const &h)
 same as del(h) More...
 

Detailed Description

template<class Data, class HashFunc>
class meow::HashTableList< Data, HashFunc >

一個當key相撞時會用list解決的hash_table

Author
cat_leopard

Definition at line 15 of file HashTable.h.

Constructor & Destructor Documentation

template<class Data , class HashFunc >
meow::HashTableList< Data, HashFunc >::HashTableList ( )
inline

constructor

Definition at line 23 of file HashTable.h.

template<class Data , class HashFunc >
meow::HashTableList< Data, HashFunc >::HashTableList ( size_t  size,
HashFunc const &  func 
)
inline

constructor

設定table size, hash function

Definition at line 31 of file HashTable.h.

template<class Data , class HashFunc >
meow::HashTableList< Data, HashFunc >::~HashTableList ( )
inline

destructor

Definition at line 37 of file HashTable.h.

Member Function Documentation

template<class Data , class HashFunc >
bool meow::HashTableList< Data, HashFunc >::add ( Data const &  e)
inline

加入新的element

Definition at line 95 of file HashTable.h.

template<class Data , class HashFunc >
bool meow::HashTableList< Data, HashFunc >::add ( HashTableList< Data, HashFunc > const &  h)
inline

把給定的HashTableList中所有的element全加進來

Definition at line 104 of file HashTable.h.

template<class Data , class HashFunc >
std::vector<Data> meow::HashTableList< Data, HashFunc >::all ( ) const
inline

回傳所有存下來的資料

Definition at line 173 of file HashTable.h.

template<class Data , class HashFunc >
std::vector<Data> meow::HashTableList< Data, HashFunc >::all ( size_t  index) const
inline

回傳所有存下來且key為index的資料

Definition at line 187 of file HashTable.h.

template<class Data , class HashFunc >
void meow::HashTableList< Data, HashFunc >::clear ( )
inline

清除資料

Definition at line 52 of file HashTable.h.

template<class Data , class HashFunc >
HashTableList& meow::HashTableList< Data, HashFunc >::copyFrom ( HashTableList< Data, HashFunc > const &  b)
inline

copy

Definition at line 43 of file HashTable.h.

template<class Data , class HashFunc >
bool meow::HashTableList< Data, HashFunc >::del ( Data const &  e)
inline

刪除element

Definition at line 117 of file HashTable.h.

template<class Data , class HashFunc >
bool meow::HashTableList< Data, HashFunc >::del ( HashTableList< Data, HashFunc > const &  h)
inline

刪除有出現在給定的的HashTableList中的element

Definition at line 132 of file HashTable.h.

template<class Data , class HashFunc >
bool meow::HashTableList< Data, HashFunc >::exist ( Data const &  e) const
inline

查看某element是否已經擁有

Definition at line 160 of file HashTable.h.

template<class Data , class HashFunc >
HashFunc const& meow::HashTableList< Data, HashFunc >::func ( ) const
inline

回傳hash function

Definition at line 88 of file HashTable.h.

template<class Data , class HashFunc >
HashTableList& meow::HashTableList< Data, HashFunc >::operator+= ( HashTableList< Data, HashFunc > const &  h)
inline

same as add(h)

Definition at line 203 of file HashTable.h.

template<class Data , class HashFunc >
HashTableList& meow::HashTableList< Data, HashFunc >::operator-= ( HashTableList< Data, HashFunc > const &  h)
inline

same as del(h)

Definition at line 209 of file HashTable.h.

template<class Data , class HashFunc >
HashTableList& meow::HashTableList< Data, HashFunc >::operator= ( HashTableList< Data, HashFunc > const &  h)
inline

same as copyFrom(h)

Definition at line 198 of file HashTable.h.

template<class Data , class HashFunc >
void meow::HashTableList< Data, HashFunc >::reset ( size_t  size,
HashFunc const &  func 
)
inline

清除資料, 指定新的size與hash function

Definition at line 61 of file HashTable.h.

template<class Data , class HashFunc >
size_t meow::HashTableList< Data, HashFunc >::size ( ) const
inline

回傳目前有多少element在其中

Definition at line 77 of file HashTable.h.

template<class Data , class HashFunc >
size_t meow::HashTableList< Data, HashFunc >::tableSize ( ) const
inline

回傳table size

Definition at line 70 of file HashTable.h.


The documentation for this class was generated from the following file: