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>
396 template<
class T,
class Key,
class Hash>
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define forAll(list, i)
Loop across all elements in list.
STL conforming hash table using contiguous lists rather than linked lists.
T & operator[](const Key &)
Find and return an hashed entry.
bool insert(const Key &key, const T &newElmt)
Insert a new hashed entry.
const_iterator cbegin() const
const_iterator set to the beginning of the ListHashTable
friend Ostream & operator(Ostream &, const ListHashTable< T, Key, Hash > &)
Iterator< T &, ListHashTable< T, Key, Hash > & > iterator
const const_iterator & cend() const
const_iterator set to beyond the end of the ListHashTable
label size() const
Return number of elements in table.
const iterator & end()
Iterator set to beyond the end of the ListHashTable.
Iterator< const T &, const ListHashTable< T, Key, Hash > & > const_iterator
bool empty() const
Return true if the hash table is empty.
bool operator==(const ListHashTable< T, Key, Hash > &) const
Equality. Two hash tables are equal if all contents of first are.
iterator begin()
Iterator set to the beginning of the ListHashTable.
T & operator()(const Key &)
Find and return an hashed entry, create it null if not present.
A class for managing temporary objects.
#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.
tmp< fvMatrix< Type > > operator*(const volScalarField::Internal &, const fvMatrix< Type > &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)