A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used for subscript bounds checking, etc. More...
#include <OpenFOAM/PtrList.H>
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used for subscript bounds checking, etc.
The element operator [] returns a reference to the object rather than to the pointer.
Definition at line 98 of file PtrList.H.
Inherited by blockMesh, fvBoundaryMesh, IOPtrList< T >, pointBoundaryMesh, and polyBoundaryMesh.
Classes | |
class | iterator |
An STL-conforming iterator. More...
| |
Public Types | |
typedef T | value_type |
Type of values the PtrList contains.
| |
typedef T & | reference |
Type that can be used for storing into PtrList::value_type objects.
| |
typedef const T & | const_reference |
Type that can be used for storing into constant PtrList::value_type.
| |
Public Member Functions | |
PtrList () | |
Null Constructor.
| |
PtrList (const label) | |
Construct with length specified.
| |
PtrList (const PtrList< T > &) | |
Copy constructor.
| |
template<class CloneArg > | |
PtrList (const PtrList< T > &, const CloneArg &) | |
Copy constructor with additional argument for clone.
| |
PtrList (const Xfer< PtrList< T > > &) | |
Construct by transferring the parameter contents.
| |
PtrList (PtrList< T > &, bool reUse) | |
Construct as copy or re-use as specified.
| |
PtrList (const SLPtrList< T > &) | |
Construct as copy of SLPtrList<T>
| |
template<class INew > | |
PtrList (Istream &, const INew &) | |
Construct from Istream using given Istream constructor class.
| |
PtrList (Istream &) | |
Construct from Istream using default Istream constructor class.
| |
~PtrList () | |
label | size () const |
Return the number of elements in the PtrList.
| |
bool | empty () const |
Return true if the PtrList is empty (ie, size() is zero).
| |
void | setSize (const label) |
Reset size of PtrList. This can only be used to set the size.
| |
void | resize (const label) |
Reset size of PtrList. This can only be used to set the size.
| |
void | clear () |
Clear the PtrList, i.e. set size to zero deleting all the.
| |
void | transfer (PtrList< T > &) |
Transfer the contents of the argument PtrList into this PtrList.
| |
Xfer< PtrList< T > > | xfer () |
Transfer contents to the Xfer container.
| |
bool | set (const label) const |
Is element set.
| |
autoPtr< T > | set (const label, T *) |
Set element. Return old element (can be NULL).
| |
autoPtr< T > | set (const label, const autoPtr< T > &) |
autoPtr< T > | set (const label, const tmp< T > &) |
void | reorder (const UList< label > &) |
Reorders elements. Ordering does not have to be done in.
| |
const T & | operator[] (const label) const |
Return element const reference.
| |
T & | operator[] (const label) |
Return element reference.
| |
const T * | operator() (const label) const |
Return element const pointer.
| |
PtrList< T > & | operator= (const PtrList< T > &) |
Assignment.
| |
iterator | begin () |
Return an iterator to begin traversing the PtrList.
| |
iterator | end () |
Return an iterator to end traversing the PtrList.
| |
Protected Member Functions | |
template<class INew > | |
void | read (Istream &, const INew &inewt) |
Read from Istream using given Istream constructor class.
| |
Friends | |
class | iterator |
Istream & | operator>> (Istream &, PtrList< T > &) |
Read List from Istream, discarding contents of existing List.
| |
Ostream & | operator (Ostream &, const PtrList< T > &) |
typedef T value_type |
typedef T& reference |
Type that can be used for storing into PtrList::value_type objects.
typedef const T& const_reference |
Type that can be used for storing into constant PtrList::value_type.
objects.
PtrList | ( | const label | s ) | [explicit]
|
Construct as copy or re-use as specified.
Definition at line 80 of file PtrList.C.
References forAll, and PtrList< T >::setSize().
Construct as copy of SLPtrList<T>
Definition at line 104 of file PtrList.C.
References SLListBase::begin(), SLListBase::end(), and SLListBase::size().
Construct from Istream using given Istream constructor class.
Definition at line 152 of file PtrListIO.C.
Construct from Istream using default Istream constructor class.
Definition at line 159 of file PtrListIO.C.
Read from Istream using given Istream constructor class.
Definition at line 36 of file PtrListIO.C.
References LList< SLListBase, T >::append(), SLListBase::begin(), SLListBase::end(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorIn, forAll, token::info(), token::isLabel(), token::isPunctuation(), token::labelToken(), token::pToken(), Istream::putBack(), Istream::readBeginList(), Istream::readEndList(), setSize(), SLListBase::size(), and T.
Referenced by Foam::operator>>().
Foam::label size | ( | ) | const [inline]
|
Return the number of elements in the PtrList.
Definition at line 34 of file PtrListI.H.
Referenced by polyMeshAdder::add(), fvMeshAdder::add(), autoLayerDriver::addLayers(), meshRefinement::addPatch(), LISA::atomizeParcel(), blobsSheetAtomization::atomizeParcel(), attachPolyTopoChanger::attach(), Foam::compressible::autoCreateAlphat(), Foam::compressible::autoCreateLowReMut(), Foam::incompressible::autoCreateLowReNut(), Foam::compressible::autoCreateMut(), Foam::incompressible::autoCreateNut(), blobsSwirlInjector::blobsSwirlInjector(), reitzDiwakar::breakupParcel(), scotchDecomp::calcCSR(), polyTopoChange::changeMesh(), polyBoundaryMesh::checkDefinition(), polyBoundaryMesh::checkParallelSync(), ChomiakInjector::ChomiakInjector(), constInjector::constInjector(), inversePointDistanceDiffusivity::correct(), inverseFaceDistanceDiffusivity::correct(), wallDistData< TransferType >::correct(), definedHollowConeInjector::definedHollowConeInjector(), fvMeshDistribute::distribute(), autoLayerDriver::doLayers(), fvDOM::fvDOM(), cellDistFuncs::getPatchIDs(), hollowConeInjector::hollowConeInjector(), fvBoundaryMesh::interfaces(), volPointInterpolation::interpolate(), LUscalarMatrix::LUscalarMatrix(), meshRefinement::makeDisplacementField(), polyTopoChange::makeMesh(), MeshedSurface< Face >::MeshedSurface(), meshTriangulation::meshTriangulation(), parcel::move(), ZoneMesh< ZoneType, MeshType >::names(), polyBoundaryMesh::names(), polyTopoChanger::names(), PtrList< T >::operator=(), polyBoundaryMesh::physicalTypes(), polyBoundaryMesh::polyBoundaryMesh(), Foam::polyMeshZipUpCells(), polyTopoChange::polyTopoChange(), pressureSwirlInjector::pressureSwirlInjector(), fvMeshDistribute::printMeshInfo(), boundaryMesh::read(), polyMesh::readUpdate(), ensightParts::recalculate(), refinementSurfaces::refinementSurfaces(), lduMatrix::residual(), fvMeshSubset::setCellSubset(), fvMeshSubset::setLargeCellSubset(), removeCells::setRefinement(), meshCutAndRemove::setRefinement(), shellSurfaces::shellSurfaces(), GAMGAgglomeration::size(), ensightParts::size(), GaussSeidelSmoother::smooth(), surfacePatchIOList::surfacePatchIOList(), surfZoneIOList::surfZoneIOList(), syncTools::syncEdgeList(), syncTools::syncFaceList(), syncTools::syncPointList(), ZoneMesh< ZoneType, MeshType >::types(), polyBoundaryMesh::types(), GeometricField< Type, PatchField, GeoMesh >::GeometricBoundaryField::types(), polyTopoChanger::types(), valveBank::valveBank(), wallLayerCells::wallLayerCells(), xmgraceSetWriter< Type >::write(), gnuplotSetWriter< Type >::write(), polyBoundaryMesh::writeData(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), cellZoneSet::writeObject(), STARCD::writeSurface(), ZoneMesh< ZoneType, MeshType >::ZoneMesh(), and meshRefinement::zonify().
bool empty | ( | ) | const [inline]
|
Return true if the PtrList is empty (ie, size() is zero).
Definition at line 41 of file PtrListI.H.
Referenced by sixDoFRigidBodyMotion::write().
void setSize | ( | const label | newSize ) |
Reset size of PtrList. This can only be used to set the size.
of an empty PtrList, extend a PtrList, remove entries from the end of a PtrList. If the entries are non-empty they are deleted.
Definition at line 142 of file PtrList.C.
References Foam::abort(), clear(), Foam::FatalError, and FatalErrorIn.
Referenced by polyMeshAdder::add(), fvMeshAdder::add(), cellTable::addCellZones(), meshRefinement::addPatch(), polyBoundaryMesh::checkParallelSync(), GAMGAgglomeration::compactLevels(), displacementInterpolationFvMotionSolver::displacementInterpolationFvMotionSolver(), spray::evolve(), fvDOM::fvDOM(), polyBoundaryMesh::polyBoundaryMesh(), PtrList< T >::PtrList(), functionObjectList::read(), Foam::ReadFields(), polyMesh::readUpdate(), polyMesh::removeBoundary(), searchableSurfaces::searchableSurfaces(), duplicatePoints::setRefinement(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), cellZoneSet::writeObject(), ZoneMesh< ZoneType, MeshType >::ZoneMesh(), and meshRefinement::zonify().
void resize | ( | const label | newSize ) | [inline]
|
void clear | ( | ) |
Clear the PtrList, i.e. set size to zero deleting all the.
allocated entries.
Reimplemented in functionObjectList, ZoneMesh< ZoneType, MeshType >, ZoneMesh< faceZone, polyMesh >, ZoneMesh< pointZone, polyMesh >, and ZoneMesh< cellZone, polyMesh >.
Definition at line 184 of file PtrList.C.
References forAll.
Referenced by ZoneMesh< ZoneType, MeshType >::clear(), functionObjectList::clear(), GeometricField< Type, PatchField, GeoMesh >::operator=(), GeometricField< Type, PatchField, GeoMesh >::operator==(), Foam::operator>>(), functionObjectList::read(), fvBoundaryMesh::readUpdate(), and polyMesh::removeBoundary().
void transfer | ( | PtrList< T > & | a ) |
Transfer the contents of the argument PtrList into this PtrList.
and annull the argument list.
Definition at line 199 of file PtrList.C.
References clear().
Referenced by ensightParts::ensightParts(), IOPtrList< T >::IOPtrList(), and functionObjectList::read().
Foam::Xfer< Foam::PtrList< T > > xfer | ( | ) | [inline]
|
Transfer contents to the Xfer container.
Definition at line 95 of file PtrListI.H.
References Foam::xferMove().
bool set | ( | const label | i ) | const [inline]
|
Is element set.
Definition at line 55 of file PtrListI.H.
Referenced by fvMeshAdder::add(), cellTable::addCellZones(), meshRefinement::addPatch(), pairGAMGAgglomeration::combineLevels(), boundaryMesh::deletePatch(), fvMeshDistribute::distribute(), fvDOM::fvDOM(), isoSurface::isoSurface(), LUscalarMatrix::LUscalarMatrix(), pointBoundaryMesh::pointBoundaryMesh(), polyBoundaryMesh::polyBoundaryMesh(), functionObjectList::read(), boundaryMesh::read(), Foam::ReadFields(), ensightParts::recalculate(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), cellZoneSet::writeObject(), ZoneMesh< ZoneType, MeshType >::ZoneMesh(), and meshRefinement::zonify().
Foam::autoPtr< T > set | ( | const label | i, |
T * | ptr | ||
) | [inline]
|
Set element. Return old element (can be NULL).
No checks on new element.
Definition at line 62 of file PtrListI.H.
Foam::autoPtr< T > set | ( | const label | i, |
const autoPtr< T > & | aptr | ||
) | [inline]
|
Definition at line 74 of file PtrListI.H.
Foam::autoPtr< T > set | ( | const label | i, |
const tmp< T > & | t | ||
) | [inline]
|
Definition at line 85 of file PtrListI.H.
void reorder | ( | const UList< label > & | oldToNew ) |
Reorders elements. Ordering does not have to be done in.
ascending or descending order. Reordering has to be unique. (is shuffle)
Reimplemented in polyBoundaryMesh.
Definition at line 207 of file PtrList.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, Foam::nl, UList< T >::size(), and Foam::T().
Referenced by meshRefinement::addPatch(), and polyBoundaryMesh::reorder().
const T & operator[] | ( | const label | i ) | const [inline]
|
Return element const reference.
Definition at line 104 of file PtrListI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
Referenced by fvBoundaryMesh::movePoints().
T & operator[] | ( | const label | i ) | [inline]
|
Return element reference.
Definition at line 118 of file PtrListI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
const T * operator() | ( | const label | i ) | const [inline]
|
Return element const pointer.
Definition at line 132 of file PtrListI.H.
Foam::PtrList< T > & operator= | ( | const PtrList< T > & | a ) |
Assignment.
Definition at line 257 of file PtrList.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, setSize(), and PtrList< T >::size().
Referenced by IOPtrList< T >::operator=().
Foam::PtrList< T >::iterator begin | ( | ) | [inline]
|
Return an iterator to begin traversing the PtrList.
Definition at line 286 of file PtrListI.H.
References UList< T >::begin().
Foam::PtrList< T >::iterator end | ( | ) | [inline]
|
Return an iterator to end traversing the PtrList.
Reimplemented in functionObjectList, sampledSets, and sampledSurfaces.
Definition at line 293 of file PtrListI.H.
References UList< T >::end().