30 template<
class T,
class Key,
class Hash>
46 template<
class T,
class Key,
class Hash>
51 return Hash()(key) & (tableSize_ - 1);
57 template<
class T,
class Key,
class Hash>
64 template<
class T,
class Key,
class Hash>
71 template<
class T,
class Key,
class Hash>
78 template<
class T,
class Key,
class Hash>
85 return this->
set(key, newEntry,
true);
89 template<
class T,
class Key,
class Hash>
96 return this->
set(key, newEntry,
false);
102 template<
class T,
class Key,
class Hash>
105 iterator iter = this->find(key);
107 if (iter == this->end())
110 << key <<
" not found in table. Valid entries: " 119 template<
class T,
class Key,
class Hash>
122 const_iterator iter = this->find(key);
124 if (iter == this->cend())
127 << key <<
" not found in table. Valid entries: " 136 template<
class T,
class Key,
class Hash>
139 iterator iter = this->find(key);
141 if (iter == this->end())
155 template<
class T,
class Key,
class Hash>
164 template<
class T,
class Key,
class Hash>
174 if (hashTable_->nElmts_)
179 !(entryPtr_ = hashTable_->table_[hashIndex_])
180 && ++hashIndex_ < hashTable_->tableSize_
184 if (hashIndex_ >= hashTable_->tableSize_)
194 template<
class T,
class Key,
class Hash>
198 const hashedEntry* elmt,
199 const label hashIndex
203 entryPtr_(const_cast<hashedEntry*>(elmt)),
204 hashIndex_(hashIndex)
208 template<
class T,
class Key,
class Hash>
217 hashIndex_ = -(hashIndex_+1) - 1;
221 if (entryPtr_->next_)
224 entryPtr_ = entryPtr_->next_;
238 ++hashIndex_ < hashTable_->tableSize_
239 && !(entryPtr_ = hashTable_->table_[hashIndex_])
243 if (hashIndex_ >= hashTable_->tableSize_)
252 template<
class T,
class Key,
class Hash>
256 return entryPtr_->key_;
260 template<
class T,
class Key,
class Hash>
264 return entryPtr_->obj_;
268 template<
class T,
class Key,
class Hash>
272 return entryPtr_->obj_;
276 template<
class T,
class Key,
class Hash>
277 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator==
282 return entryPtr_ == iter.entryPtr_;
286 template<
class T,
class Key,
class Hash>
287 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator!=
292 return entryPtr_ != iter.entryPtr_;
296 template<
class T,
class Key,
class Hash>
297 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator==
306 template<
class T,
class Key,
class Hash>
307 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator!=
318 template<
class T,
class Key,
class Hash>
325 template<
class T,
class Key,
class Hash>
335 template<
class T,
class Key,
class Hash>
345 template<
class T,
class Key,
class Hash>
350 const label hashIndex
357 template<
class T,
class Key,
class Hash>
365 template<
class T,
class Key,
class Hash>
373 template<
class T,
class Key,
class Hash>
381 template<
class T,
class Key,
class Hash>
389 template<
class T,
class Key,
class Hash>
399 template<
class T,
class Key,
class Hash>
409 template<
class T,
class Key,
class Hash>
419 template<
class T,
class Key,
class Hash>
426 template<
class T,
class Key,
class Hash>
436 template<
class T,
class Key,
class Hash>
446 template<
class T,
class Key,
class Hash>
456 template<
class T,
class Key,
class Hash>
460 const hashedEntry* elmt,
461 const label hashIndex
468 template<
class T,
class Key,
class Hash>
476 template<
class T,
class Key,
class Hash>
484 template<
class T,
class Key,
class Hash>
494 template<
class T,
class Key,
class Hash>
504 template<
class T,
class Key,
class Hash>
512 template<
class T,
class Key,
class Hash>
A zero-sized end iterator.
label capacity() const
The size of the underlying table.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An STL-conforming const_iterator.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const_iterator & operator++()
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool empty() const
Return true if the hash table is empty.
iterator()
Construct null (end iterator)
const T & cobject() const
Return const access to referenced object.
T & object()
Return non-const access to referenced object.
T & operator()(const Key &)
Find and return a hashedEntry, create it null if not present.
label size() const
Return number of elements in table.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
An STL-conforming iterator.
const Key & key() const
Return the Key corresponding to the iterator.
const_iterator()
Construct null (end iterator)
iterator begin()
Iterator set to the beginning of the HashTable.
An STL-conforming hash table.
const T & operator*() const
Return referenced hash value.
void increment()
Increment to the next position.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
T & operator*()
Return referenced hash value.
const T & operator()() const
T & operator[](const Key &)
Find and return a hashedEntry.
const_iterator cbegin() const
const_iterator set to the beginning of the HashTable
The iterator base for HashTable.
iteratorBase()
Construct null - equivalent to an 'end' position.