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>
80 template<
class IDLListType,
class T>
91 template<
class IDLListType,
class T>
94 return hashedTs_.found(keyword);
98 template<
class IDLListType,
class T>
106 if (iter != hashedTs_.end())
117 template<
class IDLListType,
class T>
122 if (iter != hashedTs_.end())
133 template<
class IDLListType,
class T>
138 if (iter == hashedTs_.end())
141 << keyword <<
" is undefined" 149 template<
class IDLListType,
class T>
154 if (iter == hashedTs_.end())
157 << keyword <<
" is undefined" 165 template<
class IDLListType,
class T>
173 typename IDLListType::const_iterator iter = this->begin();
178 keywords[i++] = iter().keyword();
185 template<
class IDLListType,
class T>
188 return hashedTs_.sortedToc();
192 template<
class IDLListType,
class T>
196 hashedTs_.insert(keyword, tPtr);
201 template<
class IDLListType,
class T>
205 hashedTs_.insert(keyword, tPtr);
210 template<
class IDLListType,
class T>
215 if (iter != hashedTs_.end())
217 T* tPtr = IDLListType::remove(iter());
218 hashedTs_.erase(iter);
228 template<
class IDLListType,
class T>
236 template<
class IDLListType,
class T>
242 IDLListType::transfer(dict);
249 template<
class IDLListType,
class T>
250 void Foam::DictionaryBase<IDLListType, T>::operator=
259 <<
"attempted assignment to self" 263 IDLListType::operator=(dict);
264 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 word &, T *)
Add at head of dictionary.
An STL-conforming iterator.
A class for handling words, derived from string.
timeIndices insert(timeIndex, timeDirs[timeI].value())
HashTable< T * > hashedTs_
HashTable of the entries held on the IDLListType for quick lookup.
void clear()
Clear the dictionary.
errorManip< error > abort(error &err)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
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.