Base for doubly-linked lists. More...
#include <DLListBase.H>

Classes | |
| struct | link |
| The structure for a doubly-linked storage node. More... | |
| class | iterator |
| A primitive non-const node iterator. More... | |
| class | const_iterator |
| A primitive const node iterator (bidirectional). More... | |
Public Member Functions | |
| DLListBase ()=default | |
| Default construct. | |
| DLListBase (const DLListBase &)=delete | |
| No copy construct. | |
| void | operator= (const DLListBase &)=delete |
| No copy assignment. | |
| ~DLListBase ()=default | |
| Destructor. | |
| bool | empty () const noexcept |
| True if the list is empty. | |
| label | size () const noexcept |
| The number of elements in list. | |
| link * | front () |
| Return first entry. | |
| const link * | front () const |
| Return const access to first entry. | |
| link * | back () |
| Return last entry. | |
| const link * | back () const |
| Return const access to last entry. | |
| void | push_front (link *item) |
| Add at front of list. | |
| void | push_back (link *item) |
| Add at back of list. | |
| bool | swapUp (link *item) |
| Swap this element with the one above unless it is at the top. | |
| bool | swapDown (link *item) |
| Swap this element with the one below unless it is at the bottom. | |
| link * | removeHead () |
| Remove and return first entry. | |
| link * | remove (link *item) |
| Remove and return element. | |
| link * | remove (iterator &iter) |
| Remove and return element specified by iterator. | |
| link * | replace (link *oldLink, link *newLink) |
| Replace oldLink with newLink and return element. | |
| link * | replace (iterator &oldIter, link *newitem) |
| Replace oldIter with newItem and return element. | |
| void | clear () |
| Clear the list. | |
| void | swap (DLListBase &lst) |
| Swap the contents of the list. | |
| void | transfer (DLListBase &lst) |
| Transfer the contents of the argument into this list and annul the argument list. | |
| iterator | begin () |
| Iterator to first item in list with non-const access. | |
| const_iterator | cbegin () const |
| Iterator to first item in list with const access. | |
| const_iterator | crbegin () const |
| Iterator to last item in list with const access. | |
| const iterator & | end () |
| End of list for iterators. | |
| const const_iterator & | cend () const |
| End of list for iterators. | |
| const const_iterator & | crend () const |
| End of list for reverse iterators. | |
| link * | first () |
| Return first entry. | |
| const link * | first () const |
| Return const access to first entry. | |
| link * | last () |
| Return last entry. | |
| const link * | last () const |
| Return const access to last entry. | |
| void | prepend (link *item) |
| Add at front of list. | |
| void | append (link *item) |
| Add at back of list. | |
Protected Member Functions | |
| template<class IteratorType> | |
| IteratorType | iterator_first () const |
| Return iterator to first item or end-iterator if list is empty. | |
| template<class IteratorType> | |
| IteratorType | iterator_last () const |
| Return iterator to last item or end-iterator if list is empty. | |
Static Protected Member Functions | |
| template<class IteratorType> | |
| static const IteratorType & | iterator_end () |
| Factory method to return an iterator end. | |
| template<class IteratorType> | |
| static const IteratorType & | iterator_rend () |
| Factory method to return an iterator reverse end. | |
Friends | |
| class | iterator |
| class | const_iterator |
Base for doubly-linked lists.
The iterators associated with the list only have a core functionality for navigation, with additional functionality to be added by inheriting classes. The node iterators always have a node-pointer as the first member data, which allows reinterpret_cast from anything else with a nullptr as its first data member. The nullObject is such an item (with a nullptr data member).
Definition at line 57 of file DLListBase.H.
|
default |
Default construct.
Referenced by DLListBase::const_iterator::const_iterator(), DLListBase::const_iterator::const_iterator(), DLListBase(), iterator_first(), iterator_last(), operator=(), swap(), and transfer().

|
delete |
|
default |
Destructor.
|
inlinestaticprotected |
Factory method to return an iterator end.
Simply reinterprets a NullObject as a DLListBase iterator.
Definition at line 28 of file DLListBaseI.H.
References Foam::nullObjectPtr.
Referenced by cend(), UILList< DLListBase, T >::cend(), end(), and UILList< DLListBase, T >::end().

|
inlinestaticprotected |
Factory method to return an iterator reverse end.
Simply reinterprets a NullObject as a DLListBase iterator.
Definition at line 35 of file DLListBaseI.H.
References Foam::nullObjectPtr.
Referenced by crend(), UILList< DLListBase, T >::crend(), and UILList< DLListBase, T >::rend().

|
inlineprotected |
Return iterator to first item or end-iterator if list is empty.
Removes constness which the caller promises to manage.
Definition at line 42 of file DLListBaseI.H.
References DLListBase(), and size().
Referenced by begin(), UILList< DLListBase, T >::begin(), cbegin(), and UILList< DLListBase, T >::cbegin().


|
inlineprotected |
Return iterator to last item or end-iterator if list is empty.
Removes constness which the caller promises to manage.
Definition at line 57 of file DLListBaseI.H.
References DLListBase(), and size().
Referenced by crbegin(), UILList< DLListBase, T >::crbegin(), and UILList< DLListBase, T >::rbegin().


