Foam::PtrListOps Namespace Reference

Various utility functions to operate on Pointer Lists. More...

Functions

template<class ReturnType , class T , class AccessOp >
List< ReturnType > get (const UPtrList< T > &list, const AccessOp &aop)
 
template<class T , class UnaryMatchPredicate >
List< wordnames (const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
 
template<class T >
List< wordnames (const UPtrList< T > &list)
 
template<class T , class UnaryMatchPredicate >
label firstMatching (const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
 Find first list item with 'name()' that matches, -1 on failure. More...
 
template<class T , class UnaryMatchPredicate >
labelList findMatching (const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
 Extract list indices for all items with 'name()' that matches. More...
 

Detailed Description

Various utility functions to operate on Pointer Lists.

Source files

Function Documentation

◆ get()

List< ReturnType > get ( const UPtrList< T > &  list,
const AccessOp &  aop 
)

List of values generated by applying the access operation to each list item.

For example,

dynamicFvMesh & mesh
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Extract name (as a word) from an object, typically using its name() method.
Definition: word.H:238

◆ names() [1/2]

List< word > names ( const UPtrList< T > &  list,
const UnaryMatchPredicate &  matcher 
)

List of names generated by calling name() for each list item and filtered for matches

For example,

wordRes matches(...);
PtrListOps::names(mesh.boundaryMesh(), matches);
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Unary and binary predicates that always return true, useful for templating.
Definition: predicates.H:56

Referenced by faFieldDecomposer::fieldsCache::privateCache::decompose(), fvFieldDecomposer::fieldsCache::privateCache::decompose(), pointFieldDecomposer::fieldsCache::privateCache::decompose(), and coordinateSystems::names().

Here is the caller graph for this function:

◆ names() [2/2]

List< word > names ( const UPtrList< T > &  list)

List of names generated by calling name() for each list item no filtering (ie, predicates::always)

◆ firstMatching()

label firstMatching ( const UPtrList< T > &  list,
const UnaryMatchPredicate &  matcher 
)

Find first list item with 'name()' that matches, -1 on failure.

Referenced by coordinateSystems::cfind(), faBoundaryMesh::findIndex(), polyBoundaryMesh::findIndex(), coordinateSystems::findIndex(), faBoundaryMesh::findPatchID(), polyBoundaryMesh::findPatchID(), faBoundaryMesh::indices(), and polyBoundaryMesh::indices().

Here is the caller graph for this function:

◆ findMatching()

labelList findMatching ( const UPtrList< T > &  list,
const UnaryMatchPredicate &  matcher 
)

Extract list indices for all items with 'name()' that matches.

Referenced by coordinateSystems::indices(), faBoundaryMesh::indices(), and polyBoundaryMesh::indices().

Here is the caller graph for this function: