34 template<
class T,
class Key,
class Hash>
47 template<
class T,
class Key,
class Hash>
51 const const_iterator iter(this->cfind(
key));
60 template<
class T,
class Key,
class Hash>
61 template<
class... Args>
71 !parent_type::contains(
key)
77 template<
class T,
class Key,
class Hash>
78 template<
class... Args>
90 iterator iter(this->
find(key));
95 if (overwrite || !ptr)
99 ptr =
new T(std::forward<Args>(
args)...);
105 ptr =
new T(std::forward<Args>(
args)...);
113 template<
class T,
class Key,
class Hash>
114 template<
class... Args>
122 return this->emplaceImpl(
true,
key, std::forward<Args>(
args)...);
126 template<
class T,
class Key,
class Hash>
127 template<
class... Args>
135 return this->emplaceImpl(
false,
key, std::forward<Args>(
args)...);
139 template<
class T,
class Key,
class Hash>
143 std::unique_ptr<T>&& ptr
156 template<
class T,
class Key,
class Hash>
173 template<
class T,
class Key,
class Hash>
181 iterator iter(this->
find(key));
184 if (iter.val() != ptr)
197 template<
class T,
class Key,
class Hash>
201 std::unique_ptr<T>&& ptr
204 return this->
set(
key, ptr.release());
208 template<
class T,
class Key,
class Hash>
215 return this->
set(
key, ptr.release());
219 template<
class T,
class Key,
class Hash>
226 return this->
set(
key, ptr.
ptr());
230 template<
class T,
class Key,
class Hash>
237 return this->
set(
key, ptr.
ptr());
T & try_emplace(const Key &key, Args &&... args)
Like emplace_set() but will not overwrite an occupied (non-null) location.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for managing references or pointers (no reference counting)
const T * test(const Key &key) const
Return const pointer associated with given entry or a nullptr if the key does not exist in the table...
T & emplace_set(const Key &key, Args &&... args)
Emplace set an entry, overwriting any existing entries.
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
typename parent_type::const_iterator const_iterator
const T * get(const Key &key) const
Return const pointer associated with given entry or a nullptr if the key does not exist in the table...
bool insert(const Key &, T *)=delete
No insert() with raw pointers (potential memory leaks). Use insert() with autoPtr or set() ...
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for managing temporary objects.
Foam::argList args(argc, argv)