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 constructor. More... | |
DictionaryBase (DictionaryBase &&) | |
Move constructor. 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 nullptr. More... | |
T * | lookupPtr (const word &) |
Find and return an entry if present, otherwise return nullptr. 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.
Note: The IDLListType parameter should itself be a template but this confused gcc 2.95.2 so it has to be instantiated for T when an instantiation of DictionaryBase is requested
Definition at line 72 of file DictionaryBase.H.
DictionaryBase | ( | const label | size = 128 | ) |
Construct given initial table size.
Definition at line 48 of file DictionaryBase.C.
DictionaryBase | ( | const DictionaryBase< IDLListType, T > & | dict | ) |
Copy constructor.
Definition at line 55 of file DictionaryBase.C.
References DictionaryBase< IDLListType, T >::addEntries().
DictionaryBase | ( | DictionaryBase< IDLListType, T > && | dict | ) |
Move constructor.
Definition at line 67 of file DictionaryBase.C.
DictionaryBase | ( | Istream & | is, |
const INew & | iNew | ||
) |
Construct from Istream using given Istream constructor class.
Definition at line 79 of file DictionaryBase.C.
DictionaryBase | ( | Istream & | is | ) |
Construct from Istream using default Istream constructor class.
Definition at line 92 of file DictionaryBase.C.
|
protected |
Definition at line 31 of file DictionaryBase.C.
Referenced by DictionaryBase< IDLListType, T >::DictionaryBase().
bool found | ( | const word & | keyword | ) | const |
Search DictionaryBase for given keyword.
Definition at line 103 of file DictionaryBase.C.
Referenced by phaseInterface::oldNamePartsToName().
Find and return an entry if present, otherwise return nullptr.
Definition at line 110 of file DictionaryBase.C.
References HashTable< T, Key, Hash >::find().
Find and return an entry if present, otherwise return nullptr.
Definition at line 129 of file DictionaryBase.C.
Find and return entry.
Definition at line 145 of file DictionaryBase.C.
Referenced by DictionaryBase< IDLListType, T >::operator[]().
Find and return entry.
Definition at line 161 of file DictionaryBase.C.
References HashTableCore::end(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and HashTable< T, Key, Hash >::find().
Foam::wordList toc |
Return the table of contents.
Definition at line 177 of file DictionaryBase.C.
Referenced by preserveFaceZonesConstraint::add(), surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), preserveFaceZonesConstraint::apply(), meshRefinement::checkCoupledFaceZones(), multiSolidBodyMotionSolver::multiSolidBodyMotionSolver(), coordinateSystem::New(), cellTable::operator=(), and CellZoneInjection< CloudType >::topoChange().
Foam::wordList sortedToc |
Return the table of contents as a sorted list.
Definition at line 197 of file DictionaryBase.C.
Add at head of dictionary.
Definition at line 204 of file DictionaryBase.C.
References Foam::vtkWriteOps::insert().
Referenced by anisotropic< SolidThermophysicalTransportModel >::anisotropic(), fvConstraints::constrain(), and ZoneList< ZoneType, ZonesType, MeshType >::insert().
Add at tail of dictionary.
Definition at line 213 of file DictionaryBase.C.
Remove and return entry specified by keyword.
Return nullptr if the keyword was not found.
Definition at line 222 of file DictionaryBase.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::find(), and Foam::T().
void clear |
Clear the dictionary.
Definition at line 240 of file DictionaryBase.C.
References clear().
void transfer | ( | DictionaryBase< IDLListType, T > & | dict | ) |
Transfer the contents of the argument into this DictionaryBase.
and annul the argument.
Definition at line 248 of file DictionaryBase.C.
References dict.
void operator= | ( | const DictionaryBase< IDLListType, T > & | ) |
Definition at line 261 of file DictionaryBase.C.
References Foam::abort(), dict, Foam::FatalError, and FatalErrorInFunction.
Find and return entry.
Definition at line 162 of file DictionaryBase.H.
References DictionaryBase< IDLListType, T >::lookup().
Find and return entry.
Definition at line 168 of file DictionaryBase.H.
References DictionaryBase< IDLListType, T >::lookup().
|
friend |
HashTable of the entries held on the IDLListType for quick lookup.
Definition at line 81 of file DictionaryBase.H.