33 template<
class IDLListType,
class T>
36 for (
auto iter = this->
begin(); iter != this->
end(); ++iter)
38 this->hashedTs_.insert((*iter).keyword(), &(*iter));
45 template<
class IDLListType,
class T>
57 template<
class IDLListType,
class T>
71 template<
class IDLListType,
class T>
82 template<
class IDLListType,
class T>
85 return hashedTs_.contains(keyword);
89 template<
class IDLListType,
class T>
95 const auto iter = hashedTs_.cfind(keyword);
106 template<
class IDLListType,
class T>
109 auto iter = hashedTs_.find(keyword);
120 template<
class IDLListType,
class T>
123 const auto iter = hashedTs_.cfind(keyword);
128 <<
"'" << keyword <<
"' not found" 136 template<
class IDLListType,
class T>
139 auto iter = hashedTs_.find(keyword);
144 <<
"'" << keyword <<
"' not found" 152 template<
class IDLListType,
class T>
159 IDLListType::push_front(ptr);
161 hashedTs_.insert(keyword, ptr);
165 template<
class IDLListType,
class T>
173 hashedTs_.insert(keyword, ptr);
174 IDLListType::push_back(ptr);
178 template<
class IDLListType,
class T>
182 auto iter = hashedTs_.find(keyword);
186 ptr = IDLListType::remove(iter.val());
187 hashedTs_.erase(iter);
193 template<
class IDLListType,
class T>
201 template<
class IDLListType,
class T>
212 IDLListType::transfer(
dict);
213 hashedTs_.transfer(
dict.hashedTs_);
219 template<
class IDLListType,
class T>
230 IDLListType::operator=(
dict);
231 this->hashedTs_.clear();
errorManipArg< error, int > exit(error &err, const int errNo=1)
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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 transfer(DictionaryBase< IDLListType, T > &dict)
Transfer the contents of the argument into this DictionaryBase.
bool contains(const word &keyword) const
Search for given keyword.
T * remove(const word &keyword)
Remove and return entry specified by keyword.
DictionaryBase()=default
Default construct: empty without allocation (capacity=0).
A class for handling words, derived from Foam::string.
void clear()
Clear the dictionary.
void push_back(const word &keyword, T *ptr)
Add to back of dictionary.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
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.
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.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.