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>
107 if (iter == this->end())
110 << key <<
" not found in table. Valid entries: "
119 template<
class T,
class Key,
class Hash>
124 if (iter == this->cend())
127 << key <<
" not found in table. Valid entries: "
136 template<
class T,
class Key,
class Hash>
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>
282 return entryPtr_ == iter.entryPtr_;
286 template<
class T,
class Key,
class Hash>
292 return entryPtr_ != iter.entryPtr_;
296 template<
class T,
class Key,
class Hash>
306 template<
class T,
class Key,
class Hash>
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>
361 return this->object();
365 template<
class T,
class Key,
class Hash>
369 return this->object();
373 template<
class T,
class Key,
class Hash>
377 return this->cobject();
381 template<
class T,
class Key,
class Hash>
385 return this->cobject();
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>
472 return this->cobject();
476 template<
class T,
class Key,
class Hash>
480 return this->cobject();
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>
An STL-conforming const_iterator.
const T & operator*() const
Return referenced hash value.
const_iterator & operator++()
const_iterator()
Construct null (end iterator)
const T & operator()() const
The iterator base for HashTable.
const T & cobject() const
Return const access to referenced object.
T & object()
Return non-const access to referenced object.
iteratorBase()
Construct null - equivalent to an 'end' position.
const Key & key() const
Return the Key corresponding to the iterator.
void increment()
Increment to the next position.
An STL-conforming iterator.
T & operator*()
Return referenced hash value.
iterator()
Construct null (end iterator)
An STL-conforming hash table.
T & operator[](const Key &)
Find and return a hashedEntry.
iterator begin()
Iterator set to the beginning of the HashTable.
label size() const
Return number of elements in table.
const_iterator cbegin() const
const_iterator set to the beginning of the HashTable
friend class iteratorBase
Declare friendship with the iteratorBase.
label capacity() const
The size of the underlying table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool empty() const
Return true if the hash table is empty.
friend class iterator
Declare friendship with the iterator.
T & operator()(const Key &)
Find and return a hashedEntry, create it null if not present.
friend class const_iterator
Declare friendship with the const_iterator.
Hash function class for primitives. All non-primitives used to hash entries on hash tables likely nee...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A zero-sized end iterator.