Commit 8c23f542 authored by Mark Olesen's avatar Mark Olesen
Browse files

add xfer constructors to cell/face/point Zone and (Static)HashTable

parent 56702ea9
......@@ -83,6 +83,19 @@ HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
}
}
template<class T, class Key, class Hash>
HashTable<T, Key, Hash>::HashTable(const xfer<HashTable<T, Key, Hash> >& ht)
:
HashTableName(),
tableSize_(0),
table_(NULL),
nElmts_(0),
endIter_(*this, NULL, 0),
endConstIter_(*this, NULL, 0)
{
transfer(*ht);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -41,6 +41,7 @@ SourceFiles
#include "label.H"
#include "word.H"
#include "className.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -155,6 +156,9 @@ public:
//- Construct as copy
HashTable(const HashTable<T, Key, Hash>&);
//- Construct by transferring the parameter contents
HashTable(const xfer<HashTable<T, Key, Hash> >&);
// Destructor
......
......@@ -76,6 +76,24 @@ StaticHashTable<T, Key, Hash>::StaticHashTable
{}
template<class T, class Key, class Hash>
StaticHashTable<T, Key, Hash>::StaticHashTable
(
const xfer<StaticHashTable<T, Key, Hash> >& ht
)
:
StaticHashTableName(),
keys_(0),
objects_(0),
nElmts_(0),
endIter_(*this, 0, 0),
endConstIter_(*this, 0, 0)
{
transfer(*ht);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class T, class Key, class Hash>
......
......@@ -46,6 +46,7 @@ SourceFiles
#include "label.H"
#include "word.H"
#include "className.H"
#include "xfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -146,6 +147,8 @@ public:
//- Construct as copy
StaticHashTable(const StaticHashTable<T, Key, Hash>&);
//- Construct as copy
StaticHashTable(const xfer<StaticHashTable<T, Key, Hash> >&);
// Destructor
......
......@@ -114,6 +114,22 @@ Foam::cellZone::cellZone
{}
Foam::cellZone::cellZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
{}
// Construct from dictionary
Foam::cellZone::cellZone
(
......@@ -148,6 +164,21 @@ Foam::cellZone::cellZone
cellLookupMapPtr_(NULL)
{}
Foam::cellZone::cellZone
(
const cellZone& cz,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh& zm
)
:
labelList(addr),
name_(cz.name()),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -128,26 +128,45 @@ public:
const word& name,
const labelList& addr,
const label index,
const cellZoneMesh& zm
const cellZoneMesh&
);
//- Construct from components, transferring contents
cellZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh&
);
//- Construct from dictionary
cellZone
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const cellZoneMesh& zm
const cellZoneMesh&
);
//- Construct given the original zone and resetting the
// cell list and zone mesh information
cellZone
(
const cellZone& cz,
const cellZone&,
const labelList& addr,
const label index,
const cellZoneMesh& zm
const cellZoneMesh&
);
//- Construct given the original zone, resetting the
// cell list and zone mesh information
cellZone
(
const cellZone&,
const xfer<labelList>& addr,
const label index,
const cellZoneMesh&
);
//- Construct and return a clone, resetting the zone mesh
......@@ -182,7 +201,7 @@ public:
static autoPtr<cellZone> New
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const cellZoneMesh&
);
......
......@@ -242,6 +242,30 @@ Foam::faceZone::faceZone
}
Foam::faceZone::faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)
:
labelList(addr),
name_(name),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
{
checkAddressing();
}
// Construct from dictionary
Foam::faceZone::faceZone
(
......@@ -292,6 +316,30 @@ Foam::faceZone::faceZone
}
Foam::faceZone::faceZone
(
const faceZone& fz,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh& zm
)
:
labelList(addr),
name_(fz.name()),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
{
checkAddressing();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceZone::~faceZone()
......
......@@ -163,24 +163,45 @@ public:
const faceZoneMesh& zm
);
//- Construct from components, transferring contents
faceZone
(
const word& name,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh&
);
//- Construct from dictionary
faceZone
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const faceZoneMesh& zm
const faceZoneMesh&
);
//- Construct given the original zone and resetting the
// face list and zone mesh information
faceZone
(
const faceZone& fz,
const faceZone&,
const labelList& addr,
const boolList& fm,
const label index,
const faceZoneMesh& zm
const faceZoneMesh&
);
//- Construct given the original zone, resetting the
// face list and zone mesh information
faceZone
(
const faceZone&,
const xfer<labelList>& addr,
const xfer<boolList>& fm,
const label index,
const faceZoneMesh&
);
//- Construct and return a clone, resetting the zone mesh
......@@ -216,9 +237,9 @@ public:
static autoPtr<faceZone> New
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const faceZoneMesh& zm
const faceZoneMesh&
);
......
......@@ -112,6 +112,22 @@ Foam::pointZone::pointZone
{}
Foam::pointZone::pointZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
{}
// Construct from dictionary
Foam::pointZone::pointZone
(
......@@ -147,6 +163,22 @@ Foam::pointZone::pointZone
{}
Foam::pointZone::pointZone
(
const pointZone& pz,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh& zm
)
:
labelList(addr),
name_(pz.name()),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pointZone::~pointZone()
......
......@@ -130,26 +130,45 @@ public:
const word& name,
const labelList& addr,
const label index,
const pointZoneMesh& zm
const pointZoneMesh&
);
//- Construct from components, transferring contents
pointZone
(
const word& name,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh&
);
//- Construct from dictionary
pointZone
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const pointZoneMesh& zm
const pointZoneMesh&
);
//- Construct given the original zone and resetting the
// point list and zone mesh information
pointZone
(
const pointZone& pz,
const pointZone&,
const labelList& addr,
const label index,
const pointZoneMesh& zm
const pointZoneMesh&
);
//- Construct given the original zone, resetting the
// face list and zone mesh information
pointZone
(
const pointZone&,
const xfer<labelList>& addr,
const label index,
const pointZoneMesh&
);
//- Construct and return a clone, resetting the zone mesh
......@@ -184,7 +203,7 @@ public:
static autoPtr<pointZone> New
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index,
const pointZoneMesh&
);
......
Supports Markdown
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