Commit eb73c692 authored by Mark Olesen's avatar Mark Olesen
Browse files

Added xfer<T> constructors for the various list-types

parent 27fce4fa
......@@ -92,6 +92,12 @@ CompactListList<T>::CompactListList(const UList<label>& rowSizes, const T& t)
}
template<class T>
CompactListList<T>::CompactListList(xfer<CompactListList<T> >& lst)
{
transfer(lst.ref());
}
template<class T>
CompactListList<T>::CompactListList(CompactListList<T>& cll, bool reUse)
:
......
......@@ -103,6 +103,9 @@ public:
//- Construct given list of row-sizes
CompactListList(const UList<label>& rowSizes, const T&);
//- Construct by transferring the parameter contents
CompactListList(xfer<CompactListList<T> >&);
//- Construct as copy or re-use as specified.
CompactListList(CompactListList<T>&, bool reUse);
......
......@@ -125,6 +125,14 @@ Foam::List<T>::List(const List<T>& a)
}
// Construct by transferring the parameter contents
template<class T>
Foam::List<T>::List(xfer<List<T> >& lst)
{
transfer(lst.ref());
}
// Construct as copy or re-use as specified.
template<class T>
Foam::List<T>::List(List<T>& a, bool reUse)
......
......@@ -43,6 +43,7 @@ SourceFiles
#include "UList.H"
#include "autoPtr.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -93,6 +94,9 @@ public:
//- Copy constructor.
List(const List<T>&);
//- Construct by transferring the parameter contents
List(xfer<List<T> >&);
//- Construct as copy or re-use as specified.
List(List<T>&, bool reUse);
......
......@@ -44,6 +44,7 @@ PackedList<nBits>::PackedList(const label size, const unsigned int val)
}
//- Copy constructor.
template<int nBits>
PackedList<nBits>::PackedList(const PackedList<nBits>& PList)
......@@ -53,6 +54,13 @@ PackedList<nBits>::PackedList(const PackedList<nBits>& PList)
{}
template<int nBits>
PackedList<nBits>::PackedList(xfer<PackedList<nBits> >& lst)
{
transfer(lst.ref());
}
//- Construct from labelList
template<int nBits>
PackedList<nBits>::PackedList(const labelList& lst)
......
......@@ -134,6 +134,9 @@ public:
//- Copy constructor.
PackedList(const PackedList<nBits>& PList);
//- Construct by transferring the parameter contents
PackedList(xfer<PackedList<nBits> >&);
//- Construct from labelList.
PackedList(const labelList&);
......
......@@ -71,6 +71,13 @@ Foam::PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg)
}
template<class T>
Foam::PtrList<T>::PtrList(xfer<PtrList<T> >& lst)
{
transfer(lst.ref());
}
template<class T>
Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reUse)
:
......
......@@ -129,6 +129,9 @@ public:
template<class CloneArg>
PtrList(const PtrList<T>&, const CloneArg&);
//- Construct by transferring the parameter contents
PtrList(xfer<PtrList<T> >&);
//- Construct as copy or re-use as specified.
PtrList(PtrList<T>&, bool reUse);
......
......@@ -50,6 +50,13 @@ UPtrList<T>::UPtrList(const label s)
{}
template<class T>
UPtrList<T>::UPtrList(xfer<UPtrList<T> >& lst)
{
transfer(lst.ref());
}
template<class T>
UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse)
:
......
......@@ -110,6 +110,9 @@ public:
//- Construct with length specified.
explicit UPtrList(const label);
//- Construct by transferring the parameter contents
UPtrList(xfer<UPtrList<T> >&);
//- Construct as copy or re-use as specified.
UPtrList(UPtrList<T>&, bool reUse);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment