47 const label len = this->size();
50 for (label i=0; i < len; ++i)
71 const label len = this->size();
73 if (oldToNew.
size() != len)
76 <<
"Size of map (" << oldToNew.
size()
77 <<
") not equal to list size (" << len
78 <<
") for type " <<
typeid(
T).
name() <<
nl
84 for (label i=0; i<len; ++i)
86 const label newIdx = oldToNew[i];
88 if (newIdx < 0 || newIdx >= len)
91 <<
"Illegal index " << newIdx <<
nl
92 <<
"Valid indices are [0," << len <<
") for type "
100 <<
"reorder map is not unique; element " << newIdx
101 <<
" already used for type " <<
typeid(
T).
name()
104 newList[newIdx] = ptrs_[i];
113 ptrs_.transfer(newList);
120 const label len = this->size();
122 if (order.
size() != len)
125 <<
"Size of map (" << order.
size()
126 <<
") not equal to list size (" << len
127 <<
") for type " <<
typeid(
T).
name() <<
nl
134 for (label i=0; i<len; ++i)
136 const label oldIdx = order[i];
138 if (oldIdx < 0 || oldIdx >= len)
141 <<
"Illegal index " << oldIdx <<
nl
142 <<
"Valid indices are [0," << len <<
") for type "
150 <<
"order map is not unique; element " << oldIdx
151 <<
" already used for type " <<
typeid(
T).
name()
155 guard[oldIdx] = ptrs_[oldIdx];
156 newList[i] = ptrs_[oldIdx];
165 ptrs_.transfer(newList);
180template<
class T,
class Compare>
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
void checkNonNull() const
FatalError if any null exists in the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void size(const label n)
Older name for setAddressableSize.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
T ** begin_ptr() noexcept
Iterator to begin of raw pointers traversal (use with caution)
void reorder(const labelUList &oldToNew, const bool check=false)
constexpr UPtrList() noexcept
Default construct.
void sortOrder(const labelUList &order, const bool check=false)
T ** end_ptr() noexcept
Iterator beyond end of raw pointers traversal (use with caution)
label squeezeNull()
Squeeze out intermediate nullptr entries in the list of pointers.
Detail::PtrListDetail< T > ptrs_
The list of pointers.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
static void check(const int retVal, const char *what)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
void sort(UList< T > &list)
Sort the list.
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)