Go to the documentation of this file.
35 const UPtrList<T>&
input
55 template<
class T,
class ListComparePredicate>
60 const ListComparePredicate& comp
81 template<
class T,
class Compare>
101 template<
class ReturnType,
class T,
class AccessOp>
104 const UPtrList<T>& list,
108 const label len = list.size();
110 List<ReturnType>
output(len);
113 for (label i = 0; i < len; ++i)
115 const T* ptr = list.get(i);
129 template<
class T,
class UnaryMatchPredicate>
132 const UPtrList<T>& list,
133 const UnaryMatchPredicate& matcher
138 const label len = list.size();
143 for (label i = 0; i < len; ++i)
145 const T* ptr = list.get(i);
149 if (matcher(ptr->name()))
165 const UPtrList<T>& list
172 template<
class T,
class UnaryMatchPredicate>
175 const UPtrList<T>& list,
176 const UnaryMatchPredicate& matcher
179 const label len = list.size();
181 for (label i = 0; i < len; ++i)
183 const T* ptr = list.get(i);
185 if (
bool(ptr) && matcher(ptr->name()))
195 template<
class T,
class UnaryMatchPredicate>
198 const UPtrList<T>& list,
199 const UnaryMatchPredicate& matcher
202 const label len = list.size();
207 for (label i = 0; i < len; ++i)
209 const T* ptr = list.get(i);
211 if (
bool(ptr) && matcher(ptr->name()))
List< label > labelList
A List of labels.
label size() const noexcept
The number of elements in the list.
static Ostream & output(Ostream &os, const IntRange< T > &range)
labelList findMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Extract list indices for all items with 'name()' that matches.
Functions to operate on Pointer Lists.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
A UPtrList compare binary predicate for normal sort.
void stableSort(UList< T > &a)
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void sortOrder(const labelUList &order, const bool testNull=true)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void shuffle(UList< T > &a)
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.
static Istream & input(Istream &is, IntRange< T > &range)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)