Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it holds. More...
Public Member Functions | |
DictionaryBase (const label size=128) | |
Construct given initial table size. More... | |
DictionaryBase (const DictionaryBase &) | |
Copy construct. More... | |
template<class INew > | |
DictionaryBase (Istream &, const INew &) | |
Construct from Istream using given Istream constructor class. More... | |
DictionaryBase (Istream &) | |
Construct from Istream using default Istream constructor class. More... | |
bool | found (const word &) const |
Search DictionaryBase for given keyword. More... | |
const T * | lookupPtr (const word &) const |
Find and return an entry if present, otherwise return NULL. More... | |
T * | lookupPtr (const word &) |
Find and return an entry if present, otherwise return NULL. More... | |
const T * | lookup (const word &) const |
Find and return entry. More... | |
T * | lookup (const word &) |
Find and return entry. More... | |
wordList | toc () const |
Return the table of contents. More... | |
wordList | sortedToc () const |
Return the table of contents as a sorted list. More... | |
void | insert (const word &, T *) |
Add at head of dictionary. More... | |
void | append (const word &, T *) |
Add at tail of dictionary. More... | |
T * | remove (const word &) |
Remove and return entry specified by keyword. More... | |
void | clear () |
Clear the dictionary. More... | |
void | transfer (DictionaryBase< IDLListType, T > &) |
Transfer the contents of the argument into this DictionaryBase. More... | |
void | operator= (const DictionaryBase &) |
const T * | operator[] (const word &key) const |
Find and return entry. More... | |
T * | operator[] (const word &key) |
Find and return entry. More... | |
Protected Member Functions | |
void | addEntries () |
Protected Attributes | |
HashTable< T * > | hashedTs_ |
HashTable of the entries held on the IDLListType for quick lookup. More... | |
Friends | |
Ostream & | operator (Ostream &, const DictionaryBase< IDLListType, T > &) |
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it holds.
The double templating allows for the instantiation of forms with or without storage management.
Definition at line 61 of file DictionaryBase.H.
DictionaryBase | ( | const label | size = 128 | ) |
Construct given initial table size.
Definition at line 48 of file DictionaryBase.C.
Referenced by DictionaryBase< IDLListType, T >::DictionaryBase().
DictionaryBase | ( | const DictionaryBase< IDLListType, T > & | dict | ) |
Copy construct.
Definition at line 56 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::addEntries(), and DictionaryBase< IDLListType, T >::DictionaryBase().
DictionaryBase | ( | Istream & | is, |
const INew & | iNew | ||
) |
Construct from Istream using given Istream constructor class.
Definition at line 69 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::addEntries().
DictionaryBase | ( | Istream & | is | ) |
Construct from Istream using default Istream constructor class.
Definition at line 81 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::addEntries().
|
protected |
Definition at line 31 of file DictionaryBase.C.
Referenced by DictionaryBase< IDLListType, T >::DictionaryBase(), and DictionaryBase< IDLListType, T >::operator=().
bool found | ( | const word & | keyword | ) | const |
Search DictionaryBase for given keyword.
Definition at line 92 of file DictionaryBase.C.
References HashTable< T, Key, Hash >::found(), DictionaryBase< IDLListType, T >::hashedTs_, DictionaryBase< IDLListType, T >::lookupPtr(), and Foam::T().
Find and return an entry if present, otherwise return NULL.
Definition at line 100 of file DictionaryBase.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.
Referenced by Foam::debug::addDebugObject(), Foam::debug::addDimensionedConstantObject(), Foam::debug::addDimensionSetObject(), Foam::debug::addInfoObject(), Foam::debug::addOptimisationObject(), DictionaryBase< IDLListType, T >::found(), and Time::readDict().
Find and return an entry if present, otherwise return NULL.
Definition at line 118 of file DictionaryBase.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.
Find and return entry.
Definition at line 134 of file DictionaryBase.C.
References HashTableCore::end(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.
Referenced by DictionaryBase< DLPtrList< T >, T >::operator[]().
Find and return entry.
Definition at line 150 of file DictionaryBase.C.
References HashTableCore::end(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.
Foam::wordList toc | ( | ) | const |
Return the table of contents.
Definition at line 166 of file DictionaryBase.C.
Foam::wordList sortedToc | ( | ) | const |
Return the table of contents as a sorted list.
Definition at line 186 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::hashedTs_, and HashTable< T, Key, Hash >::sortedToc().
Add at head of dictionary.
Definition at line 193 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::hashedTs_, insert(), and HashTable< T, Key, Hash >::insert().
Add at tail of dictionary.
Definition at line 202 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::hashedTs_, and HashTable< T, Key, Hash >::insert().
Referenced by Foam::debug::addDebugObject(), Foam::debug::addDimensionedConstantObject(), Foam::debug::addDimensionSetObject(), Foam::debug::addInfoObject(), and Foam::debug::addOptimisationObject().
Remove and return entry specified by keyword.
Return NULL if the keyword was not found.
Definition at line 211 of file DictionaryBase.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::erase(), HashTable< T, Key, Hash >::find(), DictionaryBase< IDLListType, T >::hashedTs_, and Foam::T().
void clear | ( | ) |
Clear the dictionary.
Definition at line 229 of file DictionaryBase.C.
References clear(), HashTable< T, Key, Hash >::clear(), DictionaryBase< IDLListType, T >::hashedTs_, and DictionaryBase< IDLListType, T >::transfer().
void transfer | ( | DictionaryBase< IDLListType, T > & | dict | ) |
Transfer the contents of the argument into this DictionaryBase.
and annul the argument.
Definition at line 238 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::hashedTs_, and HashTable< T, Key, Hash >::transfer().
Referenced by DictionaryBase< IDLListType, T >::clear().
void operator= | ( | const DictionaryBase< IDLListType, T > & | ) |
Definition at line 251 of file DictionaryBase.C.
References Foam::abort(), DictionaryBase< IDLListType, T >::addEntries(), HashTable< T, Key, Hash >::clear(), Foam::FatalError, FatalErrorInFunction, and DictionaryBase< IDLListType, T >::hashedTs_.
Find and return entry.
Definition at line 159 of file DictionaryBase.H.
Find and return entry.
Definition at line 165 of file DictionaryBase.H.
|
friend |
HashTable of the entries held on the IDLListType for quick lookup.
Definition at line 81 of file DictionaryBase.H.
Referenced by DictionaryBase< IDLListType, T >::append(), DictionaryBase< IDLListType, T >::clear(), DictionaryBase< IDLListType, T >::found(), DictionaryBase< IDLListType, T >::insert(), DictionaryBase< IDLListType, T >::lookup(), DictionaryBase< IDLListType, T >::lookupPtr(), DictionaryBase< IDLListType, T >::operator=(), DictionaryBase< IDLListType, T >::remove(), DictionaryBase< IDLListType, T >::sortedToc(), and DictionaryBase< IDLListType, T >::transfer().