|
delete |
|
inlinenoexcept |
True if the list is empty.
Definition at line 189 of file DLListBase.H.
References Foam::noexcept.
Referenced by cellTable::combine(), dictionary::endLineNumber(), regionFaModel::evolve(), Foam::operator<<(), outletMappedUniformInletFvPatchField< Type >::outletMappedUniformInletFvPatchField(), basicThermo::printThermoNames(), reader::remapMeshInfo(), boundaryRegion::rename(), schemesLookup::schemesLookup(), sensitivitySurface::smoothSensitivities(), solution::solution(), dictionary::startLineNumber(), Foam::writeFuncsImpl(), decomposedBlockData::writeHeader(), IOobject::writeHeaderContent(), and IOobject::writeHeaderContent().

|
inlinenoexcept |
The number of elements in list.
Definition at line 194 of file DLListBase.H.
References Foam::noexcept.
Referenced by sixDoFRigidBodyMotion::addConstraints(), sixDoFRigidBodyMotion::addRestraints(), quasiNewton::allocateHessian(), begin(), KinematicCloud< CloudType >::buildCellOccupancy(), cbegin(), cellSizeFunction::cellSize(), linearDistance::cellSize(), linearSpatial::cellSize(), surfaceOffsetLinearDistance::cellSize(), uniform::cellSize(), uniformDistance::cellSize(), cellShapeControl::cellSizeAndAlignment(), Cloud< ParcelType >::checkFieldFieldIOobject(), ReactingHeterogeneousCloud< CloudType >::checkParcelProperties(), Cloud< ParticleType >::Cloud(), CloudFunctionObjectList< CloudType >::CloudFunctionObjectList(), ISQP::computeResiduals(), conjugateGradient::conjugateGradient(), crbegin(), displacementInterpolationMotionSolver::curPoints(), diffusionMulticomponent< ReactionThermo, ThermoType >::diffusionMulticomponent(), KinematicCloud< CloudType >::evolveCloud(), adjointSolver::getObjectiveSensitivities(), MMA::getOrDefaultScalarField(), updateMethod::globalSum(), graphFunctionObject::graphFunctionObject(), LBFGS::HessianVectorProduct(), DSMCCloud< ParcelType >::info(), dynamicMultiMotionSolverFvMesh::init(), viewFactor::initialise(), ISQP::ISQP(), iterator_first(), iterator_last(), dictionary::keys(), liquidFilmModel::liquidFilmModel(), singleLayerRegion::mappedFieldAndInternalPatchTypes(), singleLayerRegion::mappedPushedFieldPatchTypes(), nullSpace::meritFunctionDirectionalDerivative(), MMA::MMA(), multiDisplacementMotionSolver::multiDisplacementMotionSolver(), multiDisplacementMotionSolver::multiDisplacementMotionSolver(), multiphaseSystem::multiphaseSystem(), multiSolidBodyMotionSolver::multiSolidBodyMotionSolver(), Cloud< ParticleType >::nParcels(), objectiveFlowRate::objectiveFlowRate(), objectiveFlowRatePartition::objectiveFlowRatePartition(), objectiveUniformityCellZone::objectiveUniformityCellZone(), outletMappedUniformInletFvPatchField< Type >::outletMappedUniformInletFvPatchField(), ParticleForceList< CloudType >::ParticleForceList(), SprayCloud< CloudType >::penetration(), KinematicCloud< Foam::DSMCCloud< dsmcParcel > >::preEvolve(), quasiNewton::quasiNewton(), ReactingCloud< CloudType >::ReactingCloud(), functionObjectList::read(), externalCoupled::read(), multiFieldValue::read(), foamReport::read(), FixedValueConstraint< Type >::read(), Time::readDict(), updateMethod::readOrZeroField(), boundaryRegion::rename(), ReactingCloud< Foam::DSMCCloud< dsmcParcel > >::setModels(), MMA::setOrDefaultScalarField(), cellSetOption::setSelection(), solarLoad::solarLoad(), solarLoad::solarLoad(), rigidBodyMeshMotion::solve(), sixDoFRigidBodyMotionSolver::solve(), nullSpace::solveDualProblem(), LBFGS::SR1HessianVectorProduct(), StandardChemistryModel< ReactionThermo, ThermoType >::StandardChemistryModel(), nullSpace::statistics(), Cloud< ParcelType >::storeGlobalPositions(), surfaceAlignedSBRStressFvMotionSolver::surfaceAlignedSBRStressFvMotionSolver(), TDACChemistryModel< ReactionThermo, ThermoType >::TDACChemistryModel(), dictionary::toc(), adjointSpalartAllmaras::topologySensitivities(), Foam::unitSet(), nullSpace::updateCorrectionIndices(), updateMethod::updateMethod(), LBFGS::updateVectors(), viewFactor::viewFactor(), viewFactor::viewFactor(), volBSplinesBase::volBSplinesBase(), waveModel::waveModel(), dictionaryListEntry::write(), and topOVariablesBase::writeFluidSolidInterface().
|
inline |
Return first entry.
Definition at line 96 of file DLListBaseI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by first(), and first().


