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>
52 template<
class IDLListType,
class T>
64 template<
class IDLListType,
class T>
78 template<
class IDLListType,
class T>
89 template<
class IDLListType,
class T>
92 return hashedTs_.found(keyword);
96 template<
class IDLListType,
class T>
102 const auto iter = hashedTs_.cfind(keyword);
113 template<
class IDLListType,
class T>
116 auto iter = hashedTs_.find(keyword);
127 template<
class IDLListType,
class T>
130 const auto iter = hashedTs_.cfind(keyword);
135 <<
"'" << keyword <<
"' not found" 143 template<
class IDLListType,
class T>
146 auto iter = hashedTs_.find(keyword);
151 <<
"'" << keyword <<
"' not found" 159 template<
class IDLListType,
class T>
165 return hashedTs_.sortedToc();
169 template<
class IDLListType,
class T>
172 return hashedTs_.sortedToc();
176 template<
class IDLListType,
class T>
177 template<
class Compare>
183 return hashedTs_.sortedToc(comp);
187 template<
class IDLListType,
class T>
195 hashedTs_.insert(keyword, ptr);
196 IDLListType::push_front(ptr);
200 template<
class IDLListType,
class T>
208 hashedTs_.insert(keyword, ptr);
209 IDLListType::push_back(ptr);
213 template<
class IDLListType,
class T>
216 auto iter = hashedTs_.find(keyword);
220 T* ptr = IDLListType::remove(iter());
221 hashedTs_.erase(iter);
229 template<
class IDLListType,
class T>
237 template<
class IDLListType,
class T>
248 IDLListType::transfer(
dict);
249 hashedTs_.transfer(
dict.hashedTs_);
255 template<
class IDLListType,
class T>
266 IDLListType::operator=(
dict);
267 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.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
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.
DictionaryBase(const label size=128)
Construct with given or default (128) table capacity.
T * remove(const word &keyword)
Remove and return entry specified by keyword.
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.
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.
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.