Go to the documentation of this file.
35 template<
class T,
class Key,
class Hash>
38 const HashPtrTable<T, Key, Hash>& rhs
41 parent_type(rhs.capacity())
43 for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
45 const Key&
k = iter.key();
46 const T* ptr = iter.val();
50 this->
set(k,
new T(*ptr));
54 this->
set(k,
nullptr);
60 template<
class T,
class Key,
class Hash>
63 HashPtrTable<T, Key, Hash>&& rhs
66 parent_type(std::move(rhs))
72 template<
class T,
class Key,
class Hash>
81 template<
class T,
class Key,
class Hash>
95 template<
class T,
class Key,
class Hash>
99 return this->release(iter);
103 template<
class T,
class Key,
class Hash>
117 template<
class T,
class Key,
class Hash>
121 return this->remove(iter);
125 template<
class T,
class Key,
class Hash>
143 template<
class T,
class Key,
class Hash>
147 return this->
erase(iter);
151 template<
class T,
class Key,
class Hash>
165 template<
class T,
class Key,
class Hash>
166 void Foam::HashPtrTable<T, Key, Hash>::operator=
178 for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
180 const Key&
k = iter.key();
181 const T* ptr = iter.val();
185 this->
set(k,
new T(*ptr));
189 this->
set(k,
nullptr);
195 template<
class T,
class Key,
class Hash>
198 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.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
autoPtr< T > release(iterator &iter)
Release ownership of the pointer and replace with a nullptr.
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
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