From 34d4cfaca35a0ad56966d798ad5a0f6bdd681093 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 20 Jan 2016 10:41:14 +0000 Subject: [PATCH] Make disallowed member functions private Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1977 --- .../meshReader/starcd/STARCDMeshReader.H | 27 +++++++++++-------- .../simpleControl/simpleControl.H | 8 ++++-- .../removeRegisteredObject.H | 5 ++-- .../IO/writeDictionary/writeDictionary.H | 7 ++++- .../cloud/cloudInfo/cloudInfo.H | 7 ++++- .../fieldCoordinateSystemTransform.H | 19 ++++++++----- .../field/processorField/processorField.H | 6 +++-- .../field/readFields/readFields.H | 17 +++++++----- .../surfaceInterpolateFields.H | 17 +++++++----- .../functionObjects/systemCall/systemCall.H | 6 +++-- .../utilities/residuals/residuals.H | 19 ++++++++----- .../turbulenceFields/turbulenceFields.H | 17 +++++++----- .../wallShearStress/wallShearStress.H | 7 ++++- .../cellVolumeWeight/cellVolumeWeightMethod.H | 7 ++++- .../calcMethod/direct/directMethod.H | 7 ++++- .../meshToMeshMethod/meshToMeshMethod.H | 9 +++++-- .../singleStepReactingMixture.H | 19 ++++++++----- 17 files changed, 139 insertions(+), 65 deletions(-) diff --git a/src/conversion/meshReader/starcd/STARCDMeshReader.H b/src/conversion/meshReader/starcd/STARCDMeshReader.H index 33fadc40e9..bde13a9cd2 100644 --- a/src/conversion/meshReader/starcd/STARCDMeshReader.H +++ b/src/conversion/meshReader/starcd/STARCDMeshReader.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,10 +42,10 @@ SourceFiles #ifndef STARCDMeshReader_H #define STARCDMeshReader_H -# include "meshReader.H" -# include "boundaryRegion.H" -# include "cellShape.H" -# include "IFstream.H" +#include "meshReader.H" +#include "boundaryRegion.H" +#include "cellShape.H" +#include "IFstream.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -89,12 +89,6 @@ protected: // Protected Member Functions - //- Disallow default bitwise copy construct - STARCD(const STARCD&); - - //- Disallow default bitwise assignment - void operator=(const STARCD&); - //- Read the mesh from the file(s) virtual bool readGeometry(const scalar scaleFactor = 1.0); @@ -120,6 +114,17 @@ protected: static bool readHeader(IFstream&, word fileSignature); +private: + + // Private member functions + + //- Disallow default bitwise copy construct + STARCD(const STARCD&); + + //- Disallow default bitwise assignment + void operator=(const STARCD&); + + protected: enum cellType diff --git a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H index 71f8d0e04c..a9b3b5b49b 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,6 +65,11 @@ protected: //- Return true if all convergence checks are satisfied bool criteriaSatisfied(); + +private: + + // Private member functions + //- Disallow default bitwise copy construct simpleControl(const simpleControl&); @@ -74,7 +79,6 @@ protected: public: - // Static Data Members //- Run-time type information diff --git a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H index fc02432ad8..8a9b2774f9 100644 --- a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H +++ b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,8 +96,9 @@ protected: wordList objectNames_; - // Private Member Functions +private: + // Private member functions //- Disallow default bitwise copy construct removeRegisteredObject(const removeRegisteredObject&); diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H index ac2ec7ac58..9282daec35 100644 --- a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,11 @@ protected: bool& firstDict ); + +private: + + // Private member functions + //- Disallow default bitwise copy construct writeDictionary(const writeDictionary&); diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H index 9bd1761061..e5aeb089be 100644 --- a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,6 +115,11 @@ protected: //- File header information virtual void writeFileHeader(const label i); + +private: + + // Private member functions + //- Disallow default bitwise copy construct cloudInfo(const cloudInfo&); diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index edd1f13b50..e190360c85 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,12 +120,6 @@ protected: // Protected Member Functions - //- Disallow default bitwise copy construct - fieldCoordinateSystemTransform(const fieldCoordinateSystemTransform&); - - //- Disallow default bitwise assignment - void operator=(const fieldCoordinateSystemTransform&); - template void transform(const word& fieldName) const; @@ -133,6 +127,17 @@ protected: void transformField(const Type& field) const; +private: + + // Private member functions + + //- Disallow default bitwise copy construct + fieldCoordinateSystemTransform(const fieldCoordinateSystemTransform&); + + //- Disallow default bitwise assignment + void operator=(const fieldCoordinateSystemTransform&); + + public: //- Runtime type information diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.H b/src/postProcessing/functionObjects/field/processorField/processorField.H index 6d45e32acb..88e7ff383d 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.H +++ b/src/postProcessing/functionObjects/field/processorField/processorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,7 +96,9 @@ protected: bool active_; - // Protected Member Functions +private: + + // Private member functions //- Disallow default bitwise copy construct processorField(const processorField&); diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.H b/src/postProcessing/functionObjects/field/readFields/readFields.H index c9cc882a8c..ac5a794b43 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.H +++ b/src/postProcessing/functionObjects/field/readFields/readFields.H @@ -118,12 +118,6 @@ protected: // Protected Member Functions - //- Disallow default bitwise copy construct - readFields(const readFields&); - - //- Disallow default bitwise assignment - void operator=(const readFields&); - template void loadField ( @@ -133,6 +127,17 @@ protected: ) const; +private: + + // Private member functions + + //- Disallow default bitwise copy construct + readFields(const readFields&); + + //- Disallow default bitwise assignment + void operator=(const readFields&); + + public: //- Runtime type information diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H index 0e55e6b4fc..02ebba304b 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H @@ -116,12 +116,6 @@ protected: // Protected Member Functions - //- Disallow default bitwise copy construct - surfaceInterpolateFields(const surfaceInterpolateFields&); - - //- Disallow default bitwise assignment - void operator=(const surfaceInterpolateFields&); - template void interpolateFields ( @@ -129,6 +123,17 @@ protected: ) const; +private: + + // Private member functions + + //- Disallow default bitwise copy construct + surfaceInterpolateFields(const surfaceInterpolateFields&); + + //- Disallow default bitwise assignment + void operator=(const surfaceInterpolateFields&); + + public: //- Runtime type information diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.H b/src/postProcessing/functionObjects/systemCall/systemCall.H index b4d43a2bf7..eb9202c01b 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.H +++ b/src/postProcessing/functionObjects/systemCall/systemCall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,7 +123,9 @@ protected: stringList writeCalls_; - // Private Member Functions +private: + + // Private member functions //- Disallow default bitwise copy construct systemCall(const systemCall&); diff --git a/src/postProcessing/functionObjects/utilities/residuals/residuals.H b/src/postProcessing/functionObjects/utilities/residuals/residuals.H index f07c0a1543..39b5dd2d45 100644 --- a/src/postProcessing/functionObjects/utilities/residuals/residuals.H +++ b/src/postProcessing/functionObjects/utilities/residuals/residuals.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,12 +109,6 @@ protected: // Private Member Functions - //- Disallow default bitwise copy construct - residuals(const residuals&); - - //- Disallow default bitwise assignment - void operator=(const residuals&); - //- Output field header information template void writeFileHeader(const word& fieldName); @@ -123,6 +117,17 @@ protected: virtual void writeFileHeader(const label i); +private: + + // Private member functions + + //- Disallow default bitwise copy construct + residuals(const residuals&); + + //- Disallow default bitwise assignment + void operator=(const residuals&); + + public: //- Runtime type information diff --git a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H index ea08fc132f..386d1ba330 100644 --- a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H +++ b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H @@ -154,12 +154,6 @@ protected: // Protected Member Functions - //- Disallow default bitwise copy construct - turbulenceFields(const turbulenceFields&); - - //- Disallow default bitwise assignment - void operator=(const turbulenceFields&); - //- Return true if compressible turbulence model is identified bool compressible(); @@ -172,6 +166,17 @@ protected: ); +private: + + // Private member functions + + //- Disallow default bitwise copy construct + turbulenceFields(const turbulenceFields&); + + //- Disallow default bitwise assignment + void operator=(const turbulenceFields&); + + public: //- Runtime type information diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H index b2171a1d67..ba0d5752de 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,6 +130,11 @@ protected: volVectorField& shearStress ); + +private: + + // Private member functions + //- Disallow default bitwise copy construct wallShearStress(const wallShearStress&); diff --git a/src/sampling/meshToMesh/calcMethod/cellVolumeWeight/cellVolumeWeightMethod.H b/src/sampling/meshToMesh/calcMethod/cellVolumeWeight/cellVolumeWeightMethod.H index 9e81715722..02e5335035 100644 --- a/src/sampling/meshToMesh/calcMethod/cellVolumeWeight/cellVolumeWeightMethod.H +++ b/src/sampling/meshToMesh/calcMethod/cellVolumeWeight/cellVolumeWeightMethod.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,6 +93,11 @@ protected: labelList& seedCells ) const; + +private: + + // Private member functions + //- Disallow default bitwise copy construct cellVolumeWeightMethod(const cellVolumeWeightMethod&); diff --git a/src/sampling/meshToMesh/calcMethod/direct/directMethod.H b/src/sampling/meshToMesh/calcMethod/direct/directMethod.H index ddbb2c208c..15ee8d715e 100644 --- a/src/sampling/meshToMesh/calcMethod/direct/directMethod.H +++ b/src/sampling/meshToMesh/calcMethod/direct/directMethod.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,6 +98,11 @@ protected: label& tgtSeedI ) const; + +private: + + // Private member functions + //- Disallow default bitwise copy construct directMethod(const directMethod&); diff --git a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.H b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.H index 7397673d54..6cde5ed11c 100644 --- a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.H +++ b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.H @@ -1,8 +1,8 @@ -/*---------------------------------------------------------------------------*\ +/*---------------------------------------------------------------------------* \ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,6 +102,11 @@ protected: scalarListList& tgtToTgtWght ) const; + +private: + + // Private member functions + //- Disallow default bitwise copy construct meshToMeshMethod(const meshToMeshMethod&); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H index 2e9f327680..ed0b464297 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,12 +87,6 @@ protected: // Protected member functions - //- Disallow default bitwise copy construct - singleStepReactingMixture(const singleStepReactingMixture&); - - //- Disallow default bitwise assignment - void operator=(const singleStepReactingMixture&); - //- Calculate qFuel void calculateqFuel(); @@ -103,6 +97,17 @@ protected: void calculateMaxProducts(); +private: + + // Private member functions + + //- Disallow default bitwise copy construct + singleStepReactingMixture(const singleStepReactingMixture&); + + //- Disallow default bitwise assignment + void operator=(const singleStepReactingMixture&); + + public: //- The type of thermo package this mixture is instantiated for