From 4eeadb73d3187ae70acea330668cf2ced423ad7b Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Fri, 17 May 2019 09:02:51 +0100 Subject: [PATCH] STYLE: add notices for deprecated dictionary methods --- .../foamUpgradeCyclics/foamUpgradeCyclics.C | 4 +- .../linkTypes/DLListBase/DLListBase.H | 6 +-- .../linkTypes/SLListBase/SLListBase.H | 6 +-- src/OpenFOAM/db/dictionary/dictionary.H | 47 ++++++++++++++----- src/OpenFOAM/meshes/meshShapes/face/face.H | 4 +- .../meshes/meshShapes/triFace/triFace.H | 4 +- .../primitiveShapes/triangle/triangle.H | 4 +- .../primitives/strings/lists/hashedWordList.H | 6 +-- 8 files changed, 49 insertions(+), 32 deletions(-) diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C index 5aba4f95952..50bd97144c2 100644 --- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C +++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -313,7 +313,7 @@ void rewriteField if ( boundaryField.found(patchName) - && !boundaryField.found(newName, false, false) + && !boundaryField.found(newName, keyType::LITERAL) ) { Info<< " Changing entry " << patchName << " to " << newName diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H index c096c44f8f7..6e1fb7086c1 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H @@ -243,8 +243,7 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - inline bool found() const - FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const { return this->good(); } @@ -297,8 +296,7 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - inline bool found() const - FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const { return this->good(); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H index e6bdd47a24e..f286e6035f0 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H @@ -219,8 +219,7 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - inline bool found() const - FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const { return this->good(); } @@ -271,8 +270,7 @@ public: //- Deprecated(2019-01) Pointing at a valid storage node // \deprecated(2019-01) - use good() method - inline bool found() const - FOAM_DEPRECATED_FOR(2019-01, "good() method") + bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const { return this->good(); } diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index b86be7adc8d..cf8d547c11b 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -1108,7 +1108,8 @@ public: //- Deprecated(2018-07) find and return an entry data stream // // \deprecated(2018-07) - use lookup() method - ITstream& operator[](const word& keyword) const + ITstream& FOAM_DEPRECATED_FOR(2018-07, "lookup() method") + operator[](const word& keyword) const { return lookup(keyword); } @@ -1116,7 +1117,8 @@ public: //- Deprecated(2018-10) find and return a T. // \deprecated(2018-10) - use get() method template<class T> - T lookupType + T FOAM_DEPRECATED_FOR(2018-10, "get() method") + lookupType ( const word& keyword, bool recursive = false, @@ -1128,7 +1130,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - bool found + bool FOAM_DEPRECATED_FOR(2018-10, "found(keyType::option)") + found ( const word& keyword, bool recursive, @@ -1140,7 +1143,9 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - entry* lookupEntryPtr + entry* + FOAM_DEPRECATED_FOR(2018-10, "lookupEntryPtr(keyType::option)") + lookupEntryPtr ( const word& keyword, bool recursive, @@ -1152,7 +1157,9 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry* lookupEntryPtr + const entry* + FOAM_DEPRECATED_FOR(2018-10, "lookupEntryPtr(keyType::option)") + lookupEntryPtr ( const word& keyword, bool recursive, @@ -1164,7 +1171,9 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry* lookupScopedEntryPtr + const entry* + FOAM_DEPRECATED_FOR(2018-10, "lookupScopedEntryPtr(keyType::option)") + lookupScopedEntryPtr ( const word& keyword, bool recursive, @@ -1180,7 +1189,9 @@ public: // // Search type: non-recursive with patterns. // \deprecated(2018-10) - use findDict() method - const dictionary* subDictPtr(const word& keyword) const + const dictionary* + FOAM_DEPRECATED_FOR(2018-10, "findDict() method") + subDictPtr(const word& keyword) const { return findDict(keyword, keyType::REGEX); } @@ -1191,14 +1202,18 @@ public: // // Search type: non-recursive with patterns. // \deprecated(2018-10) - use findDict() method - dictionary* subDictPtr(const word& keyword) + dictionary* + FOAM_DEPRECATED_FOR(2018-10, "findDict() method") + subDictPtr(const word& keyword) { return findDict(keyword, keyType::REGEX); } //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - const entry& lookupEntry + const entry& + FOAM_DEPRECATED_FOR(2018-10, "lookupEntry(keyType::option)") + lookupEntry ( const word& keyword, bool recursive, @@ -1210,7 +1225,9 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version - ITstream& lookup + ITstream& + FOAM_DEPRECATED_FOR(2018-10, "lookup(keyType::option)") + lookup ( const word& keyword, bool recursive, @@ -1223,7 +1240,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template<class T> - T lookupOrDefault + T FOAM_DEPRECATED_FOR(2018-10, "lookupOrDefault(keyType::option)") + lookupOrDefault ( const word& keyword, const T& deflt, @@ -1239,7 +1257,8 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template<class T> - T lookupOrAddDefault + T FOAM_DEPRECATED_FOR(2018-10, "lookupOrAddDefault(keyType::option)") + lookupOrAddDefault ( const word& keyword, const T& deflt, @@ -1255,7 +1274,9 @@ public: //- Deprecated(2018-10) // \deprecated(2018-10) - use keyType::option version template<class T> - bool readIfPresent + bool + FOAM_DEPRECATED_FOR(2018-10, "readIfPresent(keyType::option)") + readIfPresent ( const word& keyword, T& val, diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index fa167ef837a..ffd8ebf1cf6 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -202,8 +202,8 @@ public: //- Legacy name for areaNormal() // \deprecated(2018-06) Deprecated for new use - inline vector normal(const UList<point>& p) const - FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + normal(const UList<point>& p) const { return areaNormal(p); // Legacy definition } diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index 2e7fb3960fa..d3c52b3ca5d 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -133,8 +133,8 @@ public: //- Legacy name for areaNormal() // \deprecated(2018-06) Deprecated for new use - inline vector normal(const UList<point>& points) const - FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + normal(const UList<point>& points) const { return areaNormal(points); // Legacy definition } diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H index 74ecaa07c10..6e6e92c7d4d 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H @@ -216,8 +216,8 @@ public: //- Legacy name for areaNormal(). // \deprecated(2018-06) Deprecated for new use - inline vector normal() const - FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") + normal() const { return areaNormal(); } diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H index bad434955a2..b5bce97c601 100644 --- a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H @@ -182,10 +182,10 @@ public: //- Deprecated(2019-01) Is the specified name found in the list? // \deprecated(2019-01) - use found() method - inline bool contains(const word& name) const - FOAM_DEPRECATED_FOR(2019-01, "found() method") + bool FOAM_DEPRECATED_FOR(2019-01, "found() method") + contains(const word& name) const { - return this-found(name); + return this->found(name); } }; -- GitLab