diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C index 99f31c94ea..565cac9493 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C @@ -124,6 +124,14 @@ void Foam::ILList::clear() } +template +void Foam::ILList::transfer(ILList& lst) +{ + clear(); + LListBase::transfer(lst); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H index 0eace95f67..401a8b6038 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H @@ -139,6 +139,10 @@ public: //- Clear the contents of the list void clear(); + //- Transfer the contents of the argument into this List + // and annull the argument list. + void transfer(ILList&); + // Member operators diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C index c2fdb1b820..1c93142b41 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C @@ -65,6 +65,14 @@ void Foam::LList::clear() } +template +void Foam::LList::transfer(LList& lst) +{ + clear(); + LListBase::transfer(lst); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H index fdb589d53c..4c422f7ccb 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H @@ -200,6 +200,9 @@ public: //- Delete contents of list void clear(); + //- Transfer the contents of the argument into this List + // and annull the argument list. + void transfer(LList&); // Member operators diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C index f958b183ec..935e68292c 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C @@ -26,15 +26,10 @@ License #include "LPtrList.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -LPtrList::LPtrList(const LPtrList& lst) +Foam::LPtrList::LPtrList(const LPtrList& lst) : LList() { @@ -48,7 +43,7 @@ LPtrList::LPtrList(const LPtrList& lst) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -LPtrList::~LPtrList() +Foam::LPtrList::~LPtrList() { clear(); } @@ -56,9 +51,8 @@ LPtrList::~LPtrList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//- Return and remove head template -bool LPtrList::eraseHead() +bool Foam::LPtrList::eraseHead() { T* tPtr; if ((tPtr = this->removeHead())) @@ -74,7 +68,7 @@ bool LPtrList::eraseHead() template -void LPtrList::clear() +void Foam::LPtrList::clear() { label oldSize = this->size(); for (label i=0; i::clear() } +template +void Foam::LPtrList::transfer(LPtrList& lst) +{ + clear(); + LList::transfer(lst); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void LPtrList::operator=(const LPtrList& lst) +void Foam::LPtrList::operator=(const LPtrList& lst) { clear(); @@ -100,10 +102,6 @@ void LPtrList::operator=(const LPtrList& lst) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // #include "LPtrListIO.C" diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H index 601d26f876..fdb59ea27c 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H @@ -149,12 +149,16 @@ public: // Edit - //- Remove the head element specified from the list and delete it + //- Remove the head element from the list and delete the pointer bool eraseHead(); - //- Remove the specified element from the list and delete it + //- Clear the contents of the list void clear(); + //- Transfer the contents of the argument into this List + // and annull the argument list. + void transfer(LPtrList&); + // Member operators