Go to the documentation of this file.
34 template<
class T,
class Key,
class Hash>
37 const HashPtrTable<T, Key, Hash>& ht
40 parent_type(ht.capacity())
42 for (const_iterator iter = ht.begin(); iter != ht.end(); ++iter)
44 const T* ptr = iter.val();
47 this->set(iter.key(),
new T(*ptr));
51 this->set(iter.key(),
nullptr);
57 template<
class T,
class Key,
class Hash>
60 HashPtrTable<T, Key, Hash>&& ht
63 parent_type(std::move(ht))
69 template<
class T,
class Key,
class Hash>
78 template<
class T,
class Key,
class Hash>
92 template<
class T,
class Key,
class Hash>
95 auto iter = this->
find(key);
96 return this->remove(iter);
100 template<
class T,
class Key,
class Hash>
122 template<
class T,
class Key,
class Hash>
125 auto iter = this->
find(key);
126 return this->
erase(iter);
130 template<
class T,
class Key,
class Hash>
144 template<
class T,
class Key,
class Hash>
145 void Foam::HashPtrTable<T, Key, Hash>::operator=
157 for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
159 const T* ptr = iter.val();
162 this->set(iter.key(),
new T(*ptr));
166 this->set(iter.key(),
nullptr);
172 template<
class T,
class Key,
class Hash>
175 HashPtrTable<T, Key, Hash>&& rhs
bool erase(iterator &iter)
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
autoPtr< T > remove(iterator &iter)
Remove entry specified by given iterator.
~HashPtrTable()
Destructor.
void clear()
Clear all entries from table and delete any allocated pointers.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
HashPtrTable()
Construct null with default table capacity.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A HashTable of pointers to objects of type <T>.
typename parent_type::iterator iterator