51#ifndef Foam_DictionaryBase_H
52#define Foam_DictionaryBase_H
64template<
class IDLListType,
class T>
67template<
class IDLListType,
class T>
75template<
class IDLListType,
class T>
156 template<
class Compare>
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
void prepend(const word &k, T *ptr)
Add to front of dictionary.
T * operator[](const word &key)
Find and return entry.
void addEntries()
Add the IDLListType entries into the HashTable.
void append(const word &k, T *ptr)
Add to back of dictionary.
bool contains(const word &keyword) const
Search for given keyword.
DictionaryBase()=default
Default construct: empty without allocation (capacity=0).
void transfer(DictionaryBase< IDLListType, T > &dict)
Transfer the contents of the argument into this DictionaryBase.
const T * lookup(const word &keyword) const
Find and return entry, FatalError on failure.
wordList toc() const
The table of contents (as a sorted list).
void push_front(const word &keyword, T *ptr)
Add to front of dictionary.
wordList sortedToc() const
The table of contents as a sorted list.
const T * lookupPtr(const word &k) const
DictionaryBase(const DictionaryBase &dict)
Copy construct.
void insert(const word &k, T *ptr)
Add to front of dictionary.
void operator=(const DictionaryBase &)
Copy assignment.
void push_back(const word &keyword, T *ptr)
Add to back of dictionary.
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
HashTable< T * > hashedTs_
bool addHashEntry(const word &key, T *ptr)
Add an entry to the HashTable.
T * remove(const word &keyword)
Remove and return entry specified by keyword.
wordList sortedToc(const Compare &comp) const
The table of contents sorted using the specified comparator.
DictionaryBase(const label initialCapacity)
Construct empty with initial table capacity.
DictionaryBase(Istream &is, const INew &inew)
Construct from Istream using given Istream constructor class.
void clear()
Clear the dictionary.
bool found(const word &key) const
Same as contains().
const T * cfind(const word &keyword) const
Find and return an entry, nullptr on failure.
const T * operator[](const word &key) const
Find and return entry.
T * lookup(const word &keyword)
Find and return entry, FatalError on failure.
friend Ostream & operator(Ostream &, const DictionaryBase< IDLListType, T > &)
DictionaryBase(Istream &is)
Construct from Istream using default Istream constructor class.
A HashTable similar to std::unordered_map.
A helper class when constructing from an Istream or dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class for handling words, derived from Foam::string.
List< word > wordList
List of word.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
nonInt insert("surfaceSum(((S|magSf)*S)")
#define FOAM_DEPRECATED_FOR(since, replacement)