41 #ifndef ListHashTable_H
42 #define ListHashTable_H
56 template<
class T>
class List;
57 template<
class T,
class Key,
class Hash>
class ListHashTable;
59 template<
class T,
class Key,
class Hash>
Istream&
operator>>
65 template<
class T,
class Key,
class Hash>
Ostream&
operator<<
104 template<
class T,
class Key=word,
class Hash=
string::hash>
125 inline label hashKeyIndex(
const Key&)
const;
128 bool set(
const Key&,
const T& newElmt,
bool protect);
136 template<
class TRef,
class TableRef>
194 inline bool empty()
const;
197 bool found(
const Key& key)
const;
217 bool insert(
const Key& key,
const T& newElmt);
220 inline bool set(
const Key&,
const T& newElmt);
226 bool erase(
const Key& key);
293 template<
class TRef,
class TableRef>
298 template<
class TRef2,
class TableRef2>
345 inline const Key&
key()
const;
375 friend Ostream& operator<< <T, Key, Hash>
402 #ifndef NoListHashTableC
Hash function class for primitives. All non-primitives used to hash entries on hash tables likely nee...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool operator!=(const iterator &) const
bool operator==(const iterator &) const
void operator=(const iterator &)
STL conforming hash table using contiguous lists rather than linked lists.
label size_type
The type that can represent the size of a ListHashTable.
T & operator[](const Key &)
Find and return an hashed entry.
List< Key > toc() const
Return the table of contents.
bool insert(const Key &key, const T &newElmt)
Insert a new hashed entry.
T value_type
Type of values the ListHashTable contains.
const_iterator cbegin() const
const_iterator set to the beginning of the ListHashTable
Iterator< T &, ListHashTable< T, Key, Hash > & > iterator
const const_iterator & cend() const
const_iterator set to beyond the end of the ListHashTable
void transfer(ListHashTable< T, Key, Hash > &)
Transfer the contents of the argument table into this table.
Ostream & printInfo(Ostream &) const
Print information.
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 found(const Key &key) const
Return true if hashed entry is found in table.
bool empty() const
Return true if the hash table is empty.
bool erase(const iterator &it)
Erase an hashed entry specified by given iterator.
void clearStorage()
Clear the table entries and the table itself.
ListHashTable(const label size=128)
Construct given initial table size.
bool operator!=(const ListHashTable< T, Key, Hash > &) const
The opposite of the equality operation.
bool operator==(const ListHashTable< T, Key, Hash > &) const
Equality. Two hash tables are equal if all contents of first are.
T & reference
Type that can be used for storing into ListHashTable::value_type.
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.
void clear()
Clear all entries from table.
void operator=(const ListHashTable< T, Key, Hash > &)
Assignment operator.
~ListHashTable()
Destructor.
void resize(const label newSize)
Resize the hash table for efficiency.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
const T & const_reference
Type that can be used for storing into constant.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Macro definitions for declaring ClassName(), NamespaceName(), etc.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A zero-sized end iterator.
iteratorEnd()
Construct null.
Template-invariant bits for ListHashTable.
ClassName("ListHashTable")
Define template name and debug.
static label canonicalSize(const label)
Return a canonical (power-of-two) size.
ListHashTableCore()
Construct null.