Commit 2af602c2 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: for Istream/Ostream check() use FUNCTION_NAME in messages

parent 0564efb9
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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>())
{
......
......@@ -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())
{
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment