30 template<
class T,
class Key,
class Hash>
35 return Hash()(key) & (keys_.size() - 1);
41 template<
class T,
class Key,
class Hash>
48 template<
class T,
class Key,
class Hash>
55 template<
class T,
class Key,
class Hash>
62 return set(key, newEntry,
true);
66 template<
class T,
class Key,
class Hash>
73 return set(key, newEntry,
false);
79 template<
class T,
class Key,
class Hash>
95 template<
class T,
class Key,
class Hash>
114 template<
class T,
class Key,
class Hash>
133 template<
class T,
class Key,
class Hash>
134 template<
class TRef,
class TableRef>
143 hashIndex_(hashIndex),
144 elemIndex_(elemIndex)
148 template<
class T,
class Key,
class Hash>
149 template<
class TRef,
class TableRef>
155 hashTable_(iter.hashTable_),
156 hashIndex_(iter.hashIndex_),
157 elemIndex_(iter.elemIndex_)
161 template<
class T,
class Key,
class Hash>
162 template<
class TRef,
class TableRef>
169 this->hashIndex_ = iter.hashIndex_;
170 this->elemIndex_ = iter.elemIndex_;
174 template<
class T,
class Key,
class Hash>
175 template<
class TRef,
class TableRef>
182 return hashIndex_ == iter.hashIndex_ && elemIndex_ == iter.elemIndex_;
186 template<
class T,
class Key,
class Hash>
187 template<
class TRef,
class TableRef>
194 return hashIndex_ == iter.hashIndex_ && elemIndex_ == iter.elemIndex_;
198 template<
class T,
class Key,
class Hash>
199 template<
class TRef,
class TableRef>
210 template<
class T,
class Key,
class Hash>
211 template<
class TRef,
class TableRef>
222 template<
class T,
class Key,
class Hash>
223 template<
class TRef,
class TableRef>
227 return hashTable_.objects_[hashIndex_][elemIndex_];
231 template<
class T,
class Key,
class Hash>
232 template<
class TRef,
class TableRef>
240 template<
class T,
class Key,
class Hash>
241 template<
class TRef,
class TableRef>
258 hashIndex_ = -(hashIndex_+1) - 1;
265 if (elemIndex_ < hashTable_.objects_[hashIndex_].size())
276 ++hashIndex_ < hashTable_.objects_.size()
277 && !hashTable_.objects_[hashIndex_].size()
282 if (hashIndex_ >= hashTable_.objects_.size())
285 hashIndex_ = hashTable_.keys_.size();
292 template<
class T,
class Key,
class Hash>
293 template<
class TRef,
class TableRef>
315 template<
class T,
class Key,
class Hash>
316 template<
class TRef,
class TableRef>
320 return hashTable_.keys_[hashIndex_][elemIndex_];
324 template<
class T,
class Key,
class Hash>
331 if (keys_[hashIdx].size())
340 Info<<
"ListHashTable is empty\n";
348 template<
class T,
class Key,
class Hash>
356 template<
class T,
class Key,
class Hash>
363 if (keys_[hashIdx].size())
372 Info<<
"ListHashTable is empty\n";
380 template<
class T,
class Key,
class Hash>
388 template<
class T,
class Key,
class Hash>
392 return this->cbegin();
396 template<
class T,
class Key,
class Hash>
T & operator[](const Key &)
Find and return an hashed entry.
tmp< fvMatrix< Type > > operator*(const volScalarField::Internal &, const fvMatrix< Type > &)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool empty() const
Return true if the hash table is empty.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const iterator & end()
Iterator set to beyond the end of the ListHashTable.
iterator begin()
Iterator set to the beginning of the ListHashTable.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
label size() const
Return number of elements in table.
STL conforming hash table using contiguous lists rather than linked lists.
bool insert(const Key &key, const T &newElmt)
Insert a new hashed entry.
const const_iterator & cend() const
const_iterator set to beyond the end of the ListHashTable
const_iterator cbegin() const
const_iterator set to the beginning of the ListHashTable
A class for managing temporary objects.
T & operator()(const Key &)
Find and return an hashed entry, create it null if not present.