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>
138 template<
class Compare>
152 T*
remove(
const word& keyword);
182 friend Ostream& operator<< <IDLListType, T>
185 const DictionaryBase<IDLListType, T>&
196 return this->
cfind(keyword);
204 return this->
find(keyword);
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void operator=(const DictionaryBase &)
Copy assignment.
wordList sortedToc() const
Return the table of contents as a sorted list.
wordList toc() const
Return the table of contents (as a sorted list)
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.
DictionaryBase(const label size=128)
Construct with given or default (128) table capacity.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
const T * lookupPtr(const word &keyword) const
Deprecated(2020-03) use cfind()
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 insert(const word &keyword, T *ptr)
Add to front of dictionary.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool found(const word &keyword) const
Search for given keyword.
const T * lookup(const word &keyword) const
Find and return entry, FatalError on failure.
const T * cfind(const word &keyword) const
Find and return an entry, nullptr on failure.
void prepend(const word &keyword, T *ptr)
Add to front of dictionary.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
void append(const word &keyword, T *ptr)
Add to back of dictionary.
A helper class when constructing from an Istream or dictionary.
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.