rename xfer<T> class to Xfer<T>

- The capitalization is consistent with most other template classes, but
  more importantly frees up xfer() for use as method name without needing
  special treatment to avoid ambiguities.

  It seems reasonable to have different names for transfer(...) and xfer()
  methods, since the transfer is occuring in different directions.
  The xfer() method can thus replace the recently introduced zero-parameter
  transfer() methods.
  Other name candidates (eg, yield, release, etc.) were deemed too abstract.
This commit is contained in:
Mark Olesen
2009-01-05 12:30:19 +01:00
parent 461ac4b4cc
commit 19503c93e1
98 changed files with 449 additions and 475 deletions

View File

@ -145,14 +145,22 @@ int main(int argc, char *argv[])
Info<< "<dlC>" << dlC << "</dlC>" << nl << "sizes: "
<< " " << dlC.size() << "/" << dlC.capacity() << endl;
List<label> lstB(dlC.transfer());
List<label> lstB(dlC.xfer());
Info<< "Transferred to normal list via the transfer() method" << endl;
Info<< "Transferred to normal list via the xfer() method" << endl;
Info<< "<lstB>" << lstB << "</lstB>" << nl << "sizes: "
<< " " << lstB.size() << endl;
Info<< "<dlC>" << dlC << "</dlC>" << nl << "sizes: "
<< " " << dlC.size() << "/" << dlC.capacity() << endl;
DynamicList<label> dlD(lstB.xfer());
Info<< "Transfer construct from normal list" << endl;
Info<< "<lstB>" << lstB << "</lstB>" << nl << "sizes: "
<< " " << lstB.size() << endl;
Info<< "<dlD>" << dlD << "</dlD>" << nl << "sizes: "
<< " " << dlD.size() << "/" << dlD.capacity() << endl;
return 0;
}

View File

@ -91,10 +91,10 @@ int main()
HASHTABLE_CLASS<double> table2(table1);
HASHTABLE_CLASS<double> table3(table1.transfer());
HASHTABLE_CLASS<double> table3(table1.xfer());
Info<< "\ncopy table1 -> table2" << nl
<< "transfer table1 -> table3 via the transfer() method" << nl;
<< "transfer table1 -> table3 via the xfer() method" << nl;
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table1 << nl

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
Info<< "table3: " << table3 << nl
<< "toc: " << table3.toc() << endl;
Map<label> table4(table3.transfer());
Map<label> table4(table3.xfer());
Info<< "table3: " << table3 << nl
<< "toc: " << table3.toc() << endl;

View File

@ -54,10 +54,10 @@ int main(int argc, char *argv[])
list2.setSize(10, vector(1, 2, 3));
Info<< list2 << endl;
List<vector> list3(list2.transfer());
Info<< "Transferred via the transfer() method" << endl;
Info<< list2 << endl;
Info<< list3 << endl;
List<vector> list3(list2.xfer());
Info<< "Transferred via the xfer() method" << endl;
Info<< list2 << nl
<< list3 << endl;
return 0;
}

View File

@ -104,8 +104,8 @@ int main(int argc, char *argv[])
Info<<"list1: " << list1 << endl;
PtrList<Scalar> list3(list1.transfer());
Info<< "Transferred via the transfer() method" << endl;
PtrList<Scalar> list3(list1.xfer());
Info<< "Transferred via the xfer() method" << endl;
Info<<"list1: " << list1 << endl;
Info<<"list2: " << list2 << endl;

View File

@ -91,10 +91,10 @@ int main()
HASHTABLE_CLASS<double> table2(table1);
HASHTABLE_CLASS<double> table3(table1.transfer());
HASHTABLE_CLASS<double> table3(table1.xfer());
Info<< "\ncopy table1 -> table2" << nl
<< "transfer table1 -> table3 via the transfer() method" << nl;
<< "transfer table1 -> table3 via the xfer() method" << nl;
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table1 << nl

View File

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
<< "keys: " << dict1.keys() << nl
<< "patterns: " << dict1.keys(true) << endl;
dictionary dict2(dict1.transfer());
dictionary dict2(dict1.xfer());
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl
<< "dict2.toc(): " << dict2.name() << " " << dict2.toc() << endl;

View File

@ -56,8 +56,8 @@ int main(int argc, char *argv[])
Info<< "lstA: " << lstA << endl;
Info<< "lstC: " << lstC << endl;
xfer<List<label> > xA = xferMove(lstA);
xfer<List<label> > xB;
Xfer<List<label> > xA = xferMove(lstA);
Xfer<List<label> > xB;
List<label> lstB( xA );
@ -112,8 +112,8 @@ int main(int argc, char *argv[])
Info<< "f1: " << f1 << endl;
Info<< "f2: " << f2 << endl;
// note: using xferMoveTo to ensure the correct transfer() method is called
face f3( xferMoveTo<labelList>(dl) );
// note: xfer() method returns a plain labelList
face f3( dl.xfer() );
Info<< "dl[" << dl.size() << "/" << dl.capacity() << "] " << dl << endl;
Info<< "f3: " << f3 << endl;

View File

@ -48,7 +48,7 @@ template
template<class> class FaceList,
class PointField
>
Foam::xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
@ -82,7 +82,7 @@ Foam::xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
template<class Face, template<class> class FaceList, class PointField>
Foam::xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
@ -184,7 +184,7 @@ Foam::xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
template<class Face, template<class> class FaceList, class PointField>
Foam::xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
Foam::Xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model

View File

@ -63,7 +63,7 @@ class extrudedMesh
//- Construct and return the extruded mesh points
template<class Face, template<class> class FaceList, class PointField>
xfer<pointField> extrudedPoints
Xfer<pointField> extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel&
@ -71,7 +71,7 @@ class extrudedMesh
//- Construct and return the extruded mesh faces
template<class Face, template<class> class FaceList, class PointField>
xfer<faceList> extrudedFaces
Xfer<faceList> extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel&
@ -79,7 +79,7 @@ class extrudedMesh
//- Construct and return the extruded mesh cells
template<class Face, template<class> class FaceList, class PointField>
xfer<cellList> extrudedCells
Xfer<cellList> extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel&

View File

