51 #ifndef Foam_DictionaryBase_H 52 #define Foam_DictionaryBase_H 64 template<
class IDLListType,
class T>
67 template<
class IDLListType,
class T>
68 Ostream& operator<<(Ostream&, const DictionaryBase<IDLListType, T>&);
75 template<
class IDLListType,
class T>
156 template<
class Compare>
173 T*
remove(
const word& keyword);
203 friend Ostream& operator<< <IDLListType, T>
206 const DictionaryBase<IDLListType, T>&
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
void addEntries()
Add the IDLListType entries into the HashTable.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void prepend(const word &k, T *ptr)
Add to front of dictionary.
void operator=(const DictionaryBase &)
Copy assignment.
void append(const word &k, T *ptr)
Add to back of dictionary.
label k
Boltzmann constant.
void transfer(DictionaryBase< IDLListType, T > &dict)
Transfer the contents of the argument into this DictionaryBase.
const T * operator[](const word &key) const
Find and return entry.
const T * lookupPtr(const word &k) const
Deprecated(2020-03) use cfind()
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
bool contains(const word &keyword) const
Search for given keyword.
DictionaryBase()=default
Default construct: empty without allocation (capacity=0).
A class for handling words, derived from Foam::string.
HashTable< T * > hashedTs_
HashTable of the entries held on the IDLListType for quick lookup.
void clear()
Clear the dictionary.
A HashTable similar to std::unordered_map.
void push_back(const word &keyword, T *ptr)
Add to back of dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void insert(const word &k, T *ptr)
Add to front of dictionary.
const T * lookup(const word &keyword) const
Find and return entry, FatalError on failure.
List< word > wordList
List of word.
const T * cfind(const word &keyword) const
Find and return an entry, nullptr on failure.
wordList sortedToc() const
The table of contents as a sorted list.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
A helper class when constructing from an Istream or dictionary.
bool found(const word &key) const
Same as contains()
bool addHashEntry(const word &key, T *ptr)
Add an entry to the HashTable.
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
void push_front(const word &keyword, T *ptr)
Add to front of dictionary.
wordList toc() const
The table of contents (as a sorted list)