mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
LinkedLists/accessTypes get transfer() method
This commit is contained in:
@ -124,6 +124,14 @@ void Foam::ILList<LListBase, T>::clear()
|
||||
}
|
||||
|
||||
|
||||
template<class LListBase, class T>
|
||||
void Foam::ILList<LListBase, T>::transfer(ILList<LListBase, T>& lst)
|
||||
{
|
||||
clear();
|
||||
LListBase::transfer(lst);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class LListBase, class T>
|
||||
|
||||
@ -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<LListBase, T>&);
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -65,6 +65,14 @@ void Foam::LList<LListBase, T>::clear()
|
||||
}
|
||||
|
||||
|
||||
template<class LListBase, class T>
|
||||
void Foam::LList<LListBase, T>::transfer(LList<LListBase, T>& lst)
|
||||
{
|
||||
clear();
|
||||
LListBase::transfer(lst);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class LListBase, class T>
|
||||
|
||||
@ -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<LListBase, T>&);
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -26,15 +26,10 @@ License
|
||||
|
||||
#include "LPtrList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class LListBase, class T>
|
||||
LPtrList<LListBase, T>::LPtrList(const LPtrList<LListBase, T>& lst)
|
||||
Foam::LPtrList<LListBase, T>::LPtrList(const LPtrList<LListBase, T>& lst)
|
||||
:
|
||||
LList<LListBase, T*>()
|
||||
{
|
||||
@ -48,7 +43,7 @@ LPtrList<LListBase, T>::LPtrList(const LPtrList<LListBase, T>& lst)
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class LListBase, class T>
|
||||
LPtrList<LListBase, T>::~LPtrList()
|
||||
Foam::LPtrList<LListBase, T>::~LPtrList()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@ -56,9 +51,8 @@ LPtrList<LListBase, T>::~LPtrList()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
//- Return and remove head
|
||||
template<class LListBase, class T>
|
||||
bool LPtrList<LListBase, T>::eraseHead()
|
||||
bool Foam::LPtrList<LListBase, T>::eraseHead()
|
||||
{
|
||||
T* tPtr;
|
||||
if ((tPtr = this->removeHead()))
|
||||
@ -74,7 +68,7 @@ bool LPtrList<LListBase, T>::eraseHead()
|
||||
|
||||
|
||||
template<class LListBase, class T>
|
||||
void LPtrList<LListBase, T>::clear()
|
||||
void Foam::LPtrList<LListBase, T>::clear()
|
||||
{
|
||||
label oldSize = this->size();
|
||||
for (label i=0; i<oldSize; i++)
|
||||
@ -86,10 +80,18 @@ void LPtrList<LListBase, T>::clear()
|
||||
}
|
||||
|
||||
|
||||
template<class LListBase, class T>
|
||||
void Foam::LPtrList<LListBase, T>::transfer(LPtrList<LListBase, T>& lst)
|
||||
{
|
||||
clear();
|
||||
LList<LListBase, T*>::transfer(lst);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class LListBase, class T>
|
||||
void LPtrList<LListBase, T>::operator=(const LPtrList<LListBase, T>& lst)
|
||||
void Foam::LPtrList<LListBase, T>::operator=(const LPtrList<LListBase, T>& lst)
|
||||
{
|
||||
clear();
|
||||
|
||||
@ -100,10 +102,6 @@ void LPtrList<LListBase, T>::operator=(const LPtrList<LListBase, T>& lst)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "LPtrListIO.C"
|
||||
|
||||
@ -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<LListBase, T>&);
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user