A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscript bounds checking, etc. More...
Classes | |
struct | greater |
A list compare binary predicate for reverse sort. More... | |
struct | Hash |
Hashing function class for UList. More... | |
struct | less |
A list compare binary predicate for normal sort. More... | |
Public Types | |
typedef T | value_type |
The value type the list contains. More... | |
typedef T * | pointer |
The pointer type for non-const access to value_type items. More... | |
typedef T & | reference |
The type used for storing into value_type objects. More... | |
typedef T * | iterator |
Random access iterator for traversing a UList. More... | |
typedef label | size_type |
The type to represent the size of a UList. More... | |
typedef label | difference_type |
The difference between iterator objects. More... | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Reverse iterator (non-const access) More... | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Reverse iterator (const access) More... | |
Public Member Functions | |
UList (const UList< T > &)=default | |
Copy construct. More... | |
constexpr | UList () noexcept |
Default construct, zero-sized and nullptr. More... | |
UList (T *__restrict__ v, label size) noexcept | |
Construct from components. More... | |
label | fcIndex (const label i) const |
const T & | fcValue (const label i) const |
Return forward circular value (ie, next value in the list) More... | |
T & | fcValue (const label i) |
Return forward circular value (ie, next value in the list) More... | |
label | rcIndex (const label i) const |
const T & | rcValue (const label i) const |
Return reverse circular value (ie, previous value in the list) More... | |
T & | rcValue (const label i) |
Return reverse circular value (ie, previous value in the list) More... | |
std::streamsize | byteSize () const |
const T * | cdata () const |
Return a const pointer to the first data element. More... | |
T * | data () |
Return a pointer to the first data element. More... | |
T & | first () |
Return the first element of the list. More... | |
const T & | first () const |
Return first element of the list. More... | |
T & | last () |
Return the last element of the list. More... | |
const T & | last () const |
Return the last element of the list. More... | |
void | checkStart (const label start) const |
Check start is within valid range [0,size) More... | |
void | checkSize (const label size) const |
Check size is within valid range [0,size]. More... | |
void | checkIndex (const label i) const |
Check index is within valid range [0,size) More... | |
bool | uniform () const |
True if all entries have identical values, and list is non-empty. More... | |
label | find (const T &val, label pos=0) const |
Find index of the first occurrence of the value. More... | |
label | rfind (const T &val, label pos=-1) const |
Find index of the last occurrence of the value. More... | |
bool | found (const T &val, label pos=0) const |
True if the value if found in the list. More... | |
void | moveFirst (const label i) |
Move element to the first position. More... | |
void | moveLast (const label i) |
Move element to the last position. More... | |
void | swapFirst (const label i) |
Swap element with the first element. Fatal on an empty list. More... | |
void | swapLast (const label i) |
Swap element with the last element. Fatal on an empty list. More... | |
void | shallowCopy (const UList< T > &list) |
Copy the pointer held by the given UList. More... | |
void | deepCopy (const UList< T > &list) |
Copy elements of the given UList. More... | |
T & | operator[] (const label i) |
Return element of UList. More... | |
const T & | operator[] (const label i) const |
Return element of constant UList. More... | |
UList< T > | operator[] (const labelRange &range) |
Return (start,size) subset from UList with non-const access. More... | |
const UList< T > | operator[] (const labelRange &range) const |
Return (start,size) subset from UList with const access. More... | |
operator const Foam::List< T > & () const | |
Allow cast to a const List<T>&. More... | |
void | operator= (const T &val) |
Assignment of all entries to the given value. More... | |
void | operator= (const zero) |
Assignment of all entries to zero. More... | |
iterator | begin () |
Return an iterator to begin traversing the UList. More... | |
iterator | end () |
Return an iterator to end traversing the UList. More... | |
const_iterator | cbegin () const |
Return const_iterator to begin traversing the constant UList. More... | |
const_iterator | cend () const |
Return const_iterator to end traversing the constant UList. More... | |
const_iterator | begin () const |
Return const_iterator to begin traversing the constant UList. More... | |
const_iterator | end () const |
Return const_iterator to end traversing the constant UList. More... | |
reverse_iterator | rbegin () |
Return reverse_iterator to begin reverse traversing the UList. More... | |
reverse_iterator | rend () |
Return reverse_iterator to end reverse traversing the UList. More... | |
const_reverse_iterator | crbegin () const |
Return const_reverse_iterator to begin reverse traversing the UList. More... | |
const_reverse_iterator | crend () const |
Return const_reverse_iterator to end reverse traversing the UList. More... | |
const_reverse_iterator | rbegin () const |
Return const_reverse_iterator to begin reverse traversing the UList. More... | |
const_reverse_iterator | rend () const |
Return const_reverse_iterator to end reverse traversing the UList. More... | |
label | size () const noexcept |
The number of elements in the UList. More... | |
bool | empty () const noexcept |
True if the UList is empty (ie, size() is zero) More... | |
void | swap (UList< T > &list) |
Swap content with another UList of the same type in constant time. More... | |
bool | operator== (const UList< T > &a) const |
Equality operation on ULists of the same type. More... | |
bool | operator!= (const UList< T > &a) const |
The opposite of the equality operation. Takes linear time. More... | |
bool | operator< (const UList< T > &list) const |
Compare two ULists lexicographically. Takes linear time. More... | |
bool | operator> (const UList< T > &a) const |
Compare two ULists lexicographically. Takes linear time. More... | |
bool | operator<= (const UList< T > &a) const |
Return true if !(a > b). Takes linear time. More... | |
bool | operator>= (const UList< T > &a) const |
Return true if !(a < b). Takes linear time. More... | |
void | writeEntry (const word &keyword, Ostream &os) const |
Write the List as a dictionary entry with keyword. More... | |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
Write List, with line-breaks in ASCII when length exceeds shortLen. More... | |
template<class TypeT = T> | |
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type | test (const label i) const |
A bitSet::test() method for a list of bool. More... | |
template<class TypeT = T> | |
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type | get (const label i) const |
A bitSet::get() method for a list of bool. More... | |
template<class TypeT = T> | |
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type | unset (const label i) |
A bitSet::unset() method for a list of bool. More... | |
template<> | |
const bool & | operator[] (const label i) const |
template<> | |
Foam::UPstream::commsStruct & | operator[] (const label procID) |
template<> | |
const Foam::UPstream::commsStruct & | operator[] (const label procID) const |
template<> | |
UPstream::commsStruct & | operator[] (const label) |
template<> | |
const UPstream::commsStruct & | operator[] (const label) const |
Static Public Member Functions | |
static const UList< T > & | null () |
Return a UList reference to a nullObject. More... | |
static constexpr label | max_size () noexcept |
The size of the largest possible UList. More... | |
Public Attributes | |
const typedef T * | const_pointer |
The pointer type for const access to value_type items. More... | |
const typedef T & | const_reference |
The type used for reading from constant value_type objects. More... | |
const typedef T * | const_iterator |
Random access iterator for traversing a UList. More... | |
Protected Member Functions | |
void | size (const label n) noexcept |
Override size to be inconsistent with allocated storage. More... | |
void | writeEntry (Ostream &os) const |
Write the UList with its compound type. More... | |
labelRange | validateRange (const labelRange &range) const |
UList< T > & | operator= (const UList< T > &)=delete |
No copy assignment (default: shallow copy) More... | |
Friends | |
class | List< T > |
Declare friendship with the List class. More... | |
class | SubList< T > |
Declare friendship with the SubList class. More... | |
Istream & | operator>> (Istream &os, UList< T > &list) |
Read List contents from Istream. More... | |
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscript bounds checking, etc.
Storage is not allocated during construction or use but is supplied to the constructor as an argument. This type of list is particularly useful for lists that refer to parts of existing lists such as SubList.
Definition at line 103 of file HashTable.H.
typedef T value_type |
typedef label size_type |
typedef label difference_type |
typedef std::reverse_iterator<iterator> reverse_iterator |
typedef std::reverse_iterator<const_iterator> const_reverse_iterator |
|
inlineconstexprnoexcept |
|
inlineprotectednoexcept |
Override size to be inconsistent with allocated storage.
Use with care
Definition at line 360 of file UListI.H.
Referenced by AABBTree< Type >::AABBTree(), dynamicOversetFvMesh::active(), fvMeshPrimitiveLduAddressing::addAddressing(), dynamicOversetFvMesh::addInterpolation(), fvMatrix< Type >::addToInternalField(), MeshedSurface< Foam::face >::addZones(), pairGAMGAgglomeration::agglomerate(), GAMGAgglomeration::agglomerateLduAddressing(), UPstream::allToAll(), List< substance >::append(), DynamicField< Foam::Vector >::append(), DynamicList< Foam::FixedList< scalar, 3 > >::append(), Foam::appendCsvLabels(), Field< Foam::Vector2D >::autoMap(), fvPatchField< vector >::autoMap(), bitSet::bitSet(), coupledPolyPatch::calcFaceTol(), GAMGAgglomeration::checkRestriction(), lduPrimitiveMesh::checkUpperTriangular(), ensightFaces::classify(), ORourkeCollision< CloudType >::collide(), GAMGAgglomeration::compactLevels(), Foam::containerSizes(), vtuAdaptor::convertField(), Keyed< T >::createList(), Matrix< RectangularMatrix< Type >, Type >::diag(), Foam::duplicateOrder(), edgeInterpolationScheme< scalar >::euclidianInterpolate(), Pstream::exchange(), functionObjectList::execute(), regionSizeDistribution::extractData(), FaceCellWave< Type, TrackingData >::FaceCellWave(), NASCore::faceDecomposition(), ABAQUSCore::faceDecomposition(), lduMatrix::faceH(), LduMatrix< Type, DType, LUType >::faceH(), Foam::vtk::Tools::Faces(), fft::fftRenumberRecurse(), FixedList< Type, 3 >::FixedList(), mapDistributeBase::flipAndCombine(), globalIndex::get(), coupledPolyPatch::getAnchorPoints(), Foam::ensightOutput::Detail::getFaceSizes(), Foam::ensightOutput::Detail::getPolysNFaces(), Foam::Im(), Foam::ImComplexField(), vtuAdaptor::internal(), cyclicACMIGAMGInterface::internalFieldTransfer(), cyclicAMIGAMGInterface::internalFieldTransfer(), edgeInterpolationScheme< scalar >::interpolate(), surfaceInterpolationScheme< GType >::interpolate(), AMIInterpolation::interpolateToSource(), AMIInterpolation::interpolateToTarget(), interpolationTable< scalar >::interpolateValues(), meshToMeshMethod::intersect(), meshToMeshMethod::interVol(), meshToMeshMethod::interVolAndCentroid(), Foam::inv(), lduPrimitiveMesh::lduPrimitiveMesh(), List< substance >::List(), coordinateSystem::manyTimesImpl(), Field< Foam::Vector2D >::map(), mapDistributeBase::mapDistributeBase(), wordRes::matching(), scalars::matching(), Foam::matchPoints(), MeshedSurface< Foam::face >::MeshedSurface(), LduMatrix< Type, DType, LUType >::negSumDiag(), lduMatrix::negSumDiag(), noiseFFT::octaves(), coordinateSystem::oneToOneImpl(), Hash< List< T > >::operator()(), UList< T >::Hash< HashT >::operator()(), Hash< UList< T > >::operator()(), Foam::operator<<(), BiIndirectList< T >::operator=(), List< substance >::operator=(), FixedList< Type, 3 >::operator=(), HashSet< Foam::string >::operator=(), PackedList< 2 >::PackedList(), vtuAdaptor::points(), Foam::vtk::Tools::Points(), Polynomial< 8 >::Polynomial(), seriesWriter::print(), FIRECore::putFireLabels(), Foam::Re(), hashedWordList::rehash(), Foam::ReImSum(), UnsortedMeshedSurface< Face >::remapFaces(), MeshedSurface< Foam::face >::remapFaces(), UPtrList< Foam::diameterModels::velocityGroup >::reorder(), Foam::reverse(), face::reverseFace(), SortList< T >::reverseSort(), sampledSurface::sampleOnFaces(), triSurfaceLoader::select(), removeCells::setRefinement(), CompactListList< T, Container >::setSize(), Foam::ListOps::setValue(), UnsortedMeshedSurface< Face >::setZones(), directFieldMapper::size(), directFvPatchFieldMapper::size(), directPointPatchFieldMapper::size(), distributedUnallocatedDirectFieldMapper::size(), distributedUnallocatedDirectFvPatchFieldMapper::size(), LLTMatrix< Type >::solve(), SortList< T >::sort(), Foam::sortedOrder(), UPtrList< Foam::diameterModels::velocityGroup >::sortOrder(), extendedEdgeMesh::sortPointsAndEdges(), Foam::stabilise(), fvMatrix< Type >::subtractFromInternalField(), Foam::sumCmptProd(), LduMatrix< Type, DType, LUType >::sumDiag(), lduMatrix::sumDiag(), LduMatrix< Type, DType, LUType >::sumMagOffDiag(), lduMatrix::sumMagOffDiag(), Foam::sumProd(), syncTools::swapBoundaryCellList(), syncTools::swapBoundaryCellPositions(), syncTools::syncBoundaryFaceList(), syncTools::syncPointList(), Foam::system(), meshRefinement::testSyncBoundaryFaceList(), fft::transform(), wordRes::uniq(), PackedList< 2 >::unpack(), Foam::unzip(), dynamicOversetFvMesh::updateAddressing(), topoBoolSet::updateLabels(), topoBitSet::updateLabels(), topoSet::updateLabels(), Foam::HashSetOps::used(), Foam::vtk::Tools::Vertices(), FLMAsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), ABAQUSsurfaceFormat< Face >::write(), dynamicOversetFvMesh::write(), STARCDsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), VTPsurfaceFormat< Face >::write(), OBJstream::write(), STARCDsurfaceFormatCore::writeCase(), VTKsurfaceFormatCore::writeCellData(), VTPsurfaceFormatCore::writeCellData(), lumpedPointMovement::writeData(), VTKedgeFormat::writeEdges(), lumpedPointMovement::writeForcesAndMomentsVTP(), VTPsurfaceFormatCore::writeHeader(), VTKsurfaceFormatCore::writeHeader(), AC3DsurfaceFormatCore::writeHeader(), UList< Foam::wordRe >::writeList(), coupledPolyPatch::writeOBJ(), Foam::meshTools::writeOBJ(), Foam::ensightOutput::writePolysPoints(), and Foam::zip().
|
protected |
Write the UList with its compound type.
Definition at line 38 of file UListIO.C.
Referenced by faceZone::writeDict().
|
protected |
No copy assignment (default: shallow copy)
Assignment may need to be shallow (copy pointer) or deep (copy elements) depending on context or type of list. Disallow default assignment and provide separate 'shallowCopy' and 'deepCopy' member functions.
Referenced by SortableList< T >::operator=().
|
inlinestatic |
Return a UList reference to a nullObject.
Definition at line 54 of file UListI.H.
Referenced by FieldMapper::directAddressing(), pointFieldReconstructor::pointPatchFieldReconstructor::directAddressing(), fvFieldReconstructor::fvPatchFieldReconstructor::directAddressing(), faFieldReconstructor::faPatchFieldReconstructor::directAddressing(), and starcdWriter::write().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::streamsize byteSize | ( | ) | const |
Return the binary size in number of characters of the UList if the element is a primitive type
i.e. is_contiguous<T>::value == true. Note that is of type streamsize since used in stream ops
Definition at line 191 of file UList.C.
Referenced by OFstreamCollator::write(), and UList< Foam::wordRe >::writeList().
|
inline |
Return a const pointer to the first data element.
Similar to the STL front() method and the string::data() method This can be used (with caution) when interfacing with C code
Definition at line 198 of file UListI.H.
Referenced by Hash< List< T > >::operator()(), UList< T >::Hash< HashT >::operator()(), Hash< UList< T > >::operator()(), OFstreamCollator::write(), and UList< Foam::wordRe >::writeList().
|
inline |
Return the first element of the list.
Definition at line 170 of file UListI.H.
Referenced by Foam::printTable().
|
inline |
|
inline |
Return the last element of the list.
Definition at line 184 of file UListI.H.
Referenced by globalIndex::gather().
|
inline |
|
inline |
Check start is within valid range [0,size)
Definition at line 103 of file UListI.H.
Referenced by SubList< T >::SubList().
|
inline |
Check size is within valid range [0,size].
Definition at line 116 of file UListI.H.
Referenced by SubList< T >::SubList().
|
inline |
True if all entries have identical values, and list is non-empty.
Definition at line 146 of file UListI.H.
Referenced by UList< Foam::wordRe >::writeList().
Foam::label find | ( | const T & | val, |
label | pos = 0 |
||
) | const |
Find index of the first occurrence of the value.
Any occurrences before the start pos are ignored. Linear search.
Definition at line 205 of file UList.C.
Referenced by wordRes::uniq().
Foam::label rfind | ( | const T & | val, |
label | pos = -1 |
||
) | const |
True if the value if found in the list.
Any occurrences before the start pos are ignored. Linear search.
Definition at line 212 of file UListI.H.
Referenced by findNearestMaskedOp< PatchType >::operator()(), and foundOp< StringType >::operator()().
void moveFirst | ( | const label | i | ) |
void moveLast | ( | const label | i | ) |
void swapFirst | ( | const label | i | ) |
void swapLast | ( | const label | i | ) |
Copy the pointer held by the given UList.
Definition at line 219 of file UListI.H.
Referenced by surfMesh::updateRefs().
Copy elements of the given UList.
Definition at line 105 of file UList.C.
Referenced by UPstream::allToAll().
|
inline |
|
inline |
Foam::UList< T > operator[] | ( | const labelRange & | range | ) |
const Foam::UList< T > operator[] | ( | const labelRange & | range | ) | const |
|
inline |
void operator= | ( | const T & | val | ) |
void operator= | ( | const | zero | ) |
|
inline |
Return an iterator to begin traversing the UList.
Definition at line 276 of file UListI.H.
Referenced by UPstream::allToAll(), bitSet::bitSet(), DICPreconditioner::calcReciprocalD(), DILUPreconditioner::calcReciprocalD(), Foam::ListListOps::combineOffset(), edge::erase(), objectRegistry::erase(), lduMatrix::H(), lduMatrix::H1(), Foam::ListOps::identity(), edge::insert(), HashSet< Foam::string >::insert(), UList< Foam::wordRe >::operator<(), HashSet< Foam::string >::operator=(), vtuSizing::renumberFaceLabelsXml(), vtuSizing::renumberVertLabelsLegacy(), bitSet::set(), Foam::shuffle(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), nonBlockingGaussSeidelSmoother::smooth(), Foam::sort(), Foam::stableSort(), fft::transform(), HashSet< Foam::string >::unset(), and bitSet::unset().
|
inline |
Return an iterator to end traversing the UList.
Definition at line 297 of file UListI.H.
Referenced by bitSet::bitSet(), edge::erase(), objectRegistry::erase(), Foam::ListOps::identity(), edge::insert(), HashSet< Foam::string >::insert(), UList< Foam::wordRe >::operator<(), HashSet< Foam::string >::operator=(), vtuSizing::renumberFaceLabelsXml(), vtuSizing::renumberVertLabelsLegacy(), bitSet::set(), Foam::shuffle(), Foam::sort(), Foam::stableSort(), HashSet< Foam::string >::unset(), and bitSet::unset().
|
inline |
Return const_iterator to begin traversing the constant UList.
Definition at line 290 of file UListI.H.
Referenced by IndirectListBase< T, Addr >::begin(), IndirectListBase< T, Addr >::cbegin(), and HashTable< Foam::phase * >::erase().
|
inline |
Return const_iterator to end traversing the constant UList.
Definition at line 311 of file UListI.H.
Referenced by IndirectListBase< T, Addr >::cend(), IndirectListBase< T, Addr >::end(), and HashTable< Foam::phase * >::erase().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
The number of elements in the UList.
Definition at line 367 of file UListI.H.
Referenced by UList< Foam::wordRe >::test().
|
inlinenoexcept |
True if the UList is empty (ie, size() is zero)
Definition at line 374 of file UListI.H.
Referenced by AABBTree< Type >::AABBTree(), Foam::printTable(), UnsortedMeshedSurface< Face >::remapFaces(), MeshedSurface< Foam::face >::remapFaces(), Foam::system(), and treeBoundBox::treeBoundBox().
|
inlinestaticconstexprnoexcept |
Swap content with another UList of the same type in constant time.
Definition at line 381 of file UListI.H.
Referenced by Foam::Swap().
Foam::Ostream & writeList | ( | Ostream & | os, |
const label | shortLen = 0 |
||
) | const |
Write List, with line-breaks in ASCII when length exceeds shortLen.
Using '0' suppresses line-breaks entirely.
Definition at line 79 of file UListIO.C.
Referenced by Foam::operator<<(), and ensightCells::writeDict().
A bitSet::test() method for a list of bool.
A bitSet::get() method for a list of bool.
A bitSet::unset() method for a list of bool.
Foam::UPstream::commsStruct & operator[] | ( | const label | procID | ) |
Definition at line 252 of file UPstream.C.
const Foam::UPstream::commsStruct & operator[] | ( | const label | procID | ) | const |
Definition at line 353 of file UPstream.C.
UPstream::commsStruct & operator[] | ( | const | label | ) |
const UPstream::commsStruct & operator[] | ( | const | label | ) | const |
const typedef T* const_pointer |
const typedef T& const_reference |
const typedef T* const_iterator |