33 template<
class T,
class Key,
class Hash>
38 return Hash()(key) & (keys_.size() - 1);
44 template<
class T,
class Key,
class Hash>
51 template<
class T,
class Key,
class Hash>
58 template<
class T,
class Key,
class Hash>
65 return set(key, newEntry,
true);
69 template<
class T,
class Key,
class Hash>
76 return set(key, newEntry,
false);
80 template<
class T,
class Key,
class Hash>
90 template<
class T,
class Key,
class Hash>
106 template<
class T,
class Key,
class Hash>
125 template<
class T,
class Key,
class Hash>
144 template<
class T,
class Key,
class Hash>
145 template<
class TRef,
class TableRef>
154 hashIndex_(hashIndex),
155 elemIndex_(elemIndex)
159 template<
class T,
class Key,
class Hash>
160 template<
class TRef,
class TableRef>
166 hashTable_(iter.hashTable_),
167 hashIndex_(iter.hashIndex_),
168 elemIndex_(iter.elemIndex_)
172 template<
class T,
class Key,
class Hash>
173 template<
class TRef,
class TableRef>
180 this->hashIndex_ = iter.hashIndex_;
181 this->elemIndex_ = iter.elemIndex_;
185 template<
class T,
class Key,
class Hash>
186 template<
class TRef,
class TableRef>
193 return hashIndex_ == iter.hashIndex_ && elemIndex_ == iter.elemIndex_;
197 template<
class T,
class Key,
class Hash>
198 template<
class TRef,
class TableRef>
205 return hashIndex_ == iter.hashIndex_ && elemIndex_ == iter.elemIndex_;
209 template<
class T,
class Key,
class Hash>
210 template<
class TRef,
class TableRef>
221 template<
class T,
class Key,
class Hash>
222 template<
class TRef,
class TableRef>
233 template<
class T,
class Key,
class Hash>
234 template<
class TRef,
class TableRef>
238 return hashTable_.objects_[hashIndex_][elemIndex_];
242 template<
class T,
class Key,
class Hash>
243 template<
class TRef,
class TableRef>
251 template<
class T,
class Key,
class Hash>
252 template<
class TRef,
class TableRef>
269 hashIndex_ = -(hashIndex_+1) - 1;
276 if (elemIndex_ < hashTable_.objects_[hashIndex_].size())
287 ++hashIndex_ < hashTable_.objects_.size()
288 && !hashTable_.objects_[hashIndex_].size()
293 if (hashIndex_ >= hashTable_.objects_.size())
296 hashIndex_ = hashTable_.keys_.size();
303 template<
class T,
class Key,
class Hash>
304 template<
class TRef,
class TableRef>
326 template<
class T,
class Key,
class Hash>
327 template<
class TRef,
class TableRef>
331 return hashTable_.keys_[hashIndex_][elemIndex_];
335 template<
class T,
class Key,
class Hash>
342 if (keys_[hashIdx].size())
351 Info<<
"StaticHashTable is empty\n";
359 template<
class T,
class Key,
class Hash>
367 template<
class T,
class Key,
class Hash>
374 if (keys_[hashIdx].size())
383 Info<<
"StaticHashTable is empty\n";
391 template<
class T,
class Key,
class Hash>
399 template<
class T,
class Key,
class Hash>
403 return this->cbegin();
407 template<
class T,
class Key,
class Hash>
A simple container for copying or transferring objects of type <T>.
#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.
iterator begin()
Iterator set to the beginning of the StaticHashTable.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const_iterator cbegin() const
const_iterator set to the beginning of the StaticHashTable
Xfer< StaticHashTable< T, Key, Hash > > xfer()
Transfer contents to the Xfer container.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
tmp< fvMatrix< Type > > operator*(const volScalarField::Internal &, const fvMatrix< Type > &)
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
STL conforming hash table.
bool insert(const Key &key, const T &newElmt)
Insert a new hashed entry.
timeIndices insert(timeIndex, timeDirs[timeI].value())
const const_iterator & cend() const
const_iterator set to beyond the end of the StaticHashTable
T & operator[](const Key &)
Find and return an hashed entry.
T & operator()(const Key &)
Find and return an hashed entry, create it null if not present.
bool empty() const
Return true if the hash table is empty.
dimensionedScalar TRef("TRef", dimTemperature, laminarTransport)
label size() const
Return number of elements in table.
A class for managing temporary objects.
const iterator & end()
Iterator set to beyond the end of the StaticHashTable.