32 template<
class Type,
class Key,
class Hash>
39 template<
class Type,
class Key,
class Hash>
48 template<
class Type,
class Key,
class Hash>
55 template<
class Type,
class Key,
class Hash>
65 template<
class Type,
class Key,
class Hash>
74 template<
class Type,
class Key,
class Hash>
83 for (
label i = 0; i <
n; i ++)
87 if (map[hi].
first() == nullKey)
100 <<
"Hash list is full"
109 template<
class Type,
class Key,
class Hash>
116 const unsigned h =
Hash()(
k);
118 for (
label i = 0; i <
n; i ++)
124 return map[hi].second();
129 <<
"Hash list does not contain key \"" <<
k <<
"\""
132 return NullObjectRef<Type>();
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
HashList(const label size)
Construct given a size.
void resizeAndClear(const label newSize)
Resize and clear all elements.
label capacity() const
The size of the underlying list.
const Type & operator[](const Key &k) const
Retrieve from the hash list.
bool insert(const Key &k, const Type &t)
Insert into the hash list. Return true if the value was newly.
static const Key nullKey
Null key value for unset elements in the list.
void clear()
Clear all elements.
Hash function class for primitives. All non-primitives used to hash entries on hash tables likely nee...
void size(const label)
Override size to be inconsistent with allocated storage.
A 2-tuple for storing two objects of different types.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar h
Planck constant.
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.
labelList first(const UList< labelPair > &p)
triSurfaceToAgglom resize(surfacesMesh.size())