34 template<
class ListType>
39 token::compound::isCompound
57 template<
class ListType>
61 os <<
nl << l.size() <<
nl << token::BEGIN_LIST;
71 os <<
nl << token::END_LIST <<
nl;
75 template<
class ListType>
80 os << token::END_STATEMENT <<
endl;
97 if (os.
format() == IOstream::ASCII || !contiguous<T>())
101 if (L.
size() > 1 && contiguous<T>())
118 os << L.
size() << token::BEGIN_BLOCK;
124 os << token::END_BLOCK;
126 else if (L.
size() <= 1 || (L.
size() < 11 && contiguous<T>()))
129 os << L.
size() << token::BEGIN_LIST;
134 if (i > 0) os << token::SPACE;
139 os << token::END_LIST;
144 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST;
153 os <<
nl << token::END_LIST <<
nl;
166 os.
check(
"Ostream& operator<<(Ostream&, const UList&)");
175 is.
fatalCheck(
"operator>>(Istream&, UList<T>&)");
177 token firstToken(is);
179 is.fatalCheck(
"operator>>(Istream&, UList<T>&) : reading first token");
181 if (firstToken.isCompound())
188 firstToken.transferCompoundToken(is)
197 <<
"incorrect length for UList. Read " <<
s
198 <<
" expected " << L.size()
206 else if (firstToken.isLabel())
208 label s = firstToken.labelToken();
214 <<
"incorrect length for UList. Read " <<
s
215 <<
" expected " << L.size()
221 if (is.format() == IOstream::ASCII || !contiguous<T>())
224 char delimiter = is.readBeginList(
"List");
228 if (delimiter == token::BEGIN_LIST)
236 "operator>>(Istream&, UList<T>&) : reading entry"
247 "operator>>(Istream&, UList<T>&) : "
248 "reading the single entry"
259 is.readEndList(
"List");
265 is.read(
reinterpret_cast<char*
>(L.data()),
s*
sizeof(
T));
269 "operator>>(Istream&, UList<T>&) : reading the binary block"
274 else if (firstToken.isPunctuation())
276 if (firstToken.pToken() != token::BEGIN_LIST)
279 <<
"incorrect first token, expected '(', found "
285 is.putBack(firstToken);
290 if (sll.size() != L.size())
293 <<
"incorrect length for UList. Read " << sll.size()
294 <<
" expected " << L.size()
302 typename SLList<T>::const_iterator iter = sll.begin();
314 <<
"incorrect first token, expected <int> or '(', found "
Non-intrusive singly-linked list.
#define forAll(list, i)
Loop across all elements in list.
streamFormat format() const
Return current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
Traits class for primitives.
A class for handling words, derived from string.
Template function to specify if the data of a type are contiguous.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeListEntry(Ostream &os, const ListType &l)
To & dynamicCast(From &r)
Reference type cast template function,.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Istream & operator>>(Istream &, pistonPointEdgeData &)
void writeListEntries(Ostream &os, const ListType &l)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)