34 template<
class T,
class Key,
class Hash>
41 template<
class T,
class Key,
class Hash>
53 template<
class T,
class Key,
class Hash>
57 const const_iterator iter(this->cfind(
key));
66 template<
class T,
class Key,
class Hash>
70 const const_iterator iter(this->cfind(
key));
79 template<
class T,
class Key,
class Hash>
80 template<
class... Args>
96 template<
class T,
class Key,
class Hash>
97 template<
class... Args>
104 return this->
set(
key,
new T(std::forward<Args>(
args)...));
108 template<
class T,
class Key,
class Hash>
112 std::unique_ptr<T>&& ptr
125 template<
class T,
class Key,
class Hash>
142 template<
class T,
class Key,
class Hash>
149 const T* old = this->
get(
key);
153 if (ok && old != ptr)
155 delete const_cast<T*
>(old);
162 template<
class T,
class Key,
class Hash>
166 std::unique_ptr<T>&& ptr
169 return this->
set(
key, ptr.release());
173 template<
class T,
class Key,
class Hash>
180 return this->
set(
key, ptr.release());
184 template<
class T,
class Key,
class Hash>
191 return this->
set(
key, ptr.
ptr());
195 template<
class T,
class Key,
class Hash>
202 return this->
set(
key, ptr.
ptr());
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 * get() noexcept
Return pointer without nullptr checking.
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
A HashTable similar to std::unordered_map.
HashPtrTable()=default
Default construct with default table capacity.
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
bool emplace_set(const Key &key, Args &&... args)
Emplace set an entry, overwriting any existing entries.
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)