Go to the documentation of this file.
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>
93 iterator iter = find(key);
106 template<
class T,
class Key,
class Hash>
112 const_iterator iter = find(key);
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>
172 template<
class T,
class Key,
class Hash>
173 template<
class TRef,
class TableRef>
185 template<
class T,
class Key,
class Hash>
186 template<
class TRef,
class TableRef>
197 template<
class T,
class Key,
class Hash>
198 template<
class TRef,
class TableRef>
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>
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.
A class for managing temporary objects.
label elemIndex_
Index of current element at hashIndex.
dimensionedScalar TRef("TRef", dimTemperature, laminarTransport)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
List< List< Key > > keys_
The lookup keys, ordered per hash value.
TableRef hashTable_
Reference to the StaticHashTable this is an iterator for.
A simple container for copying or transferring objects of type <T>.
STL conforming hash table.
Hash function class for primitives. All non-primitives used to hash entries on hash tables likely nee...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const_iterator cbegin() const
const_iterator set to the beginning of the StaticHashTable
bool empty() const
Return true if the hash table is empty.
Xfer< StaticHashTable< T, Key, Hash > > xfer()
Transfer contents to the Xfer container.
bool set(const Key &, const T &newElmt, bool protect)
Assign a new hashed entry to a possibly already existing key.
Iterator< T &, StaticHashTable< T, Key, Hash > & > iterator
T & operator()(const Key &)
Find and return an hashed entry, create it null if not present.
label size() const
Return number of elements in table.
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
const iterator & end()
Iterator set to beyond the end of the StaticHashTable.
label hashIndex_
Current hash index.
Iterator< const T &, const StaticHashTable< T, Key, Hash > & > const_iterator
bool insert(const Key &key, const T &newElmt)
Insert a new hashed entry.
iterator begin()
Iterator set to the beginning of the StaticHashTable.
label hashKeyIndex(const Key &) const
Return the hash index of the Key within the current table size.
T & operator[](const Key &)
Find and return an hashed entry.
const const_iterator & cend() const
const_iterator set to beyond the end of the StaticHashTable
timeIndices insert(timeIndex, timeDirs[timeI].value())