STYLE: add std:: qualifier to unique_ptr for additional clarity, noexcept

This commit is contained in:
Mark Olesen
2022-01-20 17:09:26 +01:00
parent 97f452d53a
commit 3b1f6e867c
4 changed files with 47 additions and 47 deletions

View File

@ -608,19 +608,19 @@ Foam::List<Foam::labelRange> Foam::polyBoundaryMesh::patchRanges() const
}
Foam::label Foam::polyBoundaryMesh::start() const
Foam::label Foam::polyBoundaryMesh::start() const noexcept
{
return mesh_.nInternalFaces();
}
Foam::label Foam::polyBoundaryMesh::nFaces() const
Foam::label Foam::polyBoundaryMesh::nFaces() const noexcept
{
return mesh_.nBoundaryFaces();
}
Foam::labelRange Foam::polyBoundaryMesh::range() const
Foam::labelRange Foam::polyBoundaryMesh::range() const noexcept
{
return labelRange(mesh_.nInternalFaces(), mesh_.nBoundaryFaces());
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef polyBoundaryMesh_H
#define polyBoundaryMesh_H
#ifndef Foam_polyBoundaryMesh_H
#define Foam_polyBoundaryMesh_H
#include "polyPatchList.H"
#include "regIOobject.H"
@ -188,17 +188,17 @@ public:
//- Return a list of patch ranges
List<labelRange> patchRanges() const;
//- The start label of the boundary faces in the polyMesh face list
// Same as mesh.nInternalFaces()
label start() const;
//- The start label of boundary faces in the polyMesh face list
// Same as polyMesh::nInternalFaces()
label start() const noexcept;
//- The number of boundary faces in the underlying mesh
// Same as mesh.nBoundaryFaces()
label nFaces() const;
// Same as polyMesh::nBoundaryFaces()
label nFaces() const noexcept;
//- The face range for all boundary faces
// Spans [nInternalFaces, nFaces) of the underlying mesh
labelRange range() const;
labelRange range() const noexcept;
//- Return the range used for boundary faces on patchi.
// Always returns an empty range for negative values of patchi,

View File

@ -128,62 +128,62 @@ private:
//- Edges of the patch; address into local point list;
// sorted with internal edges first in upper-triangular order
// and external edges last.
mutable unique_ptr<edgeList> edgesPtr_;
mutable std::unique_ptr<edgeList> edgesPtr_;
//- Which part of edgesPtr_ is internal edges.
mutable label nInternalEdges_;
//- Boundary point labels, addressing into local point list
mutable unique_ptr<labelList> boundaryPointsPtr_;
mutable std::unique_ptr<labelList> boundaryPointsPtr_;
//- Face-face addressing
mutable unique_ptr<labelListList> faceFacesPtr_;
mutable std::unique_ptr<labelListList> faceFacesPtr_;
//- Edge-face addressing
mutable unique_ptr<labelListList> edgeFacesPtr_;
mutable std::unique_ptr<labelListList> edgeFacesPtr_;
//- Face-edge addressing
mutable unique_ptr<labelListList> faceEdgesPtr_;
mutable std::unique_ptr<labelListList> faceEdgesPtr_;
//- Point-edge addressing
mutable unique_ptr<labelListList> pointEdgesPtr_;
mutable std::unique_ptr<labelListList> pointEdgesPtr_;
//- Point-face addressing
mutable unique_ptr<labelListList> pointFacesPtr_;
mutable std::unique_ptr<labelListList> pointFacesPtr_;
//- Faces addressing into local point list
mutable unique_ptr<List<face_type>> localFacesPtr_;
mutable std::unique_ptr<List<face_type>> localFacesPtr_;
//- Labels of mesh points
mutable unique_ptr<labelList> meshPointsPtr_;
mutable std::unique_ptr<labelList> meshPointsPtr_;
//- Mesh point map. Given the global point index find its
//- location in the patch
mutable unique_ptr<Map<label>> meshPointMapPtr_;
mutable std::unique_ptr<Map<label>> meshPointMapPtr_;
//- Outside edge loops
mutable unique_ptr<labelListList> edgeLoopsPtr_;
mutable std::unique_ptr<labelListList> edgeLoopsPtr_;
//- Points local to patch
mutable unique_ptr<Field<point_type>> localPointsPtr_;
mutable std::unique_ptr<Field<point_type>> localPointsPtr_;
//- Local point order for most efficient search
mutable unique_ptr<labelList> localPointOrderPtr_;
mutable std::unique_ptr<labelList> localPointOrderPtr_;
//- Face centres
mutable unique_ptr<Field<point_type>> faceCentresPtr_;
mutable std::unique_ptr<Field<point_type>> faceCentresPtr_;
//- Face area vectors
mutable unique_ptr<Field<point_type>> faceAreasPtr_;
mutable std::unique_ptr<Field<point_type>> faceAreasPtr_;
//- Mag face area
mutable unique_ptr<Field<scalar>> magFaceAreasPtr_;
mutable std::unique_ptr<Field<scalar>> magFaceAreasPtr_;
//- Face unit normals
mutable unique_ptr<Field<point_type>> faceNormalsPtr_;
mutable std::unique_ptr<Field<point_type>> faceNormalsPtr_;
//- Point unit normals
mutable unique_ptr<Field<point_type>> pointNormalsPtr_;
mutable std::unique_ptr<Field<point_type>> pointNormalsPtr_;
// Private Member Functions

View File

@ -110,103 +110,103 @@ inline bool Foam::primitiveMesh::isInternalFace
inline bool Foam::primitiveMesh::hasCellShapes() const noexcept
{
return cellShapesPtr_;
return bool(cellShapesPtr_);
}
inline bool Foam::primitiveMesh::hasEdges() const noexcept
{
return edgesPtr_;
return bool(edgesPtr_);
}
inline bool Foam::primitiveMesh::hasCellCells() const noexcept
{
return ccPtr_;
return bool(ccPtr_);
}
inline bool Foam::primitiveMesh::hasEdgeCells() const noexcept
{
return ecPtr_;
return bool(ecPtr_);
}
inline bool Foam::primitiveMesh::hasPointCells() const noexcept
{
return pcPtr_;
return bool(pcPtr_);
}
inline bool Foam::primitiveMesh::hasCells() const noexcept
{
return cfPtr_;
return bool(cfPtr_);
}
inline bool Foam::primitiveMesh::hasEdgeFaces() const noexcept
{
return efPtr_;
return bool(efPtr_);
}
inline bool Foam::primitiveMesh::hasPointFaces() const noexcept
{
return pfPtr_;
return bool(pfPtr_);
}
inline bool Foam::primitiveMesh::hasCellEdges() const noexcept
{
return cePtr_;
return bool(cePtr_);
}
inline bool Foam::primitiveMesh::hasFaceEdges() const noexcept
{
return fePtr_;
return bool(fePtr_);
}
inline bool Foam::primitiveMesh::hasPointEdges() const noexcept
{
return pePtr_;
return bool(pePtr_);
}
inline bool Foam::primitiveMesh::hasPointPoints() const noexcept
{
return ppPtr_;
return bool(ppPtr_);
}
inline bool Foam::primitiveMesh::hasCellPoints() const noexcept
{
return cpPtr_;
return bool(cpPtr_);
}
inline bool Foam::primitiveMesh::hasCellCentres() const noexcept
{
return cellCentresPtr_;
return bool(cellCentresPtr_);
}
inline bool Foam::primitiveMesh::hasFaceCentres() const noexcept
{
return faceCentresPtr_;
return bool(faceCentresPtr_);
}
inline bool Foam::primitiveMesh::hasCellVolumes() const noexcept
{
return cellVolumesPtr_;
return bool(cellVolumesPtr_);
}
inline bool Foam::primitiveMesh::hasFaceAreas() const noexcept
{
return faceAreasPtr_;
return bool(faceAreasPtr_);
}