|
inline |
Return const access to first entry.
Definition at line 109 of file DLListBaseI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

|
inline |
Return last entry.
Definition at line 122 of file DLListBaseI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by last(), and last().


|
inline |
Return const access to last entry.
Definition at line 135 of file DLListBaseI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

| void push_front | ( | DLListBase::link * | item | ) |
Add at front of list.
Definition at line 27 of file DLListBase.C.
References DLListBase::link::next_, and DLListBase::link::prev_.
Referenced by prepend(), and UILList< DLListBase, T >::UILList().

| void push_back | ( | DLListBase::link * | item | ) |
Add at back of list.
Definition at line 52 of file DLListBase.C.
References DLListBase::link::next_, and DLListBase::link::prev_.
Referenced by dictionary::add(), and append().

| bool swapUp | ( | DLListBase::link * | a | ) |
Swap this element with the one above unless it is at the top.
Definition at line 77 of file DLListBase.C.
References DLListBase::link::next_, and DLListBase::link::prev_.
| bool swapDown | ( | DLListBase::link * | a | ) |
Swap this element with the one below unless it is at the bottom.
Definition at line 116 of file DLListBase.C.
References DLListBase::link::next_, and DLListBase::link::prev_.
| Foam::DLListBase::link * removeHead | ( | ) |
Remove and return first entry.
Definition at line 155 of file DLListBase.C.
References Foam::abort(), DLListBase::link::deregister(), Foam::FatalError, FatalErrorInFunction, and DLListBase::link::next_.

| Foam::DLListBase::link * remove | ( | DLListBase::link * | item | ) |
Remove and return element.
Definition at line 181 of file DLListBase.C.
References DLListBase::link::deregister(), DLListBase::link::next_, and DLListBase::link::prev_.
Referenced by remove().


|
inline |
Remove and return element specified by iterator.
Definition at line 184 of file DLListBaseI.H.
References remove().

| Foam::DLListBase::link * replace | ( | DLListBase::link * | oldLink, |
| DLListBase::link * | newLink ) |
Replace oldLink with newLink and return element.
Definition at line 213 of file DLListBase.C.
References DLListBase::link::deregister(), DLListBase::link::next_, and DLListBase::link::prev_.
Referenced by dictionary::add(), dictionary::changeKeyword(), and replace().


|
inline |
Replace oldIter with newItem and return element.
Definition at line 194 of file DLListBaseI.H.
References replace().

|
inline |
Clear the list.
Definition at line 147 of file DLListBaseI.H.
Referenced by transfer().

|
inline |
Swap the contents of the list.
Definition at line 155 of file DLListBaseI.H.
References DLListBase().

|
inline |
Transfer the contents of the argument into this list and annul the argument list.
Definition at line 168 of file DLListBaseI.H.
References clear(), and DLListBase().

|
inline |
Iterator to first item in list with non-const access.
Definition at line 295 of file DLListBaseI.H.
References end(), iterator_first(), and size().
Referenced by DLListBase::const_iterator::operator=().


|
inline |
Iterator to first item in list with const access.
Definition at line 393 of file DLListBaseI.H.
References cend(), iterator_first(), and size().
Referenced by DLListBase::const_iterator::operator=().


|
inline |
Iterator to last item in list with const access.
Note that this is not a const_reverse_iterator, this is the responsibility of any derived classes.
Definition at line 405 of file DLListBaseI.H.
References crend(), iterator_last(), and size().
Referenced by DLListBase::const_iterator::operator=().


|
inline |
End of list for iterators.
Definition at line 73 of file DLListBaseI.H.
References iterator_end().
Referenced by begin(), and DLListBase::const_iterator::operator=().


|
inline |
End of list for iterators.
Definition at line 80 of file DLListBaseI.H.
References iterator_end().
Referenced by cbegin(), and DLListBase::const_iterator::operator=().


|
inline |
End of list for reverse iterators.
Definition at line 87 of file DLListBaseI.H.
References iterator_rend().
Referenced by crbegin(), and DLListBase::const_iterator::operator=().


|
inline |
Return first entry.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 460 of file DLListBase.H.
References first(), and front().
Referenced by first().


|
inline |
Return const access to first entry.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 467 of file DLListBase.H.
References front().

|
inline |
Return last entry.
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 474 of file DLListBase.H.
References back().

|
inline |
Return const access to last entry.
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 481 of file DLListBase.H.
References back().

|
inline |
Add at front of list.
FOAM_DEPRECATED_FOR(2022-10, "push_front()")
Definition at line 488 of file DLListBase.H.
References push_front().

|
inline |
Add at back of list.
FOAM_DEPRECATED_FOR(2022-10, "push_back()")
Definition at line 495 of file DLListBase.H.
References push_back().

|
friend |
Definition at line 155 of file DLListBase.H.
|
friend |
Definition at line 158 of file DLListBase.H.