| 58 | |
| 59 | template<class Key=word, class Hash=string::hash> |
| 60 | class HashSet |
| 61 | : |
| 62 | public HashTable<nil, Key, Hash> |
| 63 | { |
| 64 | |
| 65 | public: |
| 66 | |
| 67 | typedef typename HashTable<nil, Key, Hash>::iterator iterator; |
| 68 | typedef typename HashTable<nil, Key, Hash>::const_iterator const_iterator; |
| 69 | |
| 70 | |
| 71 | // Constructors |
| 72 | |
| 73 | //- Construct given initial size |
| 74 | HashSet(const label size = 128) |
| 75 | : |
| 76 | HashTable<nil, Key, Hash>(size) |
| 77 | {} |
| 78 | |
| 79 | //- Construct from Istream |
| 80 | HashSet(Istream& is) |
| 81 | : |
| 82 | HashTable<nil, Key, Hash>(is) |
| 83 | {} |
| 84 | |
| 85 | //- Construct from UList of Key |
| 86 | HashSet(const UList<Key>&); |
| 87 | |
| 88 | //- Construct as copy |
| 89 | HashSet(const HashSet<Key, Hash>& hs) |
| 90 | : |
| 91 | HashTable<nil, Key, Hash>(hs) |
| 92 | {} |
| 93 | |
| 94 | //- Construct by transferring the parameter contents |
| 95 | HashSet(const Xfer<HashSet<Key, Hash>>& hs) |
| 96 | : |
| 97 | HashTable<nil, Key, Hash>(hs) |
| 98 | {} |
| 99 | |
| 100 | //- Construct by transferring the parameter contents |
| 101 | HashSet(const Xfer<HashTable<nil, Key, Hash>>& hs) |
| 102 | : |
| 103 | HashTable<nil, Key, Hash>(hs) |
| 104 | {} |
| 105 | |
| 106 | //- Construct from the keys of another HashTable, |
| 107 | // the type of values held is arbitrary. |
| 108 | template<class AnyType, class AnyHash> |
| 109 | HashSet(const HashTable<AnyType, Key, AnyHash>&); |
| 110 | |
| 111 | |
| 112 | // Member Functions |
| 113 | |
| 114 | // Edit |
| 115 | |
| 116 | //- Insert a new entry |
| 117 | bool insert(const Key& key) |