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);
100 template<
class T,
class Key,
class Hash>
110 template<
class T,
class Key,
class Hash>
113 iterator iter = this->find(key);
115 if (iter == this->end())
118 << key <<
" not found in table. Valid entries: " 127 template<
class T,
class Key,
class Hash>
130 const_iterator iter = this->find(key);
132 if (iter == this->cend())
135 << key <<
" not found in table. Valid entries: " 144 template<
class T,
class Key,
class Hash>
147 iterator iter = this->find(key);
149 if (iter == this->end())
163 template<
class T,
class Key,
class Hash>
172 template<
class T,
class Key,
class Hash>
182 if (hashTable_->nElmts_)
187 !(entryPtr_ = hashTable_->table_[hashIndex_])
188 && ++hashIndex_ < hashTable_->tableSize_
192 if (hashIndex_ >= hashTable_->tableSize_)
202 template<
class T,
class Key,
class Hash>
206 const hashedEntry* elmt,
207 const label hashIndex
211 entryPtr_(const_cast<hashedEntry*>(elmt)),
212 hashIndex_(hashIndex)
216 template<
class T,
class Key,
class Hash>
225 hashIndex_ = -(hashIndex_+1) - 1;
229 if (entryPtr_->next_)
232 entryPtr_ = entryPtr_->next_;
246 ++hashIndex_ < hashTable_->tableSize_
247 && !(entryPtr_ = hashTable_->table_[hashIndex_])
251 if (hashIndex_ >= hashTable_->tableSize_)
260 template<
class T,
class Key,
class Hash>
264 return entryPtr_->key_;
268 template<
class T,
class Key,
class Hash>
272 return entryPtr_->obj_;
276 template<
class T,
class Key,
class Hash>
280 return entryPtr_->obj_;
284 template<
class T,
class Key,
class Hash>
285 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator==
290 return entryPtr_ == iter.entryPtr_;
294 template<
class T,
class Key,
class Hash>
295 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator!=
300 return entryPtr_ != iter.entryPtr_;
304 template<
class T,
class Key,
class Hash>
305 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator==
314 template<
class T,
class Key,
class Hash>
315 inline bool Foam::HashTable<T, Key, Hash>::iteratorBase::operator!=
326 template<
class T,
class Key,
class Hash>
333 template<
class T,
class Key,
class Hash>
343 template<
class T,
class Key,
class Hash>
353 template<
class T,
class Key,
class Hash>
358 const label hashIndex
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>
397 template<
class T,
class Key,
class Hash>
407 template<
class T,
class Key,
class Hash>
417 template<
class T,
class Key,
class Hash>
427 template<
class T,
class Key,
class Hash>
434 template<
class T,
class Key,
class Hash>
444 template<
class T,
class Key,
class Hash>
454 template<
class T,
class Key,
class Hash>
464 template<
class T,
class Key,
class Hash>
468 const hashedEntry* elmt,
469 const label hashIndex
476 template<
class T,
class Key,
class Hash>
484 template<
class T,
class Key,
class Hash>
492 template<
class T,
class Key,
class Hash>
502 template<
class T,
class Key,
class Hash>
512 template<
class T,
class Key,
class Hash>
520 template<
class T,
class Key,
class Hash>
A zero-sized end iterator.
A simple container for copying or transferring objects of type <T>.
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.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
An STL-conforming iterator.
Xfer< HashTable< T, Key, Hash > > xfer()
Transfer contents to the Xfer container.
const Key & key() const
Return the Key corresponding to the iterator.
const_iterator()
Construct null (end iterator)
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
timeIndices insert(timeIndex, timeDirs[timeI].value())
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.