Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
2af602c2
Commit
2af602c2
authored
May 26, 2017
by
Mark OLESEN
Browse files
STYLE: for Istream/Ostream check() use FUNCTION_NAME in messages
parent
0564efb9
Changes
147
Hide whitespace changes
Inline
Side-by-side
applications/solvers/electromagnetics/magneticFoam/magnet.H
View file @
2af602c2
...
...
@@ -138,9 +138,7 @@ public:
>>
m
.
orientation_
;
is
.
readEnd
(
"magnet"
);
// Check state of Istream
is
.
check
(
"operator>>(Istream&, magnet&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
etc/codeTemplates/source/_TemplateIO.C
View file @
2af602c2
...
...
@@ -35,8 +35,7 @@ Foam::CLASSNAME::CLASSNAME(Istream& is)
member1
(
is
),
member2
(
is
)
{
// Check state of Istream
is
.
check
(
"Foam::CLASSNAME::CLASSNAME(Foam::Istream&)"
);
is
.
check
(
FUNCTION_NAME
);
}
...
...
@@ -44,25 +43,14 @@ Foam::CLASSNAME::CLASSNAME(Istream& is)
Foam
::
Istream
&
Foam
::
operator
>>
(
Istream
&
is
,
CLASSNAME
&
)
{
// Check state of Istream
is
.
check
(
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CLASSNAME&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
Foam
::
Ostream
&
Foam
::
operator
<<
(
Ostream
&
os
,
const
CLASSNAME
&
)
{
// Check state of Ostream
os
.
check
(
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
"const Foam::CLASSNAME&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
etc/codeTemplates/template/_TemplateTemplateIO.C
View file @
2af602c2
...
...
@@ -36,8 +36,7 @@ Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Istream& is)
member1
(
is
),
member2
(
is
)
{
// Check state of Istream
is
.
check
(
"Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Foam::Istream&)"
);
is
.
check
(
FUNCTION_NAME
);
}
...
...
@@ -50,13 +49,7 @@ Foam::Istream& Foam::operator>>
CLASSNAME
<
TemplateArgument
>&
)
{
// Check state of Istream
is
.
check
(
"Foam::Istream& Foam::operator>>"
"(Foam::Istream&, Foam::CLASSNAME<TemplateArgument>&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -68,13 +61,7 @@ Foam::Ostream& Foam::operator<<
const
CLASSNAME
<
TemplateArgument
>&
)
{
// Check state of Ostream
os
.
check
(
"Foam::Ostream& Foam::operator<<"
"(Ostream&, const CLASSNAME<TemplateArgument>&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OSspecific/POSIX/fileStat.C
View file @
2af602c2
...
...
@@ -123,9 +123,7 @@ Foam::Istream& Foam::operator>>(Istream& is, fileStat& fStat)
fStat
.
status_
.
st_mtime
=
stat
[
11
];
fStat
.
status_
.
st_ctime
=
stat
[
12
];
// Check state of Istream
is
.
check
(
"Istream& operator>>(Istream&, fileStat&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
src/OSspecific/POSIX/memInfo/memInfo.C
View file @
2af602c2
...
...
@@ -118,12 +118,7 @@ Foam::Istream& Foam::operator>>(Istream& is, memInfo& m)
is
.
readEnd
(
"memInfo"
);
// Check state of Istream
is
.
check
(
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::memInfo&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -136,12 +131,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const memInfo& m)
<<
m
.
rss_
<<
token
::
END_LIST
;
// Check state of Ostream
os
.
check
(
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::memInfo&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/algorithms/indexedOctree/volumeType.C
View file @
2af602c2
...
...
@@ -61,9 +61,7 @@ Foam::Istream& Foam::operator>>(Istream& is, volumeType& vt)
// Read end of volumeType
is
.
readEnd
(
"volumeType"
);
// Check state of Istream
is
.
check
(
"operator>>(Istream&, volumeType&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
View file @
2af602c2
...
...
@@ -129,9 +129,7 @@ Foam::Ostream& Foam::HashTable<T, Key, Hash>::writeKeys
os
<<
token
::
END_LIST
<<
nl
;
// End delimiter
}
// Check state of IOstream
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
@@ -145,12 +143,12 @@ Foam::Istream& Foam::operator>>
HashTable
<
T
,
Key
,
Hash
>&
L
)
{
is
.
fatalCheck
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
// Anull list
L
.
clear
();
is
.
fatalCheck
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
@@ -251,7 +249,7 @@ Foam::Istream& Foam::operator>>
<<
exit
(
FatalIOError
);
}
is
.
fatalCheck
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -278,9 +276,7 @@ Foam::Ostream& Foam::operator<<
// Write end delimiter
os
<<
token
::
END_LIST
;
// Check state of IOstream
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C
View file @
2af602c2
...
...
@@ -94,12 +94,12 @@ Foam::StaticHashTable<T, Key, Hash>::printInfo(Ostream& os) const
template
<
class
T
,
class
Key
,
class
Hash
>
Foam
::
Istream
&
Foam
::
operator
>>
(
Istream
&
is
,
StaticHashTable
<
T
,
Key
,
Hash
>&
L
)
{
is
.
fatalCheck
(
"operator>>(Istream&, StaticHashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
// Anull list
L
.
clear
();
is
.
fatalCheck
(
"operator>>(Istream&, StaticHashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
@@ -200,7 +200,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
<<
exit
(
FatalIOError
);
}
is
.
fatalCheck
(
"operator>>(Istream&, StaticHashTable<T, Key, Hash>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -229,9 +229,7 @@ Foam::Ostream& Foam::operator<<
// Write end delimiter
os
<<
token
::
END_LIST
;
// Check state of IOstream
os
.
check
(
"Ostream& operator<<(Ostream&, const StaticHashTable&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/Identifiers/Keyed/KeyedI.H
View file @
2af602c2
...
...
@@ -125,9 +125,7 @@ inline Foam::Istream& Foam::operator>>(Istream& is, Keyed<T>& item)
// Read end of Keyed item/key pair
is
.
readEnd
(
"Keyed<T>"
);
// Check state of Ostream
is
.
check
(
"Istream& operator>>(Istream&, Keyed&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C
View file @
2af602c2
...
...
@@ -33,7 +33,7 @@ template<class LListBase, class T>
template
<
class
INew
>
void
Foam
::
ILList
<
LListBase
,
T
>::
read
(
Istream
&
is
,
const
INew
&
iNew
)
{
is
.
fatalCheck
(
"operator>>(Istream&, ILList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
@@ -97,7 +97,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
}
token
lastToken
(
is
);
is
.
fatalCheck
(
"operator>>(Istream&, ILList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
while
(
...
...
@@ -111,7 +111,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
this
->
append
(
iNew
(
is
).
ptr
());
is
>>
lastToken
;
is
.
fatalCheck
(
"operator>>(Istream&, ILList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
}
else
...
...
@@ -122,7 +122,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
<<
exit
(
FatalIOError
);
}
is
.
fatalCheck
(
"operator>>(Istream&, ILList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
...
...
src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C
View file @
2af602c2
...
...
@@ -44,7 +44,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
// Anull list
L
.
clear
();
is
.
fatalCheck
(
" operator>>(Istream&, LList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
@@ -98,7 +98,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
}
token
lastToken
(
is
);
is
.
fatalCheck
(
" operator>>(Istream&, LList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
while
(
...
...
@@ -114,7 +114,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
L
.
append
(
element
);
is
>>
lastToken
;
is
.
fatalCheck
(
" operator>>(Istream&, LList<LListBase, T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
}
else
...
...
@@ -126,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
}
// Check state of IOstream
is
.
fatalCheck
(
" operator>>(Istream&, LList<LListBase,>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -152,9 +152,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const LList<LListBase, T>& lst)
// Write end of contents
os
<<
token
::
END_LIST
;
// Check state of IOstream
os
.
check
(
"Ostream& operator<<(Ostream&, const LList<LListBase, T>&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C
View file @
2af602c2
...
...
@@ -34,10 +34,7 @@ template<class LListBase, class T>
template
<
class
INew
>
void
Foam
::
LPtrList
<
LListBase
,
T
>::
read
(
Istream
&
is
,
const
INew
&
iNew
)
{
is
.
fatalCheck
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
@@ -102,7 +99,7 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
}
token
lastToken
(
is
);
is
.
fatalCheck
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
while
(
...
...
@@ -116,10 +113,7 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
this
->
append
(
iNew
(
is
).
ptr
());
is
>>
lastToken
;
is
.
fatalCheck
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
}
else
...
...
@@ -132,7 +126,7 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
<<
exit
(
FatalIOError
);
}
is
.
fatalCheck
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
...
...
@@ -190,9 +184,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const LPtrList<LListBase, T>& lst)
// Write end of contents
os
<<
token
::
END_LIST
;
// Check state of IOstream
os
.
check
(
"Ostream& operator<<(Ostream&, const LPtrList<LListBase, T>&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILListIO.C
View file @
2af602c2
...
...
@@ -52,9 +52,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const UILList<LListBase, T>& lst)
// Write end of contents
os
<<
token
::
END_LIST
;
// Check state of IOstream
os
.
check
(
"Ostream& operator<<(Ostream&, const UILList<LListBase, T>&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/Lists/Distribution/Distribution.C
View file @
2af602c2
...
...
@@ -591,9 +591,7 @@ Foam::Istream& Foam::operator>>
>>
d
.
binWidth_
>>
d
.
listStarts_
;
// Check state of Istream
is
.
check
(
"Istream& operator>>(Istream&, Distribution<Type>&)"
);
is
.
check
(
FUNCTION_NAME
);
return
is
;
}
...
...
@@ -609,9 +607,7 @@ Foam::Ostream& Foam::operator<<
<<
d
.
binWidth_
<<
token
::
SPACE
<<
d
.
listStarts_
;
// Check state of Ostream
os
.
check
(
"Ostream& operator<<(Ostream&, "
"const Distribution&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C
View file @
2af602c2
...
...
@@ -139,9 +139,7 @@ Foam::Ostream& Foam::FixedList<T, Size>::writeList
os
.
write
(
reinterpret_cast
<
const
char
*>
(
L
.
cdata
()),
Size
*
sizeof
(
T
));
}
// Check state of IOstream
os
.
check
(
"const FixedList::writeList(Ostream&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
@@ -158,7 +156,7 @@ Foam::FixedList<T, Size>::FixedList(Istream& is)
template
<
class
T
,
unsigned
Size
>
Foam
::
Istream
&
Foam
::
operator
>>
(
Foam
::
Istream
&
is
,
FixedList
<
T
,
Size
>&
L
)
{
is
.
fatalCheck
(
"operator>>(Istream&, FixedList<T, Size>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
if
(
is
.
format
()
==
IOstream
::
ASCII
||
!
contiguous
<
T
>
())
{
...
...
src/OpenFOAM/containers/Lists/List/ListIO.C
View file @
2af602c2
...
...
@@ -46,11 +46,11 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
// Anull list
L
.
setSize
(
0
);
is
.
fatalCheck
(
"operator>>(Istream&, List<T>&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
is
.
fatalCheck
(
"operator>>(Istream&, List<T>&) : reading first token"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
if
(
firstToken
.
isCompound
())
{
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedList.C
View file @
2af602c2
...
...
@@ -266,7 +266,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
PackedList
<
nBits
>&
lst
=
*
this
;
lst
.
clear
();
is
.
fatalCheck
(
"PackedList<nBits>::read(Istream&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstTok
(
is
);
is
.
fatalCheck
...
...
@@ -349,7 +349,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
if
(
firstTok
.
pToken
()
==
token
::
BEGIN_LIST
)
{
token
nextTok
(
is
);
is
.
fatalCheck
(
"PackedList<nBits>::read(Istream&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
while
(
...
...
@@ -362,13 +362,13 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
lst
.
append
(
lst
.
readValue
(
is
));
is
>>
nextTok
;
is
.
fatalCheck
(
"PackedList<nBits>::read(Istream&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
}
else
if
(
firstTok
.
pToken
()
==
token
::
BEGIN_BLOCK
)
{
token
nextTok
(
is
);
is
.
fatalCheck
(
"PackedList<nBits>::read(Istream&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
while
(
...
...
@@ -381,7 +381,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
lst
.
setPair
(
is
);
is
>>
nextTok
;
is
.
fatalCheck
(
"PackedList<nBits>::read(Istream&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
}
}
else
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
View file @
2af602c2
...
...
@@ -137,8 +137,7 @@ inline void Foam::PackedList<nBits>::setPair(Istream& is)
set
(
ind
,
val
);
// Check state of Istream
is
.
check
(
"PackedList<nBits>::setPair(Istream&)"
);
is
.
check
(
FUNCTION_NAME
);
}
...
...
src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C
View file @
2af602c2
...
...
@@ -35,7 +35,7 @@ template<class T>
template
<
class
INew
>
void
Foam
::
PtrList
<
T
>::
read
(
Istream
&
is
,
const
INew
&
inewt
)
{
is
.
fatalCheck
(
"PtrList<T>::read(Istream&, const INew&)"
);
is
.
fatalCheck
(
FUNCTION_NAME
);
token
firstToken
(
is
);
...
...
src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
View file @
2af602c2
...
...
@@ -120,9 +120,7 @@ Foam::Ostream& Foam::UIndirectList<T>::writeList
}
}
// Check state of IOstream
os
.
check
(
"UIndirectList::writeList(Ostream&)"
);
os
.
check
(
FUNCTION_NAME
);
return
os
;
}
...
...
Prev
1
2
3
4
5
…
8
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment