Loading...
Searching...
No Matches
PtrList< T > Class Template Reference

A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers. The operator[] returns a reference to the object, not the pointer. More...

#include <PtrList.H>

Inherits UPtrList< T >.

Inherited by DictionaryBase< PtrList< T >, T >, ZoneMesh< faFaceZone, faMesh >, ZoneMesh< cellZone, polyMesh >, ZoneMesh< faceZone, polyMesh >, ZoneMesh< pointZone, polyMesh >, IOPtrList< T >, and PtrDynList< T, SizeMin >.

Collaboration diagram for PtrList< T >:

Public Member Functions

constexpr PtrList () noexcept
 Default construct.
 PtrList (const label len)
 Construct with specified size, each element initialized to nullptr.
 PtrList (const PtrList< T > &list)
 Copy construct using 'clone()' method on each element.
 PtrList (PtrList< T > &&list) noexcept
 Move construct.
 PtrList (UList< T * > &list)
 Take ownership of pointers in the list, set old pointers to null.
template<class CloneArg>
 PtrList (const PtrList< T > &list, const CloneArg &cloneArgs)
 Copy construct using 'clone()' method on each element.
 PtrList (PtrList< T > &list, bool reuse)
 Construct as copy or re-use as specified.
 PtrList (const SLPtrList< T > &list)
 Copy construct using 'clone()' on each element of SLPtrList<T>.
template<class INew>
 PtrList (Istream &is, const INew &inew)
 Construct from Istream using given Istream constructor class.
 PtrList (Istream &is)
 Construct from Istream using default Istream constructor class.
 ~PtrList ()
 Destructor. Frees all pointers.
template<class... Args>
PtrList< Tclone (Args &&... args) const
 Make a copy by cloning each of the list elements.
const Tset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Clear the PtrList. Delete allocated entries and set size to zero.
void free ()
 Free memory and nullify all entries. Does not change the list size.
void resize (const label newLen)
 Adjust size of PtrList.
void resize_null (const label newLen)
 Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries.
template<class... Args>
Templace_back (Args &&... args)
 Construct and append an element to the end of the list, return reference to the new list element.
void push_back (T *ptr)
 Append an element to the end of the list.
void push_back (std::unique_ptr< T > &&ptr)
 Move append an element to the end of the list.
void push_back (autoPtr< T > &&ptr)
 Move append an element to the end of the list.
void push_back (const refPtr< T > &ptr)
 Move or clone append a refPtr to the end of the list.
void push_back (const tmp< T > &ptr)
 Move or clone append a tmp to the end of the list.
void push_back (PtrList< T > &&other)
 Move append another list to the end of this list.
template<class... Args>
Templace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
template<class... Args>
Templace (const label i, Args &&... args)
 Same as emplace_set().
template<class... Args>
Ttry_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< Tset (const label i, T *ptr)
 Set element to given pointer and return old element (can be null).
autoPtr< Tset (const label i, std::unique_ptr< T > &&ptr)
 Set element to given unique_ptr and return old element.
autoPtr< Tset (const label i, autoPtr< T > &&ptr)
 Set element to given autoPtr and return old element.
autoPtr< Tset (const label i, const refPtr< T > &ptr)
 Set element to given refPtr and return old element.
autoPtr< Tset (const label i, const tmp< T > &ptr)
 Set element to given tmp and return old element.
autoPtr< Trelease (const label i)
 Release ownership of the pointer at the given position.
void transfer (PtrList< T > &list)
 Transfer into this list and annul the argument list.
void operator= (const UPtrList< T > &list)
 Copy assignment.
void operator= (const PtrList< T > &list)
 Copy assignment.
void operator= (PtrList< T > &&list)
 Move assignment.
void push_back (autoPtr< T > &ptr)=delete
 Disallow push_back with autoPtr without std::move.
autoPtr< Tset (const label i, autoPtr< T > &ptr)
 Set element to given autoPtr and return old element.
void setSize (const label n)
 Same as resize().
void append (autoPtr< T > &ptr)
 Move append an element to the end of the list.
void append (T *ptr)
 Append an element to the end of the list.
void append (std::unique_ptr< T > &&ptr)
 Move append an element to the end of the list.
void append (autoPtr< T > &&ptr)
 Move append an element to the end of the list.
void append (const refPtr< T > &ptr)
 Move or clone append a tmp to the end of the list.
void append (const tmp< T > &ptr)
 Move or clone append a tmp to the end of the list.
void append (PtrList< T > &&other)
 Move append another list to the end of this list.
template<class... Args>
Foam::PtrList< Tclone (Args &&... args) const
Public Member Functions inherited from UPtrList< T >
constexpr UPtrList () noexcept=default
 Default construct.
 UPtrList (const label len)
 Construct with specified size and set all entries to nullptr.
 UPtrList (const UPtrList< T > &list)
 Copy construct (shallow copies addresses).
 UPtrList (UPtrList< T > &&list) noexcept
 Move construct.
 UPtrList (UPtrList< T > &list, bool reuse)
 Construct as shallow copy or re-use as specified.
 UPtrList (PtrList< T > &list)
 Shallow copy from PtrList.
 UPtrList (const UList< T * > &list)
 Construct from UList of pointers (shallow copy).
 UPtrList (UList< T > &list)
 Construct from UList, taking the address of each list element.
bool empty () const noexcept
 True if the list is empty (ie, size() is zero).
label size () const noexcept
 The number of entries in the list.
label capacity () const noexcept
 Size of the underlying storage.
label count_nonnull () const noexcept
 The number of non-nullptr entries in the list.
Tfront ()
 Reference to the first element of the list.
const Tfront () const
 Reference to first element of the list.
Tback ()
 Reference to the last element of the list.
const Tback () const
 Reference to the last element of the list.
const Ttest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const Tget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
Tget (const label i)
 Return pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const Tset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Set list size to zero.
void free ()
 Nullify all entries. Does not change the list size.
void resize (const label newLen)
 Change the size of the list. Any new entries are nullptr.
void resize_null (const label newLen)
 Set the list to the given size and set all entries to nullptr.
label squeezeNull ()
 Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list.
void push_back (T *ptr)
 Append an element to the end of the list.
void push_back (UPtrList< T > &&other)
 Move append another list to the end of this list.
void swap (UPtrList< T > &list) noexcept
 Swap content.
void transfer (UPtrList< T > &list)
 Transfer contents into this list and annul the argument.
Tset (const label i, T *ptr)
 Set element to specified pointer and return the old list element, which can be a nullptr.
void reorder (const labelUList &oldToNew, const bool check=false)
 Reorder elements. Reordering must be unique (ie, shuffle).
void sortOrder (const labelUList &order, const bool check=false)
 Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
void checkNonNull () const
 Check and raise FatalError if any nullptr exists in the list.
const Tat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
Tat (const label i)
 Return reference to the element at given position. FatalError for bounds problem or nullptr.
const Toperator[] (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
Toperator[] (const label i)
 Return reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
 FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const T *operator()(const label i) const
 Deprecated(2022-09) - same as get().
void operator= (const UPtrList< T > &list)
 Copy assignment (shallow copies addresses).
void operator= (UPtrList< T > &&list)
 Move assignment.
OstreamprintAddresses (Ostream &os) const
 Print pointer addresses to Ostream (debugging only).
OstreamwriteList (Ostream &os, const bool trimNull=false) const
 Write UPtrList to Ostream, optionally ignoring null entries.
T ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution).
T ** end_ptr () noexcept
 Iterator beyond end of raw pointers traversal (use with caution).
iterator begin ()
 Return iterator to begin traversal of non-nullptr entries.
iterator end () noexcept
 Return iterator beyond end of UPtrList traversal.
const_iterator cbegin () const
 Return const_iterator to begin traversal of non-nullptr entries.
const_iterator cend () const noexcept
 Return const_iterator beyond end of UPtrList traversal.
const_iterator begin () const
 Return const_iterator to begin traversal of non-nullptr entries.
const_iterator end () const noexcept
 Return const_iterator beyond end of UPtrList traversal.
void setSize (const label n)
 Alias for resize().
Tfirst ()
 Reference to the first element of the list.
const Tfirst () const
 Return reference to first element of the list.
Tlast ()
 Return reference to the last element of the list.
const Tlast () const
 Return reference to the last element of the list.
void append (T *ptr)
 Append an element to the end of the list.
void append (UPtrList< T > &&other)
 Move append another list to the end of this list.
label count () const noexcept
 The number of non-nullptr entries in the list.

Protected Member Functions

template<class INew>
void readIstream (Istream &is, const INew &inew)
 Read from Istream using Istream constructor class.
Protected Member Functions inherited from UPtrList< T >
void setAddressableSize (const label n) noexcept
 Adjust addressable size.
label find_next (label pos) const
 The next non-null entry after the specified position.
 UPtrList (Detail::PtrListDetail< T > &&ptrs) noexcept
 Low-level move construct.

Friends

Istreamoperator>> (Istream &is, PtrList< T > &list)
 Read from Istream, discarding contents of existing list.

Additional Inherited Members

Public Types inherited from UPtrList< T >
typedef T value_type
 Type of values the list contains.
typedef Treference
 A non-const reference to the value_type.
typedef const Tconst_reference
 A const reference to the value_type.
Protected Attributes inherited from UPtrList< T >
Detail::PtrListDetail< Tptrs_
 The list of pointers.

Detailed Description

template<class T>
class Foam::PtrList< T >

A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers. The operator[] returns a reference to the object, not the pointer.

See also
Foam::UPtrList Foam::PtrDynList
Source files

Definition at line 64 of file PtrList.H.

Constructor & Destructor Documentation

◆ PtrList() [1/10]

◆ PtrList() [2/10]

template<class T>
PtrList ( const label len)
inlineexplicit

Construct with specified size, each element initialized to nullptr.

Definition at line 36 of file PtrListI.H.

References Foam::T(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [3/10]

template<class T>
PtrList ( const PtrList< T > & list)
inline

Copy construct using 'clone()' method on each element.

Definition at line 43 of file PtrListI.H.

References clone(), PtrList(), UPtrList< T >::ptrs_, Foam::T(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [4/10]

template<class T>
PtrList ( PtrList< T > && list)
inlinenoexcept

Move construct.

Definition at line 50 of file PtrListI.H.

References Foam::noexcept, PtrList(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [5/10]

template<class T>
PtrList ( UList< T * > & list)
inlineexplicit

Take ownership of pointers in the list, set old pointers to null.

Definition at line 74 of file PtrListI.H.

References Foam::T(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [6/10]

template<class T>
template<class CloneArg>
PtrList ( const PtrList< T > & list,
const CloneArg & cloneArgs )
inline

Copy construct using 'clone()' method on each element.

Definition at line 85 of file PtrListI.H.

References clone(), PtrList(), Foam::T(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [7/10]

template<class T>
PtrList ( PtrList< T > & list,
bool reuse )
inline

Construct as copy or re-use as specified.

Definition at line 57 of file PtrListI.H.

References PtrList(), Foam::T(), transfer(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [8/10]

template<class T>
PtrList ( const SLPtrList< T > & list)
explicit

Copy construct using 'clone()' on each element of SLPtrList<T>.

Definition at line 75 of file PtrList.C.

References UPtrList< T >::size(), Foam::T(), and UPtrList< T >::UPtrList().

Here is the call graph for this function:

◆ PtrList() [9/10]

template<class T>
template<class INew>
PtrList ( Istream & is,
const INew & inew )

Construct from Istream using given Istream constructor class.

Definition at line 143 of file PtrListIO.C.

References readIstream().

Here is the call graph for this function:

◆ PtrList() [10/10]

template<class T>
PtrList ( Istream & is)

Construct from Istream using default Istream constructor class.

Definition at line 150 of file PtrListIO.C.

References readIstream().

Here is the call graph for this function:

◆ ~PtrList()

template<class T>
~PtrList ( )

Destructor. Frees all pointers.

Definition at line 93 of file PtrList.C.

References free(), and UPtrList< T >::ptrs_.

Here is the call graph for this function:

Member Function Documentation

◆ readIstream()

template<class T>
template<class INew>
void readIstream ( Istream & is,
const INew & inew )
protected

Read from Istream using Istream constructor class.

Definition at line 30 of file PtrListIO.C.

References token::BEGIN_LIST, clear(), IOstream::fatalCheck(), FUNCTION_NAME, token::isLabel(), token::labelToken(), p, Istream::readBeginList(), resize(), set(), and Foam::T().

Referenced by IOPtrList< T >::IOPtrList(), IOPtrList< T >::IOPtrList(), IOPtrList< T >::IOPtrList(), PtrList(), PtrList(), and IOPtrList< Foam::entry >::readContents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [1/2]

template<class T>
template<class... Args>
PtrList< T > clone ( Args &&... args) const

Make a copy by cloning each of the list elements.

Referenced by PtrList(), and PtrList().

Here is the caller graph for this function:

◆ set() [1/7]

template<class T>
const T * set ( const label i) const
inline

Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).

The return value can be tested as a bool.

Definition at line 171 of file PtrList.H.

Referenced by fvMeshAdder::add(), polyMeshAdder::add(), cellTable::addCellZones(), phaseSystem::addField(), FIREMeshReader::addPatches(), attachPolyTopoChanger::attach(), viewFactor::calculate(), boundaryMesh::changeFaces(), boundaryMesh::changePatchType(), adjointSolverManager::constraintSensitivities(), diffusionMulticomponent< ReactionThermo, ThermoType >::correct(), directionalPressureGradientExplicitSource::correct(), MomentumTransferPhaseSystem< BasePhaseSystem >::ddtCorrByAs(), boundaryMesh::deletePatch(), fvMeshDistribute::distribute(), multiphaseSystem::dragCoeffs(), extrudePatchMesh::extrudePatchMesh(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), surfaceZonesInfo::getAllClosedNamedSurfaces(), surfaceZonesInfo::getClosedNamedSurfaces(), surfaceZonesInfo::getInsidePointNamedSurfaces(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getStandaloneNamedSurfaces(), surfaceZonesInfo::getUnclosedNamedSurfaces(), GAMGProcAgglomeration::globalCellCells(), lduPrimitiveMesh::globalCellCells(), interRegionExplicitPorositySource::initialise(), viewFactor::initialise(), cellDecomposer::interpolate(), fvMeshSubset::interpolate(), fvMeshSubset::interpolate(), fvMeshSubset::interpolate(), meshToMesh0::interpolate(), LUscalarMatrix::LUscalarMatrix(), polyTopoChange::makeMesh(), volSurfaceMapping::mapInternalToSurface(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), MomentumTransferPhaseSystem< BasePhaseSystem >::momentumTransferf(), MomentumTransferPhaseSystem< BasePhaseSystem >::partialElimination(), MomentumTransferPhaseSystem< BasePhaseSystem >::partialEliminationf(), boundaryMesh::patchify(), pointBoundaryMesh::pointBoundaryMesh(), RecycleInteraction< CloudType >::postEvolve(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), functionObjectList::read(), sampledSurfaces::read(), readIstream(), refinementSurfaces::refinementSurfaces(), refinementFeatures::regionEdgeTrees(), variablesSet::renameTurbulenceField(), fvMeshSubset::reset(), fvMeshSubset::reset(), distributedDILUPreconditioner::sendGlobal(), set(), set(), set(), PtrList< faPatch >::set(), PtrListDictionary< phaseModel >::set(), ISQP::ShermanMorrisonPrecon(), multiphaseSystem::solve(), multiphaseSystem::solveAlphas(), MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::solveYi(), blockMesh::topology(), cellVolumeWeight::update(), inverseDistance::update(), trackingInverseDistance::update(), designVariablesUpdate::updateGradientsAndValues(), streamLineBase::writeToFile(), and ZoneMesh< ZoneType, MeshType >::ZoneMesh().

◆ clear()

template<class T>
void clear ( )
inline

Clear the PtrList. Delete allocated entries and set size to zero.

Definition at line 98 of file PtrListI.H.

References UPtrList< T >::clear(), free(), and UPtrList< T >::ptrs_.

Referenced by functionObjectList::clear(), ZoneMesh< ZoneType, MeshType >::clear(), PtrDynList< T, SizeMin >::clearStorage(), functionObjectList::read(), sampledSets::read(), sampledSurfaces::read(), and decompositionMethod::setConstraints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

template<class T>
void free ( )
inline

Free memory and nullify all entries. Does not change the list size.

Definition at line 106 of file PtrListI.H.

References free(), and UPtrList< T >::ptrs_.

Referenced by clear(), free(), resize_null(), PtrDynList< Foam::Field< label > >::swap(), PtrDynList< Foam::Field< label > >::transfer(), transfer(), and ~PtrList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

◆ resize_null()

template<class T>
void resize_null ( const label newLen)
inline

Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries.

Definition at line 113 of file PtrListI.H.

References free(), UPtrList< T >::ptrs_, and UPtrList< T >::resize_null().

Here is the call graph for this function:

◆ emplace_back()

template<class T>
template<class... Args>
T & emplace_back ( Args &&... args)
inline

Construct and append an element to the end of the list, return reference to the new list element.

Definition at line 122 of file PtrListI.H.

References args, UPtrList< T >::push_back(), Foam::T(), and T.

Referenced by surfaceZonesInfo::addCellZone(), surfaceZonesInfo::addFaceZone(), meshRefinement::addPointZone(), and streamLineBase::trimToBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back() [1/7]

template<class T>
void push_back ( T * ptr)
inline

◆ push_back() [2/7]

template<class T>
void push_back ( std::unique_ptr< T > && ptr)
inline

Move append an element to the end of the list.

Definition at line 138 of file PtrListI.H.

References UPtrList< T >::push_back().

Here is the call graph for this function:

◆ push_back() [3/7]

template<class T>
void push_back ( autoPtr< T > && ptr)
inline

Move append an element to the end of the list.

Definition at line 145 of file PtrListI.H.

References UPtrList< T >::push_back().

Here is the call graph for this function:

◆ push_back() [4/7]

template<class T>
void push_back ( const refPtr< T > & ptr)
inline

Move or clone append a refPtr to the end of the list.

Definition at line 152 of file PtrListI.H.

References refPtr< T >::ptr(), and UPtrList< T >::push_back().

Here is the call graph for this function:

◆ push_back() [5/7]

template<class T>
void push_back ( const tmp< T > & ptr)
inline

Move or clone append a tmp to the end of the list.

Definition at line 159 of file PtrListI.H.

References tmp< T >::ptr(), and UPtrList< T >::push_back().

Here is the call graph for this function:

◆ push_back() [6/7]

template<class T>
void push_back ( PtrList< T > && other)
inline

Move append another list to the end of this list.

Definition at line 166 of file PtrListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, PtrList(), resize(), and UPtrList< T >::size().

Here is the call graph for this function:

◆ emplace_set()

template<class T>
template<class... Args>
T & emplace_set ( const label i,
Args &&... args )
inline

Construct and set a new element at given position, (discard old element at that location).

Parameters
i- the location to set
argsarguments to forward to the constructor of the element
Returns
reference to the new list element.

Definition at line 191 of file PtrListI.H.

References args, release(), UPtrList< T >::set(), Foam::T(), and T.

Referenced by fvMeshDistribute::distribute(), emplace(), PtrDynList< T, SizeMin >::emplace_set(), LUscalarMatrix::LUscalarMatrix(), Foam::readLagrangian(), and syncTools::syncFaceList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace()

template<class T>
template<class... Args>
T & emplace ( const label i,
Args &&... args )
inline

Same as emplace_set().

Definition at line 202 of file PtrListI.H.

References args, emplace_set(), and Foam::T().

Here is the call graph for this function:

◆ try_emplace()

template<class T>
template<class... Args>
T & try_emplace ( const label i,
Args &&... args )
inline

Like emplace_set() but will not overwrite an occupied (non-null) location.

Parameters
i- the location to set (unless already defined)
argsarguments to forward to the constructor of the element
Returns
reference to the existing or the new list element.

Definition at line 210 of file PtrListI.H.

Referenced by PtrDynList< T, SizeMin >::try_emplace().

Here is the caller graph for this function:

◆ set() [2/7]

template<class T>
Foam::autoPtr< T > set ( const label i,
T * ptr )
inline

Set element to given pointer and return old element (can be null).

No-op if the new pointer value is identical to the current content.

Definition at line 222 of file PtrListI.H.

References UPtrList< T >::set(), and Foam::T().

Here is the call graph for this function:

◆ set() [3/7]

template<class T>
Foam::autoPtr< T > set ( const label i,
std::unique_ptr< T > && ptr )
inline

Set element to given unique_ptr and return old element.

Definition at line 233 of file PtrListI.H.

References set().

Here is the call graph for this function:

◆ set() [4/7]

template<class T>
Foam::autoPtr< T > set ( const label i,
autoPtr< T > && ptr )
inline

Set element to given autoPtr and return old element.

Definition at line 244 of file PtrListI.H.

◆ set() [5/7]

template<class T>
Foam::autoPtr< T > set ( const label i,
const refPtr< T > & ptr )
inline

Set element to given refPtr and return old element.

Definition at line 255 of file PtrListI.H.

References refPtr< T >::ptr(), and set().

Here is the call graph for this function:

◆ set() [6/7]

template<class T>
Foam::autoPtr< T > set ( const label i,
const tmp< T > & ptr )
inline

Set element to given tmp and return old element.

Definition at line 266 of file PtrListI.H.

References tmp< T >::ptr(), and set().

Here is the call graph for this function:

◆ release()

template<class T>
Foam::autoPtr< T > release ( const label i)
inline

Release ownership of the pointer at the given position.

Out of bounds addressing is a no-op and returns nullptr.

Definition at line 277 of file PtrListI.H.

References UPtrList< T >::set(), and UPtrList< T >::size().

Referenced by emplace_set(), and sampledSurfaces::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

template<class T>
void transfer ( PtrList< T > & list)
inline

Transfer into this list and annul the argument list.

Definition at line 289 of file PtrListI.H.

References FOAM_UNLIKELY, free(), PtrList(), and UPtrList< T >::ptrs_.

Referenced by directionalMeshWave::correct(), meshWave::correct(), meshWave::correct(), wallDistData< TransferType >::correct(), IOPtrList< T >::IOPtrList(), operator=(), PtrList(), IATE::read(), functionObjectList::read(), and PtrDynList< T, SizeMin >::transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/3]

template<class T>
void operator= ( const UPtrList< T > & list)
inline

Copy assignment.

For existing list entries, values are copied from the list. For new list entries, pointers are cloned from the list.

Definition at line 304 of file PtrListI.H.

References UPtrList< T >::UPtrList().

Referenced by IOPtrList< T >::IOPtrList(), IOPtrList< T >::operator=(), IOPtrList< T >::operator=(), PtrDynList< T, SizeMin >::operator=(), PtrDynList< T, SizeMin >::operator=(), and PtrDynList< T, SizeMin >::operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/3]

template<class T>
void operator= ( const PtrList< T > & list)
inline

Copy assignment.

For existing list entries, values are copied from the list. For new list entries, pointers are cloned from the list.

Definition at line 312 of file PtrListI.H.

References PtrList().

Here is the call graph for this function:

◆ operator=() [3/3]

template<class T>
void operator= ( PtrList< T > && list)
inline

Move assignment.

Definition at line 320 of file PtrListI.H.

References PtrList(), and transfer().

Here is the call graph for this function:

◆ push_back() [7/7]

template<class T>
void push_back ( autoPtr< T > & ptr)
delete

Disallow push_back with autoPtr without std::move.

◆ set() [7/7]

template<class T>
autoPtr< T > set ( const label i,
autoPtr< T > & ptr )
inline

Set element to given autoPtr and return old element.

FOAM_DEPRECATED_FOR(2022-10, "set(autoPtr&&))")

Definition at line 349 of file PtrList.H.

◆ setSize()

◆ append() [1/7]

template<class T>
void append ( autoPtr< T > & ptr)
inline

Move append an element to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 364 of file PtrList.H.

Referenced by singleProcessorFaceSets::add().

Here is the caller graph for this function:

◆ append() [2/7]

template<class T>
void append ( T * ptr)
inline

Append an element to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 371 of file PtrList.H.

◆ append() [3/7]

template<class T>
void append ( std::unique_ptr< T > && ptr)
inline

Move append an element to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 378 of file PtrList.H.

◆ append() [4/7]

template<class T>
void append ( autoPtr< T > && ptr)
inline

Move append an element to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 388 of file PtrList.H.

◆ append() [5/7]

template<class T>
void append ( const refPtr< T > & ptr)
inline

Move or clone append a tmp to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 395 of file PtrList.H.

◆ append() [6/7]

template<class T>
void append ( const tmp< T > & ptr)
inline

Move or clone append a tmp to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 402 of file PtrList.H.

◆ append() [7/7]

template<class T>
void append ( PtrList< T > && other)
inline

Move append another list to the end of this list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 409 of file PtrList.H.

◆ clone() [2/2]

template<class T>
template<class... Args>
Foam::PtrList< T > clone ( Args &&... args) const

Definition at line 103 of file PtrList.C.

◆ operator>>

template<class T>
Istream & operator>> ( Istream & is,
PtrList< T > & list )
friend

Read from Istream, discarding contents of existing list.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H
  • src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C
  • src/OpenFOAM/containers/PtrLists/PtrList/PtrListI.H
  • src/OpenFOAM/containers/PtrLists/PtrList/PtrListIO.C