STYLE: add notices for deprecated dictionary methods

This commit is contained in:
Mark Olesen
2019-05-17 09:02:51 +01:00
committed by Andrew Heather
parent 3a00dd9b9a
commit b043be3063
8 changed files with 49 additions and 32 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -313,7 +313,7 @@ void rewriteField
if if
( (
boundaryField.found(patchName) boundaryField.found(patchName)
&& !boundaryField.found(newName, false, false) && !boundaryField.found(newName, keyType::LITERAL)
) )
{ {
Info<< " Changing entry " << patchName << " to " << newName Info<< " Changing entry " << patchName << " to " << newName

View File

@ -243,8 +243,7 @@ public:
//- Deprecated(2019-01) Pointing at a valid storage node //- Deprecated(2019-01) Pointing at a valid storage node
// \deprecated(2019-01) - use good() method // \deprecated(2019-01) - use good() method
inline bool found() const bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const
FOAM_DEPRECATED_FOR(2019-01, "good() method")
{ {
return this->good(); return this->good();
} }
@ -297,8 +296,7 @@ public:
//- Deprecated(2019-01) Pointing at a valid storage node //- Deprecated(2019-01) Pointing at a valid storage node
// \deprecated(2019-01) - use good() method // \deprecated(2019-01) - use good() method
inline bool found() const bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const
FOAM_DEPRECATED_FOR(2019-01, "good() method")
{ {
return this->good(); return this->good();
} }

View File

@ -219,8 +219,7 @@ public:
//- Deprecated(2019-01) Pointing at a valid storage node //- Deprecated(2019-01) Pointing at a valid storage node
// \deprecated(2019-01) - use good() method // \deprecated(2019-01) - use good() method
inline bool found() const bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const
FOAM_DEPRECATED_FOR(2019-01, "good() method")
{ {
return this->good(); return this->good();
} }
@ -271,8 +270,7 @@ public:
//- Deprecated(2019-01) Pointing at a valid storage node //- Deprecated(2019-01) Pointing at a valid storage node
// \deprecated(2019-01) - use good() method // \deprecated(2019-01) - use good() method
inline bool found() const bool FOAM_DEPRECATED_FOR(2019-01, "good() method") found() const
FOAM_DEPRECATED_FOR(2019-01, "good() method")
{ {
return this->good(); return this->good();
} }

View File

@ -1108,7 +1108,8 @@ public:
//- Deprecated(2018-07) find and return an entry data stream //- Deprecated(2018-07) find and return an entry data stream
// //
// \deprecated(2018-07) - use lookup() method // \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); return lookup(keyword);
} }
@ -1116,7 +1117,8 @@ public:
//- Deprecated(2018-10) find and return a T. //- Deprecated(2018-10) find and return a T.
// \deprecated(2018-10) - use get() method // \deprecated(2018-10) - use get() method
template<class T> template<class T>
T lookupType T FOAM_DEPRECATED_FOR(2018-10, "get() method")
lookupType
( (
const word& keyword, const word& keyword,
bool recursive = false, bool recursive = false,
@ -1128,7 +1130,8 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
bool found bool FOAM_DEPRECATED_FOR(2018-10, "found(keyType::option)")
found
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1140,7 +1143,9 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
entry* lookupEntryPtr entry*
FOAM_DEPRECATED_FOR(2018-10, "lookupEntryPtr(keyType::option)")
lookupEntryPtr
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1152,7 +1157,9 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
const entry* lookupEntryPtr const entry*
FOAM_DEPRECATED_FOR(2018-10, "lookupEntryPtr(keyType::option)")
lookupEntryPtr
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1164,7 +1171,9 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
const entry* lookupScopedEntryPtr const entry*
FOAM_DEPRECATED_FOR(2018-10, "lookupScopedEntryPtr(keyType::option)")
lookupScopedEntryPtr
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1180,7 +1189,9 @@ public:
// //
// Search type: non-recursive with patterns. // Search type: non-recursive with patterns.
// \deprecated(2018-10) - use findDict() method // \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); return findDict(keyword, keyType::REGEX);
} }
@ -1191,14 +1202,18 @@ public:
// //
// Search type: non-recursive with patterns. // Search type: non-recursive with patterns.
// \deprecated(2018-10) - use findDict() method // \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); return findDict(keyword, keyType::REGEX);
} }
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
const entry& lookupEntry const entry&
FOAM_DEPRECATED_FOR(2018-10, "lookupEntry(keyType::option)")
lookupEntry
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1210,7 +1225,9 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
ITstream& lookup ITstream&
FOAM_DEPRECATED_FOR(2018-10, "lookup(keyType::option)")
lookup
( (
const word& keyword, const word& keyword,
bool recursive, bool recursive,
@ -1223,7 +1240,8 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
template<class T> template<class T>
T lookupOrDefault T FOAM_DEPRECATED_FOR(2018-10, "lookupOrDefault(keyType::option)")
lookupOrDefault
( (
const word& keyword, const word& keyword,
const T& deflt, const T& deflt,
@ -1239,7 +1257,8 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
template<class T> template<class T>
T lookupOrAddDefault T FOAM_DEPRECATED_FOR(2018-10, "lookupOrAddDefault(keyType::option)")
lookupOrAddDefault
( (
const word& keyword, const word& keyword,
const T& deflt, const T& deflt,
@ -1255,7 +1274,9 @@ public:
//- Deprecated(2018-10) //- Deprecated(2018-10)
// \deprecated(2018-10) - use keyType::option version // \deprecated(2018-10) - use keyType::option version
template<class T> template<class T>
bool readIfPresent bool
FOAM_DEPRECATED_FOR(2018-10, "readIfPresent(keyType::option)")
readIfPresent
( (
const word& keyword, const word& keyword,
T& val, T& val,

View File

@ -202,8 +202,8 @@ public:
//- Legacy name for areaNormal() //- Legacy name for areaNormal()
// \deprecated(2018-06) Deprecated for new use // \deprecated(2018-06) Deprecated for new use
inline vector normal(const UList<point>& p) const vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()")
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") normal(const UList<point>& p) const
{ {
return areaNormal(p); // Legacy definition return areaNormal(p); // Legacy definition
} }

View File

@ -133,8 +133,8 @@ public:
//- Legacy name for areaNormal() //- Legacy name for areaNormal()
// \deprecated(2018-06) Deprecated for new use // \deprecated(2018-06) Deprecated for new use
inline vector normal(const UList<point>& points) const vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()")
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") normal(const UList<point>& points) const
{ {
return areaNormal(points); // Legacy definition return areaNormal(points); // Legacy definition
} }

View File

@ -216,8 +216,8 @@ public:
//- Legacy name for areaNormal(). //- Legacy name for areaNormal().
// \deprecated(2018-06) Deprecated for new use // \deprecated(2018-06) Deprecated for new use
inline vector normal() const vector FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()")
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") normal() const
{ {
return areaNormal(); return areaNormal();
} }

View File

@ -182,10 +182,10 @@ public:
//- Deprecated(2019-01) Is the specified name found in the list? //- Deprecated(2019-01) Is the specified name found in the list?
// \deprecated(2019-01) - use found() method // \deprecated(2019-01) - use found() method
inline bool contains(const word& name) const bool FOAM_DEPRECATED_FOR(2019-01, "found() method")
FOAM_DEPRECATED_FOR(2019-01, "found() method") contains(const word& name) const
{ {
return this-found(name); return this->found(name);
} }
}; };