mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to simply use move construct/assignment directly. In a few rare cases (eg, polyMesh::resetPrimitives) it has been replaced by an autoPtr.
This commit is contained in:
@ -339,14 +339,11 @@ Foam::distributedTriSurfaceMesh::distributeSegments
|
||||
}
|
||||
}
|
||||
|
||||
return autoPtr<mapDistribute>
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
segmenti, // size after construction
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
segmenti, // size after construction
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
}
|
||||
|
||||
@ -636,9 +633,9 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
segmenti, // size after construction
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
segmenti, // size after construction
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
)
|
||||
);
|
||||
const mapDistribute& map = mapPtr();
|
||||
@ -649,7 +646,6 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
|
||||
|
||||
map.distribute(triangleIndex);
|
||||
|
||||
|
||||
return mapPtr;
|
||||
}
|
||||
|
||||
@ -785,16 +781,12 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
|
||||
}
|
||||
}
|
||||
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
segmenti, // size after construction
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
segmenti, // size after construction
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
return mapPtr;
|
||||
}
|
||||
|
||||
|
||||
@ -2301,8 +2293,8 @@ void Foam::distributedTriSurfaceMesh::distribute
|
||||
new mapDistribute
|
||||
(
|
||||
allTris.size(),
|
||||
faceSendMap.xfer(),
|
||||
faceConstructMap.xfer()
|
||||
std::move(faceSendMap),
|
||||
std::move(faceConstructMap)
|
||||
)
|
||||
);
|
||||
pointMap.reset
|
||||
@ -2310,8 +2302,8 @@ void Foam::distributedTriSurfaceMesh::distribute
|
||||
new mapDistribute
|
||||
(
|
||||
allPoints.size(),
|
||||
pointSendMap.xfer(),
|
||||
pointConstructMap.xfer()
|
||||
std::move(pointSendMap),
|
||||
std::move(pointConstructMap)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user