32template<
class T,
class Key,
class Hash>
41template<
class T,
class Key,
class Hash>
53template<
class T,
class Key,
class Hash>
54template<
class... Args>
64 !parent_type::found(key)
65 && this->parent_type::set(key,
new T(std::forward<Args>(
args)...))
70template<
class T,
class Key,
class Hash>
71template<
class... Args>
78 return this->set(key,
new T(std::forward<Args>(
args)...));
82template<
class T,
class Key,
class Hash>
89 if (parent_type::insert(key, ptr.
get()))
99template<
class T,
class Key,
class Hash>
106 if (parent_type::insert(key, ptr.get()))
116template<
class T,
class Key,
class Hash>
120 std::unique_ptr<T>&& ptr
123 if (parent_type::insert(key, ptr.get()))
133template<
class T,
class Key,
class Hash>
140 const T* old = this->get(key);
142 const bool ok = this->parent_type::set(key, ptr);
144 if (ok && old != ptr)
146 delete const_cast<T*
>(old);
153template<
class T,
class Key,
class Hash>
160 return this->set(key, ptr.
release());
164template<
class T,
class Key,
class Hash>
171 return this->set(key, ptr.release());
175template<
class T,
class Key,
class Hash>
179 std::unique_ptr<T>&& ptr
182 return this->set(key, ptr.release());
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.
typename parent_type::const_iterator const_iterator
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
A HashTable similar to std::unordered_map.
unsigned int get() const
Get value as unsigned, no range-checking.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T * get() noexcept
Return pointer to managed object without nullptr checking.
T * release() noexcept
Release ownership and return the pointer.
bool set() const
Are all the vector set.
Foam::argList args(argc, argv)