made container constructors explicit

This commit is contained in:
mattijs
2009-11-03 18:09:52 +00:00
parent 1d6268f24a
commit 151f30e779
15 changed files with 61 additions and 36 deletions

View File

@ -162,11 +162,14 @@ int main(int argc, char *argv[])
// Addressing on faces only in mesh vertices.
primitiveFacePatch fPatch
(
faceList
(
UIndirectList<face>
(
mesh.faces(),
faces
)
),
mesh.points()
);

View File

@ -109,17 +109,17 @@ public:
//- Null constructor.
inline FixedList();
//- Construct from components
inline FixedList(const T v[Size]);
//- Construct from C-array.
explicit inline FixedList(const T v[Size]);
//- Construct from value
inline FixedList(const T&);
explicit inline FixedList(const T&);
//- Construct from UList.
inline FixedList(const UList<T>&);
explicit inline FixedList(const UList<T>&);
//- Construct from SLList.
inline FixedList(const SLList<T>&);
explicit inline FixedList(const SLList<T>&);
//- Copy constructor.
inline FixedList(const FixedList<T, Size>&);

View File

@ -123,22 +123,22 @@ public:
//- Construct as copy of FixedList<T, Size>
template<unsigned Size>
List(const FixedList<T, Size>&);
explicit List(const FixedList<T, Size>&);
//- Construct as copy of PtrList<T>
List(const PtrList<T>&);
explicit List(const PtrList<T>&);
//- Construct as copy of SLList<T>
List(const SLList<T>&);
explicit List(const SLList<T>&);
//- Construct as copy of IndirectList<T>
List(const IndirectList<T>&);
explicit List(const IndirectList<T>&);
//- Construct as copy of UIndirectList<T>
List(const UIndirectList<T>&);
explicit List(const UIndirectList<T>&);
//- Construct as copy of BiIndirectList<T>
List(const BiIndirectList<T>&);
explicit List(const BiIndirectList<T>&);
//- Construct from Istream.
List(Istream&);

View File

@ -162,7 +162,7 @@ public:
inline PackedList();
//- Construct with given size, initializes list to 0.
inline PackedList(const label size);
explicit inline PackedList(const label size);
//- Construct with given size and value for all elements.
PackedList(const label size, const unsigned val);
@ -174,7 +174,7 @@ public:
inline PackedList(const Xfer< PackedList<nBits> >&);
//- Construct from a list of labels
PackedList(const UList<label>&);
explicit PackedList(const UList<label>&);
//- Clone
inline autoPtr< PackedList<nBits> > clone() const;

View File

@ -136,7 +136,7 @@ public:
PtrList(PtrList<T>&, bool reUse);
//- Construct as copy of SLPtrList<T>
PtrList(const SLPtrList<T>&);
explicit PtrList(const SLPtrList<T>&);
//- Construct from Istream using given Istream constructor class
template<class INew>

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "tetCell.H"
@ -44,7 +42,7 @@ Foam::cellShape Foam::tetCell::tetCellShape() const
const cellModel& tet = *tetModelPtr_;
return cellShape(tet, *this);
return cellShape(tet, labelList(*this));
}

View File

@ -124,7 +124,7 @@ Foam::List<Foam::labelPair> Foam::mapDistribute::schedule
);
// Processors involved in my schedule
return UIndirectList<labelPair>(allComms, mySchedule);
return List<labelPair>(UIndirectList<labelPair>(allComms, mySchedule));
//if (debug)

View File

@ -1761,10 +1761,13 @@ void Foam::faceCoupleInfo::subDivisionMatch
writeOBJ
(
"errorEdges.obj",
edgeList
(
UIndirectList<edge>
(
cutFaces().edges(),
cutFaces().pointEdges()[cutPointI]
)
),
cutFaces().localPoints(),
false

View File

@ -110,7 +110,7 @@ Foam::labelListList Foam::addPatchCellLayer::calcGlobalEdgeFaces
);
// Extract pp part
return UIndirectList<labelList>(globalEdgeFaces, meshEdges);
return labelListList(UIndirectList<labelList>(globalEdgeFaces, meshEdges));
}

View File

@ -313,14 +313,10 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& dict)
Info<< "Creating topology mesh" << endl;
}
PtrList<cellShape> tmpBlockShapes(blocks.size());
cellShapeList tmpBlockShapes(blocks.size());
forAll(blocks, blockI)
{
tmpBlockShapes.set
(
blockI,
new cellShape(blocks[blockI].blockShape())
);
tmpBlockShapes[blockI] = cellShape(blocks[blockI].blockShape());
if (tmpBlockShapes[blockI].mag(blockPointField_) < 0.0)
{

View File

@ -85,7 +85,8 @@ const Foam::label edgesArray[12][2] =
const Foam::edgeList Foam::treeBoundBox::edges
(
initListList<edge, label, 12, 2>(edgesArray)
//initListList<edge, label, 12, 2>(edgesArray)
calcEdges(edgesArray)
);
@ -97,6 +98,18 @@ const Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::faceNormals
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::edgeList Foam::treeBoundBox::calcEdges(const label edgesArray[12][2])
{
edgeList edges(12);
forAll(edges, edgeI)
{
edges[edgeI][0] = edgesArray[edgeI][0];
edges[edgeI][1] = edgesArray[edgeI][1];
}
return edges;
}
Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::calcFaceNormals()
{
FixedList<vector, 6> normals;

View File

@ -80,6 +80,9 @@ class treeBoundBox
private:
//- To initialise edges.
static edgeList calcEdges(const label[12][2]);
//- To initialise faceNormals.
static FixedList<vector, 6> calcFaceNormals();

View File

@ -464,7 +464,10 @@ void Foam::searchableSurfaceCollection::getRegion
labelList surfRegion;
subGeom_[surfI].getRegion
(
UIndirectList<pointIndexHit>(info, indices),
List<pointIndexHit>
(
UIndirectList<pointIndexHit>(info, indices)
),
surfRegion
);
forAll(indices, i)
@ -528,7 +531,10 @@ void Foam::searchableSurfaceCollection::getNormal
vectorField surfNormal;
subGeom_[surfI].getNormal
(
UIndirectList<pointIndexHit>(info, indices),
List<pointIndexHit>
(
UIndirectList<pointIndexHit>(info, indices)
),
surfNormal
);
forAll(indices, i)

View File

@ -212,7 +212,7 @@ void Foam::sampledSets::combineSampledSets
(
samplePts.name(),
samplePts.axis(),
UIndirectList<point>(allPts, indexSets[seti]),
List<point>(UIndirectList<point>(allPts, indexSets[seti])),
refPt
)
);

View File

@ -49,7 +49,10 @@ Foam::reactingMixture<ThermoType>::reactingMixture
),
PtrList<Reaction<ThermoType> >
(
autoPtr<chemistryReader<ThermoType> >::operator()().reactions(),
PtrList<Reaction<ThermoType> >
(
autoPtr<chemistryReader<ThermoType> >::operator()().reactions()
),
this->species_
)
{