Go to the documentation of this file.
40 && token::compound::isCompound
42 "List<" + word(pTraits<T>::typeName) +
'>'
46 os << word(
"List<" + word(pTraits<T>::typeName) +
'>') <<
" ";
56 os.writeKeyword(keyword);
58 os << token::END_STATEMENT <<
endl;
66 if (os.
format() == IOstream::ASCII || !contiguous<T>())
70 if (L.
size() > 1 && contiguous<T>())
87 os << L.
size() << token::BEGIN_BLOCK;
93 os << token::END_BLOCK;
95 else if (L.
size() <= 1 || (L.
size() < 11 && contiguous<T>()))
98 os << L.
size() << token::BEGIN_LIST;
103 if (i > 0) os << token::SPACE;
108 os << token::END_LIST;
113 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST;
122 os <<
nl << token::END_LIST <<
nl;
135 os.
check(
"Ostream& operator<<(Ostream&, const UList&)");
144 is.
fatalCheck(
"operator>>(Istream&, UList<T>&)");
146 token firstToken(is);
148 is.fatalCheck(
"operator>>(Istream&, UList<T>&) : reading first token");
150 if (firstToken.isCompound())
157 firstToken.transferCompoundToken(is)
166 <<
"incorrect length for UList. Read " <<
s
167 <<
" expected " << L.size()
175 else if (firstToken.isLabel())
177 label s = firstToken.labelToken();
183 <<
"incorrect length for UList. Read " <<
s
184 <<
" expected " << L.size()
190 if (is.format() == IOstream::ASCII || !contiguous<T>())
193 char delimiter = is.readBeginList(
"List");
197 if (delimiter == token::BEGIN_LIST)
205 "operator>>(Istream&, UList<T>&) : reading entry"
216 "operator>>(Istream&, UList<T>&) : "
217 "reading the single entry"
228 is.readEndList(
"List");
234 is.read(
reinterpret_cast<char*
>(L.data()),
s*
sizeof(
T));
238 "operator>>(Istream&, UList<T>&) : reading the binary block"
243 else if (firstToken.isPunctuation())
245 if (firstToken.pToken() != token::BEGIN_LIST)
248 <<
"incorrect first token, expected '(', found "
254 is.putBack(firstToken);
259 if (sll.size() != L.size())
262 <<
"incorrect length for UList. Read " << sll.size()
263 <<
" expected " << L.size()
271 typename SLList<T>::const_iterator iter = sll.begin();
283 <<
"incorrect first token, expected <int> or '(', found "
streamFormat format() const
Return current stream format.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define forAll(list, i)
Loop across all elements in list.
T *__restrict__ v_
Vector of values of type T.
Ostream & endl(Ostream &os)
Add newline and flush stream.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Ostream & write(const token &)=0
Write next token to stream.
Ostream & operator<<(Ostream &, const edgeMesh &)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Template function to specify if the data of a type are contiguous.
To & dynamicCast(From &r)
Reference type cast template function,.
Istream & operator>>(Istream &, edgeMesh &)
void writeEntry(Ostream &) const
Write the UList as a dictionary entry.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label size() const
Return the number of elements in the UList.