41#ifndef Foam_PtrListDictionary_H
42#define Foam_PtrListDictionary_H
106 <<
"Cannot insert '" << key <<
"' into hash-table"
113 autoPtr<T>
set(
const label i,
const word& key, autoPtr<T>& ptr)
115 return this->
set(i, key, ptr.release());
119 autoPtr<T>
set(
const label i,
const word& key, tmp<T>& ptr)
121 return this->
set(i, key, ptr.ptr());
const T * lookup(const word &keyword) const
bool addHashEntry(const word &key, T *ptr)
Add an entry to the HashTable.
friend Ostream & operator(Ostream &, const DictionaryBase< PtrList< T >, T > &)
A helper class when constructing from an Istream or dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Template dictionary class which manages the storage associated with it.
PtrListDictionary()=default
Default construct: empty without allocation (capacity=0).
PtrListDictionary(const label len)
Construct given initial list size.
autoPtr< T > set(const label i, const word &key, T *ptr)
Set element to pointer provided and return old element.
PtrListDictionary(Istream &is)
Construct from Istream.
T & operator[](const word &key)
Find and return entry.
PtrListDictionary(const PtrListDictionary &dict)=default
Copy construct.
autoPtr< T > set(const label i, const word &key, tmp< T > &ptr)
Set element to tmp value provided and return old element.
DictionaryBase< PtrList< T >, T > dict_type
The template instance used for the dictionary content.
autoPtr< T > set(const label i, const word &key, autoPtr< T > &ptr)
Set element to autoPtr value provided and return old element.
const T & operator[](const word &key) const
Find and return entry.
PtrListDictionary(Istream &is, const INew &inew)
Construct from Istream using given Istream constructor class.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void resize(const label newLen)
Adjust size of PtrList.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T * release() noexcept
Release ownership and return the pointer.
A class for managing temporary objects.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)