54template<
class T>
class autoPtr;
55template<
class T,
class Key,
class Hash>
class HashPtrTable;
57template<
class T,
class Key,
class Hash>
65template<
class T,
class Key=word,
class Hash=Foam::Hash<Key>>
128 inline const T*
get(
const Key& key)
const;
166 bool erase(
const Key& key);
201 template<
class... Args>
202 inline bool emplace(
const Key& key, Args&&...
args);
206 template<
class... Args>
211 inline bool insert(
const Key&,
T*) =
delete;
226 inline bool insert(
const Key& key, std::unique_ptr<T>&& ptr);
229 inline bool set(
const Key& key,
T* ptr);
238 inline bool set(
const Key& key, std::unique_ptr<T>&& ptr);
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
const T * get(const Key &key) const
typename parent_type::iterator iterator
autoPtr< T > remove(iterator &iter)
Remove entry specified by given iterator.
void operator=(this_type &&rhs)
Move assignment.
bool insert(const Key &, T *)=delete
bool emplace_set(const Key &key, Args &&... args)
Emplace set an entry, overwriting any existing entries.
HashPtrTable()=default
Default construct with default table capacity.
bool erase(iterator &iter)
HashPtrTable(const this_type &rhs)
Copy construct, making a copy of each element.
HashPtrTable(this_type &&rhs)
Move construct.
HashPtrTable< T, Key, Hash > this_type
The template instance used for this table.
bool set(const Key &key, T *ptr)
Assign a new entry, overwriting existing entries.
typename parent_type::const_iterator const_iterator
void operator=(const this_type &rhs)
Copy assignment.
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
void clear()
Clear all entries from table and delete any allocated pointers.
autoPtr< T > release(iterator &iter)
Release ownership of the pointer and replace with a nullptr.
HashTable< T *, Key, Hash > parent_type
The template instance used for the parent HashTable.
~HashPtrTable()
Destructor.
Forward iterator with const access.
Forward iterator with non-const access.
A HashTable similar to std::unordered_map.
label size() const noexcept
The number of elements in table.
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)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Istream & operator>>(Istream &, directionInfo &)
Foam::argList args(argc, argv)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...