@ -316,7 +316,7 @@ autoPtr<mapPolyMesh> reorderMesh
mesh.resetPrimitives
(
xfer<pointField>::null(),
Xfer<pointField>::null(),
xferMove(newFaces),
xferMove(newOwner),
xferMove(newNeighbour),

View File

@ -175,13 +175,10 @@ Istream& operator>>(Istream& is, HashPtrTable<T, Key, Hash>& L)
template<class T, class Key, class Hash>
Ostream& operator<<(Ostream& os, const HashPtrTable<T, Key, Hash>& L)
{
// Write size of HashPtrTable
os << nl << L.size();
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST << nl;
// Write beginning of contents
os << nl << token::BEGIN_LIST << nl;
// Write HashPtrTable contents
// Write contents
for
(
typename HashPtrTable<T, Key, Hash>::const_iterator iter = L.begin();
@ -192,7 +189,7 @@ Ostream& operator<<(Ostream& os, const HashPtrTable<T, Key, Hash>& L)
os << iter.key() << token::SPACE << *iter() << nl;
}
// Write end of contents
// Write end delimiter
os << token::END_LIST;
// Check state of IOstream

View File

@ -101,13 +101,13 @@ public:
{}
//- Construct by transferring the parameter contents
HashSet(const xfer<HashSet<Key, Hash> >& hs)
HashSet(const Xfer<HashSet<Key, Hash> >& hs)
:
HashTable<empty, Key, Hash>(hs)
{}
//- Construct by transferring the parameter contents
HashSet(const xfer<HashTable<empty, Key, Hash> >& hs)
HashSet(const Xfer<HashTable<empty, Key, Hash> >& hs)
:
HashTable<empty, Key, Hash>(hs)
{}

View File

@ -81,7 +81,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
template<class T, class Key, class Hash>
Foam::HashTable<T, Key, Hash>::HashTable
(
const xfer<HashTable<T, Key, Hash> >& ht
const Xfer<HashTable<T, Key, Hash> >& ht
)
:
HashTableName(),

View File

@ -41,7 +41,7 @@ SourceFiles
#include "label.H"
#include "word.H"
#include "className.H"
#include "xfer.H"
#include "Xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -156,7 +156,7 @@ public:
HashTable(const HashTable<T, Key, Hash>&);
//- Construct by transferring the parameter contents
HashTable(const xfer<HashTable<T, Key, Hash> >&);
HashTable(const Xfer<HashTable<T, Key, Hash> >&);
// Destructor
@ -214,8 +214,8 @@ public:
// and annull the argument table.
void transfer(HashTable<T, Key, Hash>&);
//- Transfer the contents to the xfer container
inline xfer<HashTable<T, Key, Hash> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<HashTable<T, Key, Hash> > xfer();
// Member Operators

View File

@ -74,12 +74,10 @@ inline bool Foam::HashTable<T, Key, Hash>::set
template<class T, class Key, class Hash>
inline Foam::xfer<Foam::HashTable<T, Key, Hash> >
Foam::HashTable<T, Key, Hash>::transfer()
inline Foam::Xfer<Foam::HashTable<T, Key, Hash> >
Foam::HashTable<T, Key, Hash>::xfer()
{
Foam::xfer<HashTable<T, Key, Hash> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -168,7 +168,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
template<class T, class Key, class Hash>
Foam::Ostream& Foam::operator<<(Ostream& os, const HashTable<T, Key, Hash>& L)
{
// Write size of HashTable and start contents delimiter
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST << nl;
// Write contents
@ -182,7 +182,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const HashTable<T, Key, Hash>& L)
os << iter.key() << token::SPACE << iter() << nl;
}
// Write end of contents delimiter
// Write end delimiter
os << token::END_LIST;
// Check state of IOstream

View File

@ -81,13 +81,13 @@ public:
{}
//- Construct by transferring the parameter contents
Map(const xfer<Map<T> >& map)
Map(const Xfer<Map<T> >& map)
:
HashTable<T, label, Hash<label> >(map)
{}
//- Construct by transferring the parameter contents
Map(const xfer<HashTable<T, label, Hash<label> > >& map)
Map(const Xfer<HashTable<T, label, Hash<label> > >& map)
:
HashTable<T, label, Hash<label> >(map)
{}

View File

@ -75,7 +75,7 @@ Foam::StaticHashTable<T, Key, Hash>::StaticHashTable
template<class T, class Key, class Hash>
Foam::StaticHashTable<T, Key, Hash>::StaticHashTable
(
const xfer<StaticHashTable<T, Key, Hash> >& ht
const Xfer<StaticHashTable<T, Key, Hash> >& ht
)
:
StaticHashTableName(),

View File

@ -47,7 +47,7 @@ SourceFiles
#include "label.H"
#include "word.H"
#include "className.H"
#include "xfer.H"
#include "Xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -150,7 +150,7 @@ public:
StaticHashTable(const StaticHashTable<T, Key, Hash>&);
//- Construct by transferring the parameter contents
StaticHashTable(const xfer<StaticHashTable<T, Key, Hash> >&);
StaticHashTable(const Xfer<StaticHashTable<T, Key, Hash> >&);
// Destructor
@ -207,8 +207,8 @@ public:
// and annull the argument table.
void transfer(StaticHashTable<T, Key, Hash>&);
//- Transfer the contents to the xfer container
inline xfer<StaticHashTable<T, Key, Hash> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<StaticHashTable<T, Key, Hash> > xfer();
// Member Operators

View File

@ -61,12 +61,10 @@ inline bool Foam::StaticHashTable<T, Key, Hash>::set
template<class T, class Key, class Hash>
inline Foam::xfer<Foam::StaticHashTable<T, Key, Hash> >
Foam::StaticHashTable<T, Key, Hash>::transfer()
inline Foam::Xfer<Foam::StaticHashTable<T, Key, Hash> >
Foam::StaticHashTable<T, Key, Hash>::xfer()
{
Foam::xfer<StaticHashTable<T, Key, Hash> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -180,7 +180,7 @@ Foam::Ostream& Foam::operator<<
Ostream& os,
const StaticHashTable<T, Key, Hash>& L)
{
// Write size of HashTable and start contents delimiter
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST << nl;
// Write contents
@ -194,7 +194,7 @@ Foam::Ostream& Foam::operator<<
os << iter.key() << token::SPACE << iter() << nl;
}
// Write end of contents delimiter
// Write end delimiter
os << token::END_LIST;
// Check state of IOstream

View File

@ -39,7 +39,6 @@ SourceFiles
#define Keyed_H
#include "List.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +48,6 @@ namespace Foam
// Forward declaration of friend functions and operators
template<class T> class Keyed;
template<class T> class xfer;
template<class T> Istream& operator>>(Istream&, Keyed<T>&);
template<class T> Ostream& operator<<(Ostream&, const Keyed<T>&);
@ -95,7 +93,7 @@ public:
inline Keyed(const T& item, const label key=0);
//- Construct by transferring the item, with a key
inline Keyed(const xfer<T>& item, const label key=0);
inline Keyed(const Xfer<T>& item, const label key=0);
//- Construct from Istream
inline Keyed(Istream&);

View File

@ -46,7 +46,7 @@ inline Foam::Keyed<T>::Keyed(const T& item, const label key)
template<class T>
inline Foam::Keyed<T>::Keyed(const xfer<T>& item, const label key)
inline Foam::Keyed<T>::Keyed(const Xfer<T>& item, const label key)
:
T(item),
key_(key)

View File

@ -26,8 +26,7 @@ Class
Foam::BiIndirectList
Description
Indexes into left list (negative index) or right list (zero or positive
index).
Indexes into negList (negative index) or posList (zero or positive index).
SourceFiles
BiIndirectListI.H
@ -82,8 +81,8 @@ public:
inline List<label>& addressing();
//- Calculate index given whether index is into posList or negList
inline static label posIndex(const label i);
inline static label negIndex(const label i);
inline static label posIndex(const label);
inline static label negIndex(const label);
// Member Operators

View File

@ -97,7 +97,7 @@ Foam::CompactListList<T>::CompactListList
template<class T>
Foam::CompactListList<T>::CompactListList
(
const xfer<CompactListList<T> >& lst
const Xfer<CompactListList<T> >& lst
)
{
transfer(lst());

View File

@ -104,7 +104,7 @@ public:
CompactListList(const UList<label>& rowSizes, const T&);
//- Construct by transferring the parameter contents
CompactListList(const xfer<CompactListList<T> >&);
CompactListList(const Xfer<CompactListList<T> >&);
//- Construct as copy or re-use as specified.
CompactListList(CompactListList<T>&, bool reUse);
@ -164,8 +164,8 @@ public:
// into this CompactListList and annull the argument list.
void transfer(CompactListList<T>&);
//- Transfer the contents to the xfer container
inline xfer<CompactListList<T> > transfer();
//- Transfer the contents to the Xfer container
inline Xfer<CompactListList<T> > xfer();
// Other

View File

@ -82,7 +82,7 @@ inline const Foam::List<Foam::label>& Foam::CompactListList<T>::offsets() const
template<class T>
inline Foam::List<label>& Foam::CompactListList<T>::offsets()
inline Foam::List<Foam::label>& Foam::CompactListList<T>::offsets()
{
return offsets_;
}
@ -127,7 +127,7 @@ inline Foam::label Foam::CompactListList<T>::whichRow(const label i) const
{
FatalErrorIn
(
"CompactListList<T>::whichRow(const label i) const"
"CompactListList<T>::whichRow(const label) const"
) << "Index " << i << " outside 0.." << m_.size()
<< abort(FatalError);
}
@ -156,12 +156,9 @@ inline Foam::label Foam::CompactListList<T>::whichColumn
template<class T>
inline Foam::xfer<Foam::CompactListList<T> >
Foam::CompactListList<T>::transfer()
inline Foam::Xfer<Foam::CompactListList<T> > Foam::CompactListList<T>::xfer()
{
Foam::xfer<CompactListList<T> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -104,6 +104,9 @@ public:
//- Construct from UList. Size set to UList size.
explicit inline DynamicList(const UList<T>&);
//- Construct by transferring the parameter contents
explicit inline DynamicList(const Xfer<List<T> >&);
//- Construct from Istream. Size set to size of read list.
explicit DynamicList(Istream&);
@ -153,8 +156,8 @@ public:
//- Transfer contents of the argument DynamicList into this DynamicList
inline void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
//- Transfer the contents to the xfer container as a plain List
inline xfer<List<T> > transfer();
//- Transfer contents to the Xfer container as a plain List
inline Xfer<List<T> > xfer();
// Member Operators

View File

@ -60,6 +60,18 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
const Xfer<List<T> >& lst
)
:
List<T>(lst),
capacity_(List<T>::size())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
@ -212,12 +224,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::xfer<Foam::List<T> >
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer()
inline Foam::Xfer<Foam::List<T> >
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
{
Foam::xfer<List<T> > xf;
xf().transfer(*this);
return xf;
return xferMoveTo<List<T> >(*this);
}

View File

@ -77,19 +77,15 @@ class FixedList
public:
//- Hashing function class
// Rotating hash from http://burtleburtle.net/bob/hash/doobs.html
template<class HashT=Hash<T> >
class Hash
:
public Foam::Hash<FixedList<T, Size> >
{
public:
inline Hash();
//- Rotating Hash. From http://burtleburtle.net/bob/hash/doobs.html.
label operator()(const FixedList<T, Size>&) const;
label operator()
(
const FixedList<T, Size>&,
@ -165,10 +161,10 @@ public:
void transfer(const FixedList<T, Size>&);
//- Write the FixedList as a dictionary entry
void writeEntry(Ostream& os) const;
void writeEntry(Ostream&) const;
//- Write the FixedList as a dictionary entry with keyword
void writeEntry(const word& keyword, Ostream& os) const;
void writeEntry(const word& keyword, Ostream&) const;
// Member operators

View File

@ -190,43 +190,42 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
if (uniform)
{
// Write size of list (so it is valid dictionary entry) and
// start contents delimiter
// Write size (so it is valid dictionary entry) and start delimiter
os << L.size() << token::BEGIN_BLOCK;
// Write list contents
// Write contents
os << L[0];
// Write end of contents delimiter
// Write end delimiter
os << token::END_BLOCK;
}
else if (Size < 11 && contiguous<T>())
{
// Write start of contents delimiter
// Write start delimiter
os << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
if (i > 0) os << token::SPACE;
os << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << token::END_LIST;
}
else
{
// Write start of contents delimiter
// Write start delimiter
os << nl << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
os << nl << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << nl << token::END_LIST << nl;
}
}

View File

@ -45,7 +45,7 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class Histogram Declaration
Class Histogram Declaration
\*---------------------------------------------------------------------------*/
template<class List>

View File

@ -72,7 +72,7 @@ Foam::List<T>::List(const label s, const T& a)
{
if (this->size_ < 0)
{
FatalErrorIn("List<T>::List(const label size, const T a)")
FatalErrorIn("List<T>::List(const label size, const T&)")
<< "bad size " << this->size_
<< abort(FatalError);
}
@ -127,7 +127,7 @@ Foam::List<T>::List(const List<T>& a)
// Construct by transferring the parameter contents
template<class T>
Foam::List<T>::List(const xfer<List<T> >& lst)
Foam::List<T>::List(const Xfer<List<T> >& lst)
{
transfer(lst());
}

View File

@ -43,7 +43,7 @@ SourceFiles
#include "UList.H"
#include "autoPtr.H"
#include "xfer.H"
#include "Xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -102,7 +102,7 @@ public:
List(const List<T>&);
//- Construct by transferring the parameter contents
List(const xfer<List<T> >&);
List(const Xfer<List<T> >&);
//- Construct as copy or re-use as specified.
List(List<T>&, bool reUse);
@ -178,8 +178,8 @@ public:
// and annull the argument list.
void transfer(SortableList<T>&);
//- Transfer the contents to the xfer container
inline xfer<List<T> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<List<T> > xfer();
//- Return subscript-checked element of UList.
inline T& newElmt(const label);

View File

@ -67,11 +67,9 @@ inline Foam::label Foam::List<T>::size() const
template<class T>
inline Foam::xfer<Foam::List<T> > Foam::List<T>::transfer()
inline Foam::Xfer<Foam::List<T> > Foam::List<T>::xfer()
{
Foam::xfer<List<T> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -47,7 +47,7 @@ Foam::PackedList<nBits>::PackedList(const PackedList<nBits>& lst)
template<int nBits>
Foam::PackedList<nBits>::PackedList(const xfer<PackedList<nBits> >& lst)
Foam::PackedList<nBits>::PackedList(const Xfer<PackedList<nBits> >& lst)
{
transfer(lst());
}

View File

@ -135,7 +135,7 @@ public:
PackedList(const PackedList<nBits>& PList);
//- Construct by transferring the parameter contents
PackedList(const xfer<PackedList<nBits> >&);
PackedList(const Xfer<PackedList<nBits> >&);
//- Construct from a list of labels
PackedList(const UList<label>&);
@ -157,8 +157,8 @@ public:
// and annull the argument list.
void transfer(PackedList<nBits>&);
//- Transfer the contents to the xfer container
inline xfer<PackedList<nBits> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<PackedList<nBits> > xfer();
// Access

View File

@ -187,12 +187,10 @@ inline Foam::List<unsigned int>& Foam::PackedList<nBits>::storage()
template<int nBits>
inline Foam::xfer<Foam::PackedList<nBits> >
Foam::PackedList<nBits>::transfer()
inline Foam::Xfer<Foam::PackedList<nBits> >
Foam::PackedList<nBits>::xfer()
{
Foam::xfer<PackedList<nBits> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -72,7 +72,7 @@ Foam::PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg)
template<class T>
Foam::PtrList<T>::PtrList(const xfer<PtrList<T> >& lst)
Foam::PtrList<T>::PtrList(const Xfer<PtrList<T> >& lst)
{
transfer(lst());
}

View File

@ -130,7 +130,7 @@ public:
PtrList(const PtrList<T>&, const CloneArg&);
//- Construct by transferring the parameter contents
PtrList(const xfer<PtrList<T> >&);
PtrList(const Xfer<PtrList<T> >&);
//- Construct as copy or re-use as specified.
PtrList(PtrList<T>&, bool reUse);
@ -175,8 +175,8 @@ public:
// and annull the argument list.
void transfer(PtrList<T>&);
//- Transfer the contents to the xfer container
inline xfer<PtrList<T> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<PtrList<T> > xfer();
//- Is element set
inline bool set(const label) const;

View File

@ -79,11 +79,9 @@ inline Foam::autoPtr<T> Foam::PtrList<T>::set
template<class T>
inline Foam::xfer<Foam::PtrList<T> > Foam::PtrList<T>::transfer()
inline Foam::Xfer<Foam::PtrList<T> > Foam::PtrList<T>::xfer()
{
Foam::xfer<PtrList<T> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -36,13 +36,13 @@ template<class T>
template<class INew>
void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
{
is.fatalCheck("PtrList<T>::read(Istream& is, const INew& inewt)");
is.fatalCheck("PtrList<T>::read(Istream&, const INew&)");
token firstToken(is);
is.fatalCheck
(
"PtrList<T>::read(Istream& is, const INew& inewt) : "
"PtrList<T>::read(Istream&, const INew&) : "
"reading first token"
);
@ -66,7 +66,7 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
is.fatalCheck
(
"PtrList<T>::read(Istream& is, const INew& inewt) : "
"PtrList<T>::read(Istream&, const INew&) : "
"reading entry"
);
}
@ -78,7 +78,7 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
is.fatalCheck
(
"PtrList<T>::read(Istream& is, const INew& inewt) : "
"PtrList<T>::read(Istream&, const INew&) : "
"reading the single entry"
);
@ -98,7 +98,7 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
{
FatalIOErrorIn
(
"PtrList<T>::read(Istream& is, const INew& inewt)",
"PtrList<T>::read(Istream&, const INew&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
@ -137,7 +137,7 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
{
FatalIOErrorIn
(
"PtrList<T>::read(Istream& is, const INew& inewt)",
"PtrList<T>::read(Istream&, const INew&)",
is
) << "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
@ -180,16 +180,16 @@ Foam::Istream& Foam::operator>>(Istream& is, PtrList<T>& L)
template<class T>
Foam::Ostream& Foam::operator<<(Ostream& os, const PtrList<T>& L)
{
// Write size of list and start contents delimiter
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
os << nl << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << nl << token::END_LIST << nl;
// Check state of IOstream

View File

@ -26,8 +26,8 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template <class Type>
void Foam::SortableList<Type>::sortIndices(List<label>& ind) const
template<class T>
void Foam::SortableList<T>::sortIndices(List<label>& ind) const
{
// list lengths must be identical
ind.setSize(this->size());
@ -37,53 +37,53 @@ void Foam::SortableList<Type>::sortIndices(List<label>& ind) const
ind[i] = i;
}
Foam::stableSort(ind, typename UList<Type>::less(*this));
Foam::stableSort(ind, typename UList<T>::less(*this));
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class Type>
Foam::SortableList<Type>::SortableList()
template<class T>
Foam::SortableList<T>::SortableList()
{}
template <class Type>
Foam::SortableList<Type>::SortableList(const UList<Type>& values)
template<class T>
Foam::SortableList<T>::SortableList(const UList<T>& values)
:
List<Type>(values)
List<T>(values)
{
sort();
}
template <class Type>
Foam::SortableList<Type>::SortableList(const xfer<List<Type> >& values)
template<class T>
Foam::SortableList<T>::SortableList(const Xfer<List<T> >& values)
:
List<Type>(values)
List<T>(values)
{
sort();
}
template <class Type>
Foam::SortableList<Type>::SortableList(const label size)
template<class T>
Foam::SortableList<T>::SortableList(const label size)
:
List<Type>(size)
List<T>(size)
{}
template <class Type>
Foam::SortableList<Type>::SortableList(const label size, const Type& val)
template<class T>
Foam::SortableList<T>::SortableList(const label size, const T& val)
:
List<Type>(size, val)
List<T>(size, val)
{}
template <class Type>
Foam::SortableList<Type>::SortableList(const SortableList<Type>& lst)
template<class T>
Foam::SortableList<T>::SortableList(const SortableList<T>& lst)
:
List<Type>(lst),
List<T>(lst),
indices_(lst.indices())
{}
@ -91,83 +91,81 @@ Foam::SortableList<Type>::SortableList(const SortableList<Type>& lst)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Type>
void Foam::SortableList<Type>::clear()
template<class T>
void Foam::SortableList<T>::clear()
{
List<Type>::clear();
List<T>::clear();
indices_.clear();
}
template <class Type>
Foam::List<Type>& Foam::SortableList<Type>::shrink()
template<class T>
Foam::List<T>& Foam::SortableList<T>::shrink()
{
indices_.clear();
return static_cast<List<Type>&>(*this);
return static_cast<List<T>&>(*this);
}
template <class Type>
void Foam::SortableList<Type>::sort()
template<class T>
void Foam::SortableList<T>::sort()
{
sortIndices(indices_);
List<Type> lst(this->size());
List<T> lst(this->size());
forAll(indices_, i)
{
lst[i] = this->operator[](indices_[i]);
}
List<Type>::transfer(lst);
List<T>::transfer(lst);
}
template <class Type>
void Foam::SortableList<Type>::reverseSort()
template<class T>
void Foam::SortableList<T>::reverseSort()
{
sortIndices(indices_);
List<Type> lst(this->size());
List<T> lst(this->size());
label endI = indices_.size();
forAll(indices_, i)
{
lst[--endI] = this->operator[](indices_[i]);
}
List<Type>::transfer(lst);
List<T>::transfer(lst);
}
template <class Type>
Foam::xfer<Foam::List<Type> > Foam::SortableList<Type>::transfer()
template<class T>
Foam::Xfer<Foam::List<T> > Foam::SortableList<T>::xfer()
{
Foam::xfer<List<T> > xf;
xf().transfer(*this);
return xf;
return xferMoveTo<List<T> >(*this);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template <class Type>
inline void Foam::SortableList<Type>::operator=(const Type& t)
template<class T>
inline void Foam::SortableList<T>::operator=(const T& t)
{
UList<Type>::operator=(t);
UList<T>::operator=(t);
}
template <class Type>
inline void Foam::SortableList<Type>::operator=(const UList<Type>& rhs)
template<class T>
inline void Foam::SortableList<T>::operator=(const UList<T>& rhs)
{
List<Type>::operator=(rhs);
List<T>::operator=(rhs);
indices_.clear();
}
template <class Type>
inline void Foam::SortableList<Type>::operator=(const SortableList<Type>& rhs)
template<class T>
inline void Foam::SortableList<T>::operator=(const SortableList<T>& rhs)
{
List<Type>::operator=(rhs);
List<T>::operator=(rhs);
indices_ = rhs.indices();
}

View File

@ -50,10 +50,10 @@ namespace Foam
Class SortableList Declaration
\*---------------------------------------------------------------------------*/
template <class Type>
template<class T>
class SortableList
:
public List<Type>
public List<T>
{
// Private data
@ -71,10 +71,10 @@ public:
SortableList();
//- Construct from UList, sorting immediately.
explicit SortableList(const UList<Type>&);
explicit SortableList(const UList<T>&);
//- Construct from transferred List, sorting immediately.
explicit SortableList(const xfer<List<Type> >&);
explicit SortableList(const Xfer<List<T> >&);
//- Construct given size. Sort later on.
// The indices remain empty until the list is sorted
@ -82,10 +82,10 @@ public:
//- Construct given size and initial value. Sort later on.
// The indices remain empty until the list is sorted
SortableList(const label size, const Type&);
SortableList(const label size, const T&);
//- Construct as copy.
SortableList(const SortableList<Type>&);
SortableList(const SortableList<T>&);
// Member Functions
@ -106,7 +106,7 @@ public:
void clear();
//- Clear the indices and return a reference to the underlying List
List<Type>& shrink();
List<T>& shrink();
//- (stable) sort the list (if changed after construction time)
// also resizes the indices as required
@ -115,19 +115,20 @@ public:
//- Reverse (stable) sort the list
void reverseSort();
//- Transfer the contents to the xfer container as a plain List
inline Foam::xfer<List<T> > transfer();
//- Transfer contents to the Xfer container as a plain List
inline Xfer<List<T> > xfer();
// Member Operators
//- Assignment of all entries to the given value
inline void operator=(const Type&);
inline void operator=(const T&);
//- Assignment from UList operator. Takes linear time.
inline void operator=(const UList<Type>&);
inline void operator=(const UList<T>&);
//- Assignment operator. Takes linear time.
inline void operator=(const SortableList<Type>&);
inline void operator=(const SortableList<T>&);
};

View File

@ -61,14 +61,14 @@ public:
// Constructors
//- Construct from UList and SubList size
//- Construct from UList and sub-list size
inline SubList
(
const UList<T>& list,
const label subSize
);
//- Construct from UList, start and end indices
//- Construct from UList, sub-list size and start index
inline SubList
(
const UList<T>& list,

View File

@ -51,18 +51,12 @@ SourceFiles
namespace Foam
{
//- Pre-declare related List type
template<class T>
class List;
//- Pre-declare related SubList type
template<class T>
class SubList;
// Forward declaration of friend classes
template<class T> class List;
template<class T> class SubList;
// Forward declaration of friend functions and operators
template<class T> class UList;
template<class T> Ostream& operator<<(Ostream&, const UList<T>&);
@ -157,10 +151,10 @@ public:
//- Write the UList as a dictionary entry.
void writeEntry(Ostream& os) const;
void writeEntry(Ostream&) const;
//- Write the UList as a dictionary entry with keyword.
void writeEntry(const word& keyword, Ostream& os) const;
void writeEntry(const word& keyword, Ostream&) const;
//- Assign elements to those from UList.
void assign(const UList<T>&);
@ -306,11 +300,11 @@ public:
// Reverse the first n elements of the list
template<class T>
inline void reverse(UList<T>& ul, const label n);
inline void reverse(UList<T>&, const label n);
// Reverse all the elements of the list
template<class T>
inline void reverse(UList<T>& ul);
inline void reverse(UList<T>&);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -83,42 +83,42 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
if (uniform)
{
// Write size of list and start contents delimiter
// Write size and start delimiter
os << L.size() << token::BEGIN_BLOCK;
// Write list contents
// Write contents
os << L[0];
// Write end of contents delimiter
// Write end delimiter
os << token::END_BLOCK;
}
else if (L.size() < 11 && contiguous<T>())
{
// Write size of list and start contents delimiter
// Write size and start delimiter
os << L.size() << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
if (i > 0) os << token::SPACE;
os << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << token::END_LIST;
}
else
{
// Write size of list and start contents delimiter
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
os << nl << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << nl << token::END_LIST << nl;
}
}

View File

@ -29,36 +29,31 @@ License
#include "UPtrList.H"
#include "PtrListLoopM.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class T>
UPtrList<T>::UPtrList()
Foam::UPtrList<T>::UPtrList()
:
ptrs_()
{}
template<class T>
UPtrList<T>::UPtrList(const label s)
Foam::UPtrList<T>::UPtrList(const label s)
:
ptrs_(s, reinterpret_cast<T*>(NULL))
{}
template<class T>
UPtrList<T>::UPtrList(const xfer<UPtrList<T> >& lst)
Foam::UPtrList<T>::UPtrList(const Xfer<UPtrList<T> >& lst)
{
transfer(lst());
}
template<class T>
UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse)
Foam::UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse)
:
ptrs_(a.ptrs_, reUse)
{}
@ -67,11 +62,11 @@ UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
void UPtrList<T>::setSize(const label newSize)
void Foam::UPtrList<T>::setSize(const label newSize)
{
label oldSize = size();
if (newSize == 0)
if (newSize <= 0)
{
clear();
}
@ -83,8 +78,8 @@ void UPtrList<T>::setSize(const label newSize)
{
ptrs_.setSize(newSize);
register label i;
for (i=oldSize; i<newSize; i++)
// set new elements to NULL
for (register label i=oldSize; i<newSize; i++)
{
ptrs_[i] = NULL;
}
@ -93,7 +88,7 @@ void UPtrList<T>::setSize(const label newSize)
template<class T>
void UPtrList<T>::clear()
void Foam::UPtrList<T>::clear()
{
ptrs_.clear();
}
@ -102,14 +97,14 @@ void UPtrList<T>::clear()
// Transfer the contents of the argument List into this List
// and anull the argument list
template<class T>
void UPtrList<T>::transfer(UPtrList<T>& a)
void Foam::UPtrList<T>::transfer(UPtrList<T>& a)
{
ptrs_.transfer(a.ptrs_);
}
template<class T>
void UPtrList<T>::reorder(const UList<label>& oldToNew)
void Foam::UPtrList<T>::reorder(const UList<label>& oldToNew)
{
if (oldToNew.size() != size())
{
@ -156,10 +151,6 @@ void UPtrList<T>::reorder(const UList<label>& oldToNew)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "UPtrListIO.C"

View File

@ -111,7 +111,7 @@ public:
explicit UPtrList(const label);
//- Construct by transferring the parameter contents
UPtrList(const xfer<UPtrList<T> >&);
UPtrList(const Xfer<UPtrList<T> >&);
//- Construct as copy or re-use as specified.
UPtrList(UPtrList<T>&, bool reUse);
@ -139,8 +139,8 @@ public:
// UPtrList and annull the argument list.
void transfer(UPtrList<T>&);
//- Transfer the contents to the xfer container
inline xfer<UPtrList<T> > transfer();
//- Transfer contents to the Xfer container
inline Xfer<UPtrList<T> > xfer();
//- Is element set
inline bool set(const label) const;

View File

@ -51,11 +51,9 @@ inline T* Foam::UPtrList<T>::set(const label i, T* ptr)
}
template<class T>
inline Foam::xfer<Foam::UPtrList<T> > Foam::UPtrList<T>::transfer()
inline Foam::Xfer<Foam::UPtrList<T> > Foam::UPtrList<T>::xfer()
{
Foam::xfer<UPtrList<T> > xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -32,16 +32,16 @@ License
template<class T>
Foam::Ostream& Foam::operator<<(Ostream& os, const UPtrList<T>& L)
{
// Write size of list and start contents delimiter
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST;
// Write list contents
// Write contents
forAll(L, i)
{
os << nl << L[i];
}
// Write end of contents delimiter
// Write end delimiter
os << nl << token::END_LIST << nl;
// Check state of IOstream

View File

@ -40,7 +40,7 @@ Foam::NamedEnum<Enum, nEnum>::NamedEnum()
{
stringList goodNames(i);
for (label j = 0; j < i; j++)
for (int j = 0; j < i; j++)
{
goodNames[j] = names[j];
}
@ -70,10 +70,9 @@ Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const
{
FatalIOErrorIn
(
"NamedEnum<Enum, nEnum>::read(Istream& is) const",
is
) << name << " is not in enumeration " << toc()
<< exit(FatalIOError);
"NamedEnum<Enum, nEnum>::read(Istream&) const", is
) << name << " is not in enumeration: "
<< toc() << exit(FatalIOError);
}
return Enum(iter());
@ -83,7 +82,7 @@ Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const
template<class Enum, int nEnum>
void Foam::NamedEnum<Enum, nEnum>::write(const Enum e, Ostream& os) const
{
os << operator[](e);
os << operator[](e);
}

View File

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class NamedEnum Declaration
Class NamedEnum Declaration
\*---------------------------------------------------------------------------*/
template<class Enum, int nEnum>
@ -79,10 +79,10 @@ public:
//- Read a word from Istream and return the corresponding
// enumeration element
Enum read(Istream& is) const;
Enum read(Istream&) const;
//- Write the name representation of the enumeration to an Ostream
void write(const Enum e, Ostream& os) const;
void write(const Enum e, Ostream&) const;
// Member Operators

View File

@ -88,7 +88,7 @@ Foam::IOField<Type>::IOField(const IOobject& io, const Field<Type>& f)
template<class Type>
Foam::IOField<Type>::IOField(const IOobject& io, const xfer<Field<Type> >& f)
Foam::IOField<Type>::IOField(const IOobject& io, const Xfer<Field<Type> >& f)
:
regIOobject(io)
{

View File

@ -72,7 +72,7 @@ public:
IOField(const IOobject&, const Field<Type>&);
//- Construct by transferring the Field contents
IOField(const IOobject&, const xfer<Field<Type> >&);
IOField(const IOobject&, const Xfer<Field<Type> >&);
// Destructor

View File

@ -88,7 +88,7 @@ Foam::IOList<T>::IOList(const IOobject& io, const List<T>& list)
template<class T>
Foam::IOList<T>::IOList(const IOobject& io, const xfer<List<T> >& list)
Foam::IOList<T>::IOList(const IOobject& io, const Xfer<List<T> >& list)
:
regIOobject(io)
{

View File

@ -73,7 +73,7 @@ public:
IOList(const IOobject&, const List<T>&);
//- Construct by transferring the List contents
IOList(const IOobject&, const xfer<List<T> >&);
IOList(const IOobject&, const Xfer<List<T> >&);
// Destructor

View File

@ -87,7 +87,7 @@ Foam::IOMap<T>::IOMap(const IOobject& io, const Map<T>& map)
template<class T>
Foam::IOMap<T>::IOMap(const IOobject& io, const xfer<Map<T> >& map)
Foam::IOMap<T>::IOMap(const IOobject& io, const Xfer<Map<T> >& map)
:
regIOobject(io)
{

View File

@ -73,7 +73,7 @@ public:
IOMap(const IOobject&, const Map<T>&);
//- Construct by transferring the Map contents
IOMap(const IOobject&, const xfer<Map<T> >&);
IOMap(const IOobject&, const Xfer<Map<T> >&);
// Destructor

View File

@ -85,7 +85,7 @@ Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const PtrList<T>& list)
template<class T>
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const xfer<PtrList<T> >& list)
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const Xfer<PtrList<T> >& list)
:
regIOobject(io)
{

View File

@ -74,7 +74,7 @@ public:
IOPtrList(const IOobject&, const PtrList<T>&);
//- Construct by transferring the PtrList contents
IOPtrList(const IOobject&, const xfer<PtrList<T> >&);
IOPtrList(const IOobject&, const Xfer<PtrList<T> >&);
// Destructor

View File

@ -170,7 +170,7 @@ Foam::dictionary::dictionary
Foam::dictionary::dictionary
(
const dictionary& parentDict,
const xfer<dictionary>& dict
const Xfer<dictionary>& dict
)
:
parent_(parentDict)
@ -181,7 +181,7 @@ Foam::dictionary::dictionary
Foam::dictionary::dictionary
(
const xfer<dictionary>& dict
const Xfer<dictionary>& dict
)
:
parent_(dictionary::null)
@ -832,11 +832,9 @@ void Foam::dictionary::transfer(dictionary& dict)
}
Foam::xfer<Foam::dictionary> Foam::dictionary::transfer()
Foam::Xfer<Foam::dictionary> Foam::dictionary::xfer()
{
Foam::xfer<dictionary> xf;
xf().transfer(*this);
return xf;
return xferMove(*this);
}

View File

@ -167,10 +167,10 @@ public:
dictionary(const dictionary&);
//- Construct by transferring parameter contents given parent dictionary
dictionary(const dictionary& parentDict, const xfer<dictionary>&);
dictionary(const dictionary& parentDict, const Xfer<dictionary>&);
//- Construct top-level dictionary by transferring parameter contents
dictionary(const xfer<dictionary>&);
dictionary(const Xfer<dictionary>&);
//- Construct and return clone
autoPtr<dictionary> clone() const;
@ -394,8 +394,8 @@ public:
//- Transfer the contents of the argument and annull the argument.
void transfer(dictionary&);
//- Transfer the contents to the xfer container
xfer<dictionary> transfer();
//- Transfer contents to the Xfer container
Xfer<dictionary> xfer();
// Write

View File

@ -141,7 +141,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
template<class Type, class GeoMesh>
DimensionedField<Type, GeoMesh>::DimensionedField
(
const xfer<DimensionedField<Type, GeoMesh> >& df
const Xfer<DimensionedField<Type, GeoMesh> >& df
)
:
regIOobject(df(), true),
@ -219,7 +219,7 @@ template<class Type, class GeoMesh>
DimensionedField<Type, GeoMesh>::DimensionedField
(
const word& newName,
const xfer<DimensionedField<Type, GeoMesh> >& df
const Xfer<DimensionedField<Type, GeoMesh> >& df
)
:
regIOobject(IOobject(newName, df->time().timeName(), df->db())),

View File

@ -159,7 +159,7 @@ public:
//- Construct by transferring the DimensionedField
DimensionedField
(
const xfer<DimensionedField<Type, GeoMesh> >&
const Xfer<DimensionedField<Type, GeoMesh> >&
);
//- Construct as copy of tmp<DimensionedField> deleting argument
@ -196,7 +196,7 @@ public:
DimensionedField
(
const word& newName,
const xfer<DimensionedField<Type, GeoMesh> >&
const Xfer<DimensionedField<Type, GeoMesh> >&
);
//- Construct as copy resetting name

View File

@ -37,7 +37,6 @@ SourceFiles
#define FieldField_H
#include "tmp.H"
#include "xfer.H"
#include "PtrList.H"
#include "scalar.H"
#include "direction.H"

View File

@ -156,7 +156,7 @@ Field<Type>::Field(Field<Type>& f, bool reUse)
template<class Type>
Field<Type>::Field(const xfer<Field<Type> >& f)
Field<Type>::Field(const Xfer<Field<Type> >& f)
:
List<Type>(f)
{}

View File

@ -43,7 +43,6 @@ SourceFiles
#define Field_H
#include "tmp.H"
#include "xfer.H"
#include "direction.H"
#include "VectorSpace.H"
#include "scalarList.H"
@ -166,7 +165,7 @@ public:
Field(Field<Type>&, bool reUse);
//- Construct by transferring the Field contents
Field(const xfer<Field<Type> >&);
Field(const Xfer<Field<Type> >&);
//- Construct as copy of subField
Field(const typename Field<Type>::subField&);

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::xfer
Foam::Xfer
Description
A simple container for copying or transferring objects of type \<T\>.
@ -31,9 +31,9 @@ Description
The wrapped object of type \<T\> must implement a transfer() method and
an operator=() copy method.
Since it is decided upon construction of the xfer object whether the
Since it is decided upon construction of the Xfer object whether the
parameter is to be copied or transferred, the contents of the resulting
xfer object can be transferred unconditionally. This greatly simplifies
Xfer object can be transferred unconditionally. This greatly simplifies
defining constructors or methods in other classes with mixed
transfer/copy semantics without requiring 2^N different versions.
@ -54,12 +54,12 @@ SeeAlso
xferCopy, xferCopyTo, xferMove, xferMoveTo, xferTmp
SourceFiles
xferI.H
XferI.H
\*---------------------------------------------------------------------------*/
#ifndef xfer_H
#define xfer_H
#ifndef Xfer_H
#define Xfer_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -70,11 +70,11 @@ namespace Foam
template<class T> class tmp;
/*---------------------------------------------------------------------------*\
Class xfer Declaration
Class Xfer Declaration
\*---------------------------------------------------------------------------*/
template<class T>
class xfer
class Xfer
{
// Private data
@ -87,25 +87,25 @@ public:
//- Store object pointer and manage its deletion
// Can also be used later to transfer by assignment
inline explicit xfer(T* = 0);
inline explicit Xfer(T* = 0);
//- Construct by copying or by transferring the parameter contents
inline explicit xfer(T&, bool allowTransfer=false);
inline explicit Xfer(T&, bool allowTransfer=false);
//- Construct by copying the parameter contents
inline explicit xfer(const T&);
inline explicit Xfer(const T&);
//- Construct by transferring the contents
inline xfer(const xfer<T>&);
inline Xfer(const Xfer<T>&);
// Destructor
inline ~xfer();
inline ~Xfer();
// Member Functions
//- Return a null object reference
inline static const xfer<T>& null();
inline static const Xfer<T>& null();
// Member Operators
@ -113,7 +113,7 @@ public:
inline void operator=(T&);
//- Transfer the contents into the object
inline void operator=(const xfer<T>&);
inline void operator=(const Xfer<T>&);
//- Reference to the underlying datatype
inline T& operator()() const;
@ -129,37 +129,37 @@ public:
/**
* Construct by copying the contents of the @a arg
*
* @sa xferCopyTo, xferMove, xferMoveTo, xferTmp and Foam::xfer
* @sa xferCopyTo, xferMove, xferMoveTo, xferTmp and Foam::Xfer
*/
template<class T>
inline xfer<T> xferCopy(const T&);
inline Xfer<T> xferCopy(const T&);
/**
* Construct by transferring the contents of the @a arg
*
* @sa xferCopy, xferCopyTo, xferMoveTo, xferTmp and Foam::xfer
* @sa xferCopy, xferCopyTo, xferMoveTo, xferTmp and Foam::Xfer
*/
template<class T>
inline xfer<T> xferMove(T&);
inline Xfer<T> xferMove(T&);
/**
* Construct by transferring the contents of the @a arg
*
* @sa xferCopy, xferCopyTo, xferMove, xferMoveTo and Foam::xfer
* @sa xferCopy, xferCopyTo, xferMove, xferMoveTo and Foam::Xfer
*/
template<class T>
inline xfer<T> xferTmp(Foam::tmp<T>&);
inline Xfer<T> xferTmp(Foam::tmp<T>&);
/**
* Construct by copying the contents of the @a arg
* between dissimilar types
*
* @sa xferCopy, xferMove, xferMoveTo, xferTmp and Foam::xfer
* @sa xferCopy, xferMove, xferMoveTo, xferTmp and Foam::Xfer
*/
template<class To, class From>
inline xfer<To> xferCopyTo(const From&);
inline Xfer<To> xferCopyTo(const From&);
/**
@ -173,10 +173,10 @@ inline xfer<To> xferCopyTo(const From&);
* labelList plainLst( xferMoveTo<labelList>(dynLst) );
* @endcode
*
* @sa xferCopy, xferCopyTo, xferMove, xferTmp and Foam::xfer
* @sa xferCopy, xferCopyTo, xferMove, xferTmp and Foam::Xfer
*/
template<class To, class From>
inline xfer<To> xferMoveTo(From&);
inline Xfer<To> xferMoveTo(From&);
} // End namespace Foam
@ -184,7 +184,7 @@ inline xfer<To> xferMoveTo(From&);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "xferI.H"
#include "XferI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -27,14 +27,14 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T>
inline Foam::xfer<T>::xfer(T* p)
inline Foam::Xfer<T>::Xfer(T* p)
:
ptr_(p ? p : new T)
{}
template<class T>
inline Foam::xfer<T>::xfer(T& t, bool allowTransfer)
inline Foam::Xfer<T>::Xfer(T& t, bool allowTransfer)
:
ptr_(new T)
{
@ -50,7 +50,7 @@ inline Foam::xfer<T>::xfer(T& t, bool allowTransfer)
template<class T>
inline Foam::xfer<T>::xfer(const T& t)
inline Foam::Xfer<T>::Xfer(const T& t)
:
ptr_(new T)
{
@ -59,7 +59,7 @@ inline Foam::xfer<T>::xfer(const T& t)
template<class T>
inline Foam::xfer<T>::xfer(const xfer<T>& t)
inline Foam::Xfer<T>::Xfer(const Xfer<T>& t)
:
ptr_(new T)
{
@ -70,7 +70,7 @@ inline Foam::xfer<T>::xfer(const xfer<T>& t)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class T>
inline Foam::xfer<T>::~xfer()
inline Foam::Xfer<T>::~Xfer()
{
delete ptr_;
ptr_ = 0;
@ -80,9 +80,9 @@ inline Foam::xfer<T>::~xfer()
// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
template<class T>
inline const Foam::xfer<T>& Foam::xfer<T>::null()
inline const Foam::Xfer<T>& Foam::Xfer<T>::null()
{
xfer<T>* nullPtr = reinterpret_cast<xfer<T>*>(0);
Xfer<T>* nullPtr = reinterpret_cast<Xfer<T>*>(0);
return *nullPtr;
}
@ -90,14 +90,14 @@ inline const Foam::xfer<T>& Foam::xfer<T>::null()
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
inline void Foam::xfer<T>::operator=(T& t)
inline void Foam::Xfer<T>::operator=(T& t)
{
ptr_->transfer(t);
}
template<class T>
inline void Foam::xfer<T>::operator=(const xfer<T>& t)
inline void Foam::Xfer<T>::operator=(const Xfer<T>& t)
{
// silently ignore attempted copy to self
if (this != &t)
@ -108,14 +108,14 @@ inline void Foam::xfer<T>::operator=(const xfer<T>& t)
template<class T>
inline T& Foam::xfer<T>::operator()() const
inline T& Foam::Xfer<T>::operator()() const
{
return *ptr_;
}
template<class T>
inline T* Foam::xfer<T>::operator->() const
inline T* Foam::Xfer<T>::operator->() const
{
return ptr_;
}
@ -125,38 +125,39 @@ inline T* Foam::xfer<T>::operator->() const
template<class T>
inline Foam::xfer<T> Foam::xferCopy(const T& t)
inline Foam::Xfer<T> Foam::xferCopy(const T& t)
{
return Foam::xfer<T>(t);
}
template<class T>
inline Foam::xfer<T> Foam::xferMove(T& t)
{
return Foam::xfer<T>(t, true);
return Foam::Xfer<T>(t);
}
template<class T>
inline Foam::xfer<T> Foam::xferTmp(Foam::tmp<T>& tt)
inline Foam::Xfer<T> Foam::xferMove(T& t)
{
return Foam::xfer<T>(tt(), tt.isTmp());
return Foam::Xfer<T>(t, true);
}
template<class T>
inline Foam::Xfer<T> Foam::xferTmp(Foam::tmp<T>& tt)
{
return Foam::Xfer<T>(tt(), tt.isTmp());
}
template<class To, class From>
inline Foam::xfer<To> Foam::xferCopyTo(const From& t)
inline Foam::Xfer<To> Foam::xferCopyTo(const From& t)
{
Foam::xfer<To> xf;
Foam::Xfer<To> xf;
xf() = t;
return xf;
}
template<class To, class From>
inline Foam::xfer<To> Foam::xferMoveTo(From& t)
inline Foam::Xfer<To> Foam::xferMoveTo(From& t)
{
Foam::xfer<To> xf;
Foam::Xfer<To> xf;
xf().transfer(t);
return xf;
}

View File

@ -79,7 +79,7 @@ public:
explicit inline cell(const UList<label>&);
//- Construct by transferring the parameter contents
explicit inline cell(const xfer<labelList>&);
explicit inline cell(const Xfer<labelList>&);
//- Construct from Istream
inline cell(Istream&);

View File

@ -47,7 +47,7 @@ inline Foam::cell::cell(const UList<label>& lst)
{}
inline Foam::cell::cell(const xfer<labelList>& lst)
inline Foam::cell::cell(const Xfer<labelList>& lst)
:
labelList(lst)
{}

View File

@ -147,7 +147,7 @@ public:
explicit inline face(const labelList&);
//- Construct by transferring the parameter contents
explicit inline face(const xfer<labelList>&);
explicit inline face(const Xfer<labelList>&);
//- Copy construct from triFace
face(const triFace&);

View File

@ -64,7 +64,7 @@ inline Foam::face::face(const labelList& lst)
{}
inline Foam::face::face(const xfer<labelList>& lst)
inline Foam::face::face(const Xfer<labelList>& lst)
:
labelList(lst)
{}

View File

@ -273,10 +273,10 @@ Foam::polyMesh::polyMesh(const IOobject& io)
Foam::polyMesh::polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& owner,
const xfer<labelList>& neighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,
const Xfer<labelList>& neighbour,
const bool syncPar
)
:
@ -429,9 +429,9 @@ Foam::polyMesh::polyMesh
Foam::polyMesh::polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<cellList>& cells,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<cellList>& cells,
const bool syncPar
)
:
@ -566,9 +566,9 @@ Foam::polyMesh::polyMesh
"polyMesh::polyMesh\n"
"(\n"
" const IOobject&,\n"
" const xfer<pointField>&,\n"
" const xfer<faceList>&,\n"
" const xfer<cellList>&\n"
" const Xfer<pointField>&,\n"
" const Xfer<faceList>&,\n"
" const Xfer<cellList>&\n"
")\n"
) << "Face " << faceI << "contains vertex labels out of range: "
<< curFace << " Max point index = " << points_.size()
@ -591,9 +591,9 @@ Foam::polyMesh::polyMesh
"polyMesh::polyMesh\n"
"(\n"
" const IOobject&,\n"
" const xfer<pointField>&,\n"
" const xfer<faceList>&,\n"
" const xfer<cellList>&\n"
" const Xfer<pointField>&,\n"
" const Xfer<faceList>&,\n"
" const Xfer<cellList>&\n"
")\n"
) << "Cell " << cellI << "contains face labels out of range: "
<< curCell << " Max face index = " << faces_.size()
@ -608,10 +608,10 @@ Foam::polyMesh::polyMesh
void Foam::polyMesh::resetPrimitives
(
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& owner,
const xfer<labelList>& neighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,
const Xfer<labelList>& neighbour,
const labelList& patchSizes,
const labelList& patchStarts,
const bool validBoundary
@ -672,10 +672,10 @@ void Foam::polyMesh::resetPrimitives
(
"polyMesh::polyMesh::resetPrimitives\n"
"(\n"
" const xfer<pointField>&,\n"
" const xfer<faceList>&,\n"
" const xfer<labelList>& owner,\n"
" const xfer<labelList>& neighbour,\n"
" const Xfer<pointField>&,\n"
" const Xfer<faceList>&,\n"
" const Xfer<labelList>& owner,\n"
" const Xfer<labelList>& neighbour,\n"
" const labelList& patchSizes,\n"
" const labelList& patchStarts\n"
")\n"
@ -710,10 +710,10 @@ void Foam::polyMesh::resetPrimitives
(
"polyMesh::polyMesh::resetPrimitives\n"
"(\n"
" const xfer<pointField>&,\n"
" const xfer<faceList>&,\n"
" const xfer<labelList>& owner,\n"
" const xfer<labelList>& neighbour,\n"
" const Xfer<pointField>&,\n"
" const Xfer<faceList>&,\n"
" const Xfer<labelList>& owner,\n"
" const Xfer<labelList>& neighbour,\n"
" const labelList& patchSizes,\n"
" const labelList& patchStarts\n"
")\n"

View File

@ -219,10 +219,10 @@ public:
polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& owner,
const xfer<labelList>& neighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,
const Xfer<labelList>& neighbour,
const bool syncPar = true
);
@ -231,9 +231,9 @@ public:
polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<cellList>& cells,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<cellList>& cells,
const bool syncPar = true
);
@ -241,7 +241,7 @@ public:
polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const Xfer<pointField>& points,
const cellShapeList& shapes,
const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
@ -434,10 +434,10 @@ public:
// patch ends at nActiveFaces) and change patches with addPatches.
void resetPrimitives
(
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& owner,
const xfer<labelList>& neighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,
const Xfer<labelList>& neighbour,
const labelList& patchSizes,
const labelList& patchStarts,
const bool validBoundary = true

View File

@ -136,7 +136,7 @@ Foam::labelList Foam::polyMesh::facePatchFaceCells
Foam::polyMesh::polyMesh
(
const IOobject& io,
const xfer<pointField>& points,
const Xfer<pointField>& points,
const cellShapeList& cellsAsShapes,
const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
@ -415,7 +415,7 @@ Foam::polyMesh::polyMesh
"polyMesh::polyMesh\n"
"(\n"
" const IOobject&,\n"
" const xfer<pointField>&,\n"
" const Xfer<pointField>&,\n"
" const cellShapeList& cellsAsShapes,\n"
" const faceListList& boundaryFaces,\n"
" const wordList& boundaryPatchTypes,\n"
@ -473,7 +473,7 @@ Foam::polyMesh::polyMesh
"polyMesh::polyMesh\n"
"(\n"
" const IOobject&,\n"
" const xfer<pointField>&,\n"
" const Xfer<pointField>&,\n"
" const cellShapeList& cellsAsShapes,\n"
" const faceListList& boundaryFaces,\n"
" const wordList& boundaryPatchTypes,\n"

View File

@ -117,7 +117,7 @@ Foam::cellZone::cellZone
Foam::cellZone::cellZone
(
const word& name,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)
@ -167,7 +167,7 @@ Foam::cellZone::cellZone
Foam::cellZone::cellZone
(
const cellZone& cz,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)

View File

@ -135,7 +135,7 @@ public:
cellZone
(
const word& name,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const cellZoneMesh&
);
@ -164,7 +164,7 @@ public:
cellZone
(
const cellZone&,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const cellZoneMesh&
);

View File

@ -245,8 +245,8 @@ Foam::faceZone::faceZone
Foam::faceZone::faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const Xfer<labelList>& addr,
const Xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)
@ -319,8 +319,8 @@ Foam::faceZone::faceZone
Foam::faceZone::faceZone
(
const faceZone& fz,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const Xfer<labelList>& addr,
const Xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)

View File

@ -167,8 +167,8 @@ public:
faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const Xfer<labelList>& addr,
const Xfer<boolList>& fm,
const label index,
const faceZoneMesh&
);
@ -198,8 +198,8 @@ public:
faceZone
(
const faceZone&,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const Xfer<labelList>& addr,
const Xfer<boolList>& fm,
const label index,
const faceZoneMesh&
);

View File

@ -115,7 +115,7 @@ Foam::pointZone::pointZone
Foam::pointZone::pointZone
(
const word& name,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)
@ -166,7 +166,7 @@ Foam::pointZone::pointZone
Foam::pointZone::pointZone
(
const pointZone& pz,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)

View File

@ -137,7 +137,7 @@ public:
pointZone
(
const word& name,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const pointZoneMesh&
);
@ -166,7 +166,7 @@ public:
pointZone
(
const pointZone&,
const xfer<labelList>& addr,
const Xfer<labelList>& addr,
const label index,
const pointZoneMesh&
);

View File

@ -288,7 +288,7 @@ void Foam::primitiveMesh::reset
const label nInternalFaces,
const label nFaces,
const label nCells,
const xfer<cellList>& clst
const Xfer<cellList>& clst
)
{
reset

View File

@ -382,7 +382,7 @@ public:
const label nInternalFaces,
const label nFaces,
const label nCells,
const xfer<cellList>& cells
const Xfer<cellList>& cells
);

View File

@ -228,10 +228,10 @@ Foam::fvMesh::fvMesh(const IOobject& io)
Foam::fvMesh::fvMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& allOwner,
const xfer<labelList>& allNeighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& allOwner,
const Xfer<labelList>& allNeighbour,
const bool syncPar
)
:
@ -259,9 +259,9 @@ Foam::fvMesh::fvMesh
Foam::fvMesh::fvMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<cellList>& cells,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<cellList>& cells,
const bool syncPar
)
:

View File

@ -173,10 +173,10 @@ public:
fvMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<labelList>& allOwner,
const xfer<labelList>& allNeighbour,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& allOwner,
const Xfer<labelList>& allNeighbour,
const bool syncPar = true
);
@ -185,9 +185,9 @@ public:
fvMesh
(
const IOobject& io,
const xfer<pointField>& points,
const xfer<faceList>& faces,
const xfer<cellList>& cells,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<cellList>& cells,
const bool syncPar = true
);

View File

@ -57,7 +57,7 @@ Foam::coordinateSystems::coordinateSystems
Foam::coordinateSystems::coordinateSystems
(
const IOobject& io,
const xfer<PtrList<coordinateSystem> >& lst
const Xfer<PtrList<coordinateSystem> >& lst
)
:
IOPtrList<coordinateSystem>(io, lst)

View File

@ -85,7 +85,7 @@ public:
coordinateSystems
(
const IOobject&,
const xfer<PtrList<coordinateSystem> >&
const Xfer<PtrList<coordinateSystem> >&
);
// Selectors

View File

@ -756,10 +756,10 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
// (patches guaranteed to be in increasing order)
mesh.resetPrimitives
(
xfer<pointField>::null(),
Xfer<pointField>::null(),
xferMove(newFaces),
xfer<labelList>::null(),
xfer<labelList>::null(),
Xfer<labelList>::null(),
Xfer<labelList>::null(),
patchSizes,
patchStarts,
true // boundary forms valid boundary mesh.

View File

@ -48,8 +48,8 @@ Foam::BasicMeshedSurface<Face>::BasicMeshedSurface()
template<class Face>
Foam::BasicMeshedSurface<Face>::BasicMeshedSurface
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst
)
:
ParentType(List<Face>(), pointField())
@ -111,8 +111,8 @@ void Foam::BasicMeshedSurface<Face>::scalePoints(const scalar& scaleFactor)
template<class Face>
void Foam::BasicMeshedSurface<Face>::reset
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst
)
{
ParentType::clearOut();

View File

@ -38,7 +38,6 @@ SourceFiles
#include "PrimitivePatchExtra.H"
#include "pointField.H"
#include "xfer.H"
#include "face.H"
#include "triFace.H"
@ -103,8 +102,8 @@ public:
//- Construct by transferring components (points, faces).
BasicMeshedSurface
(
const xfer<pointField>&,
const xfer<List<Face> >&
const Xfer<pointField>&,
const Xfer<List<Face> >&
);
// Destructor
@ -135,8 +134,8 @@ public:
//- Transfer components (points, faces).
virtual void reset
(
const xfer<pointField>&,
const xfer<List<Face> >&
const Xfer<pointField>&,
const Xfer<List<Face> >&
);
//- Remove invalid faces

View File

@ -164,9 +164,9 @@ Foam::MeshedSurface<Face>::MeshedSurface()
template<class Face>
Foam::MeshedSurface<Face>::MeshedSurface
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst,
const xfer<surfGroupList>& patchLst
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst,
const Xfer<surfGroupList>& patchLst
)
:
ParentType(pointLst, faceLst),
@ -177,8 +177,8 @@ Foam::MeshedSurface<Face>::MeshedSurface
template<class Face>
Foam::MeshedSurface<Face>::MeshedSurface
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst,
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst,
const UList<label>& patchSizes,
const UList<word>& patchNames
)
@ -395,7 +395,7 @@ Foam::MeshedSurface<Face>::MeshedSurface(const MeshedSurface& surf)
template<class Face>
Foam::MeshedSurface<Face>::MeshedSurface
(
const xfer<UnsortedMeshedSurface<Face> >& surf
const Xfer<UnsortedMeshedSurface<Face> >& surf
)
{
transfer(surf());
@ -403,7 +403,7 @@ Foam::MeshedSurface<Face>::MeshedSurface
template<class Face>
Foam::MeshedSurface<Face>::MeshedSurface(const xfer<MeshedSurface>& surf)
Foam::MeshedSurface<Face>::MeshedSurface(const Xfer<MeshedSurface>& surf)
{
transfer(surf());
}
@ -493,8 +493,8 @@ void Foam::MeshedSurface<Face>::checkPatches()
template<class Face>
void Foam::MeshedSurface<Face>::sortFacesAndStore
(
const xfer<List<Face> >& unsortedFaces,
const xfer<List<label> >& regionIds,
const Xfer<List<Face> >& unsortedFaces,
const Xfer<List<label> >& regionIds,
const bool sorted
)
{

View File

@ -107,8 +107,8 @@ protected:
//- sort faces by regions and store sorted faces
void sortFacesAndStore
(
const xfer<List<Face> >& unsortedFaces,
const xfer<List<label> >& regionIds,
const Xfer<List<Face> >& unsortedFaces,
const Xfer<List<label> >& regionIds,
const bool sorted
);
@ -142,17 +142,17 @@ public:
//- Construct by transferring components (points, faces, patches).
MeshedSurface
(
const xfer<pointField>&,
const xfer<List<Face> >&,
const xfer<surfGroupList>&
const Xfer<pointField>&,
const Xfer<List<Face> >&,
const Xfer<surfGroupList>&
);
//- Construct by transferring points, faces.
// Use patch information, or set single default patch.
MeshedSurface
(
const xfer<pointField>&,
const xfer<List<Face> >&,
const Xfer<pointField>&,
const Xfer<List<Face> >&,
const UList<label>& patchSizes = UList<label>::null(),
const UList<word>& patchNames = UList<word>::null()
);
@ -171,10 +171,10 @@ public:
MeshedSurface(const surfMesh&);
//- Construct by transferring the contents from a UnsortedMeshedSurface
MeshedSurface(const xfer<UnsortedMeshedSurface<Face> >&);
MeshedSurface(const Xfer<UnsortedMeshedSurface<Face> >&);
//- Construct by transferring the contents from a MeshedSurface
MeshedSurface(const xfer<MeshedSurface<Face> >&);
MeshedSurface(const Xfer<MeshedSurface<Face> >&);
//- Construct from file name (uses extension to determine type)
MeshedSurface(const fileName&);

View File

@ -61,7 +61,7 @@ bool Foam::MeshedSurface<Face>::read(Istream& is)
MeshedSurface<face> surf;
surf.reset
(
xfer<pointField>::null(),
Xfer<pointField>::null(),
xferMove(faceLst)
);
surf.addPatches(patches_);

View File

@ -161,10 +161,10 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface()
template<class Face>
Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst,
const xfer<List<label> >& regionIds,
const xfer<surfPatchIdentifierList>& patchLst
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst,
const Xfer<List<label> >& regionIds,
const Xfer<surfPatchIdentifierList>& patchLst
)
:
ParentType(pointLst, faceLst),
@ -176,8 +176,8 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
template<class Face>
Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst,
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst,
const UList<label>& patchSizes,
const UList<word>& patchNames
)
@ -274,7 +274,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
template<class Face>
Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
(
const xfer<UnsortedMeshedSurface<Face> >& surf
const Xfer<UnsortedMeshedSurface<Face> >& surf
)
{
transfer(surf());
@ -284,7 +284,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
template<class Face>
Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
(
const xfer<MeshedSurface<Face> >& surf
const Xfer<MeshedSurface<Face> >& surf
)
{
transfer(surf());
@ -532,9 +532,9 @@ Foam::UnsortedMeshedSurface<Face> Foam::UnsortedMeshedSurface<Face>::subsetMesh
template<class Face>
void Foam::UnsortedMeshedSurface<Face>::reset
(
const xfer<pointField>& pointLst,
const xfer<List<Face> >& faceLst,
const xfer<List<label> >& regionIds
const Xfer<pointField>& pointLst,
const Xfer<List<Face> >& faceLst,
const Xfer<List<label> >& regionIds
)
{
ParentType::reset(pointLst, faceLst);

View File

@ -155,18 +155,18 @@ public:
// (points, faces, region ids, patches).
UnsortedMeshedSurface
(
const xfer<pointField>&,
const xfer<List<Face> >&,
const xfer<List<label> >& regionIds,
const xfer<surfPatchIdentifierList>&
const Xfer<pointField>&,
const Xfer<List<Face> >&,
const Xfer<List<label> >& regionIds,
const Xfer<surfPatchIdentifierList>&
);
//- Construct by transferring points, faces.
// Use patch information, or set single default patch
UnsortedMeshedSurface
(
const xfer<pointField>&,
const xfer<List<Face> >&,
const Xfer<pointField>&,
const Xfer<List<Face> >&,
const UList<label>& patchSizes = UList<label>::null(),
const UList<word>& patchNames = UList<word>::null()
);
@ -182,10 +182,10 @@ public:
UnsortedMeshedSurface(const MeshedSurface<Face>&);
//- Construct by transferring the contents from a UnsortedMeshedSurface
UnsortedMeshedSurface(const xfer<UnsortedMeshedSurface<Face> >&);
UnsortedMeshedSurface(const Xfer<UnsortedMeshedSurface<Face> >&);
//- Construct by transferring the contents from a meshedSurface
UnsortedMeshedSurface(const xfer<MeshedSurface<Face> >&);
UnsortedMeshedSurface(const Xfer<MeshedSurface<Face> >&);
//- Construct from file name (uses extension to determine type)
UnsortedMeshedSurface(const fileName&);
@ -317,9 +317,9 @@ public:
//- Transfer components (points, faces, region ids).
virtual void reset
(
const xfer<pointField>&,
const xfer<List<Face> >&,
const xfer<List<label> >& regionIds = xfer<List<label> >::null()
const Xfer<pointField>&,
const Xfer<List<Face> >&,
const Xfer<List<label> >& regionIds = Xfer<List<label> >::null()
);
//- Transfer the contents of the argument and annull the argument