Go to the documentation of this file.
34 template<
class T,
class Key,
class Hash>
37 const HashPtrTable<T, Key, Hash>& rhs
40 parent_type(rhs.capacity())
42 for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
44 const Key&
k = iter.key();
45 const T* ptr = iter.val();
49 this->
set(k,
new T(*ptr));
53 this->
set(k,
nullptr);
59 template<
class T,
class Key,
class Hash>
62 HashPtrTable<T, Key, Hash>&& rhs
65 parent_type(std::move(rhs))
71 template<
class T,
class Key,
class Hash>
80 template<
class T,
class Key,
class Hash>
94 template<
class T,
class Key,
class Hash>
98 return this->remove(iter);
102 template<
class T,
class Key,
class Hash>
120 template<
class T,
class Key,
class Hash>
124 return this->
erase(iter);
128 template<
class T,
class Key,
class Hash>
142 template<
class T,
class Key,
class Hash>
143 void Foam::HashPtrTable<T, Key, Hash>::operator=
155 for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
157 const Key&
k = iter.key();
158 const T* ptr = iter.val();
162 this->
set(k,
new T(*ptr));
166 this->
set(k,
nullptr);
172 template<
class T,
class Key,
class Hash>
175 HashPtrTable<T, Key, Hash>&& rhs
bool erase(iterator &iter)
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
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()
Default construct 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>, with deallocation management of the pointers.
label k
Boltzmann constant.
typename parent_type::iterator iterator