Go to the documentation of this file.
39 lookup_(std::move(list.lookup_))
73 template<
class AnyType,
class AnyHash>
84 for (
auto iter = tbl.
cbegin(); iter != tbl.
cend(); ++iter)
86 list[
count++] = iter.key();
111 if (lookup_.insert(
name, size()) || !unique)
121 const label lenList = wordList::size();
122 const label lenHash = lookup_.size();
124 if ((lenList < lenHash) || (lenList && !lenHash))
154 wordList::swap(
static_cast<wordList&
>(list));
155 lookup_.swap(list.lookup_);
162 lookup_.transfer(list.lookup_);
195 inline const Foam::word& Foam::hashedWordList::operator[]
200 return wordList::operator[](index);
206 return lookup_.lookup(
name, -1);
212 return lookup_.found(
name);
240 lookup_ = std::move(list.lookup_);
label size() const noexcept
The number of elements in table.
A class for handling words, derived from Foam::string.
bool operator()(const word &name) const
Check hashed values for the specified name - same as found.
void append(const word &name, bool unique=false)
const_iterator cbegin() const
const_iterator set to the beginning of the HashTable
const word & operator[](const label index) const
Return name corresponding to specified index.
void sort()
Sort the list and rehash the indices.
void append(const word &val)
Append an element at the end of the list.
Istream & operator>>(Istream &, directionInfo &)
const const_iterator & cend() const
const_iterator to signal the end for any HashTable
List< word > wordList
A List of words.
hashedWordList()=default
Construct an empty 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.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
bool found(const word &name) const
Search hashed values for the specified name.
void transfer(List< word > &list)
void operator=(const UList< word > &a)
Assignment to UList operator. Takes linear time.
void operator=(const hashedWordList &list)
Copy assignment. Rehashes the indices.
A HashTable similar to std::unordered_map.
const HashTable< label > & lookup() const
Return the hash of words/indices for inspection.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
void swap(hashedWordList &list)
Swap contents.
void transfer(hashedWordList &list)
void clear()
Clear the list, i.e. set size to zero.
void rehash() const
Rebuild the lookup hash indices.