30 template<
class IDLListType,
class T>
35 typename IDLListType::iterator iter = this->begin();
40 this->hashedTs_.insert((*iter).keyword(), &(*iter));
47 template<
class IDLListType,
class T>
54 template<
class IDLListType,
class T>
66 template<
class IDLListType,
class T>
72 IDLListType(move(dict)),
77 template<
class IDLListType,
class T>
91 template<
class IDLListType,
class T>
102 template<
class IDLListType,
class T>
105 return hashedTs_.found(keyword);
109 template<
class IDLListType,
class T>
117 if (iter != hashedTs_.end())
128 template<
class IDLListType,
class T>
133 if (iter != hashedTs_.end())
144 template<
class IDLListType,
class T>
149 if (iter == hashedTs_.end())
152 << keyword <<
" is undefined" 160 template<
class IDLListType,
class T>
165 if (iter == hashedTs_.end())
168 << keyword <<
" is undefined" 176 template<
class IDLListType,
class T>
184 typename IDLListType::const_iterator iter = this->begin();
189 keywords[i++] = iter().keyword();
196 template<
class IDLListType,
class T>
199 return hashedTs_.sortedToc();
203 template<
class IDLListType,
class T>
207 hashedTs_.insert(keyword, tPtr);
212 template<
class IDLListType,
class T>
216 hashedTs_.insert(keyword, tPtr);
217 IDLListType::append(tPtr);
221 template<
class IDLListType,
class T>
226 if (iter != hashedTs_.end())
228 T* tPtr = IDLListType::remove(iter());
229 hashedTs_.erase(iter);
239 template<
class IDLListType,
class T>
247 template<
class IDLListType,
class T>
253 IDLListType::transfer(dict);
260 template<
class IDLListType,
class T>
261 void Foam::DictionaryBase<IDLListType, T>::operator=
270 <<
"attempted assignment to self" 274 IDLListType::operator=(dict);
275 this->hashedTs_.clear();
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &) const
Search DictionaryBase for given keyword.
An STL-conforming const_iterator.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Reads the data description and data portions of a DictionaryBase File.
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.
const T * lookupPtr(const word &) const
Find and return an entry if present, otherwise return nullptr.
wordList toc() const
Return the table of contents.
void append(const word &, T *)
Add at tail of dictionary.
DictionaryBase(const label size=128)
Construct given initial table size.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
void insert(const word &, T *)
Add at head of dictionary.
An STL-conforming iterator.
A class for handling words, derived from string.
HashTable< T * > hashedTs_
HashTable of the entries held on the IDLListType for quick lookup.
void clear()
Clear the dictionary.
errorManip< error > abort(error &err)
T * remove(const word &)
Remove and return entry specified by keyword.
void transfer(DictionaryBase< IDLListType, T > &)
Transfer the contents of the argument into this DictionaryBase.
const T * lookup(const word &) const
Find and return entry.
A helper class when constructing from an Istream or dictionary.