33template<
class IDLListType,
class T>
36 for (
auto iter = this->begin(); iter != this->end(); ++iter)
38 this->
hashedTs_.insert((*iter).keyword(), &(*iter));
45template<
class IDLListType,
class T>
48 const DictionaryBase&
dict
57template<
class IDLListType,
class T>
71template<
class IDLListType,
class T>
82template<
class IDLListType,
class T>
89template<
class IDLListType,
class T>
95 const auto iter = hashedTs_.cfind(keyword);
106template<
class IDLListType,
class T>
109 auto iter = hashedTs_.find(keyword);
120template<
class IDLListType,
class T>
123 const auto iter = hashedTs_.cfind(keyword);
128 <<
"'" << keyword <<
"' not found"
136template<
class IDLListType,
class T>
139 auto iter = hashedTs_.find(keyword);
144 <<
"'" << keyword <<
"' not found"
152template<
class IDLListType,
class T>
159 IDLListType::push_front(ptr);
165template<
class IDLListType,
class T>
174 IDLListType::push_back(ptr);
178template<
class IDLListType,
class T>
182 auto iter = hashedTs_.find(keyword);
186 ptr = IDLListType::remove(iter.val());
193template<
class IDLListType,
class T>
196 IDLListType::clear();
201template<
class IDLListType,
class T>
219template<
class IDLListType,
class T>
230 IDLListType::operator=(
dict);
231 this->hashedTs_.clear();
void addEntries()
Add the IDLListType entries into the HashTable.
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.
void push_front(const word &keyword, T *ptr)
Add to front of dictionary.
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_
HashTable of the entries held on the IDLListType for quick lookup.
T * remove(const word &keyword)
Remove and return entry specified by keyword.
void clear()
Clear the dictionary.
const T * cfind(const word &keyword) const
Find and return an entry, nullptr on failure.
friend Ostream & operator(Ostream &, const DictionaryBase< IDLListType, T > &)
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)....
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)